@@ -7,8 +7,8 @@ import { tapbodyEmitter } from './emitter/tapbody';
77import { tapfaceEmitter } from './emitter/tapface' ;
88import { hitokotoVariable } from './variable/hitokoto' ;
99
10- document . head . innerHTML += `
11- <style>
10+ const dialogStyle = document . createElement ( 'style' ) ;
11+ dialogStyle . innerHTML = `
1212 .live2d-widget-dialog-container {
1313 width: 300px;
1414 height: 120px;
@@ -39,9 +39,8 @@ document.head.innerHTML += `
3939 @keyframes live2d-widget-dialog-tingle {
4040 0% { transform: translate(-1px, 1.5px) rotate(-2deg); }
4141 100% { transform: translate(1px, -1.5px) rotate(2deg); }
42- }
43- </style>
44- ` ;
42+ }` ;
43+ document . head . appendChild ( dialogStyle ) ;
4544
4645let containerElement , dialogElement , closeTimer ;
4746
@@ -52,7 +51,7 @@ let containerElement,dialogElement,closeTimer;
5251function createDialogElement ( root ) {
5352 containerElement = document . createElement ( 'div' ) ;
5453 containerElement . className = 'live2d-widget-dialog-container' ;
55- containerElement . style . transform = `scale(${ config . display . width / 250 } )`
54+ containerElement . style . transform = `scale(${ config . display . width / 250 } )` ;
5655 dialogElement = document . createElement ( 'div' ) ;
5756 dialogElement . className = 'live2d-widget-dialog' ;
5857 containerElement . appendChild ( dialogElement ) ;
@@ -70,7 +69,7 @@ function createDialogElement(root) {
7069 scriptEngine . registerVariable ( 'hitokoto' , hitokotoVariable ) ;
7170 Object . keys ( config . dialog . script ) . forEach ( key => {
7271 scriptEngine . run ( key , config . dialog . script [ key ] ) ;
73- } )
72+ } ) ;
7473 }
7574}
7675
@@ -93,4 +92,4 @@ function alertText(text) {
9392
9493module . exports = {
9594 createDialogElement, displayDialog, hiddenDialog, alertText
96- }
95+ } ;
0 commit comments