Skip to content

Commit 45f8b37

Browse files
committed
Live2D Widget
1 parent 8a8c468 commit 45f8b37

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/pages/info/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Docusaurus 3.9.2
1717

1818
\+ Docusaurus Search Local 2.0.1
1919

20+
\+ Live2D Widget 1.0.0
21+
2022
## Date of Creation
2123

2224
![y](pathname:///img/Info/y.svg) y ![m](pathname:///img/Info/m.svg) m ![d](pathname:///img/Info/d.svg) d

src/theme/Root.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React, { useEffect } from 'react';
2+
3+
export default function Root({ children }) {
4+
useEffect(() => {
5+
const script = document.createElement('script');
6+
script.src = 'https://fastly.jsdelivr.net/npm/live2d-widgets@1.0.0/dist/autoload.js';
7+
script.async = true;
8+
document.body.appendChild(script);
9+
10+
return () => {
11+
document.body.removeChild(script);
12+
};
13+
}, []);
14+
15+
return <>{children}</>;
16+
}

0 commit comments

Comments
 (0)