diff --git a/index.html b/index.html index 39483bb..b7536e6 100644 --- a/index.html +++ b/index.html @@ -1,34 +1,32 @@ + + + + + pop up message + - - - - - pop up message - - - - - - - - + + + + + diff --git a/index.ts b/index.ts index 9261b1a..f7a20f7 100644 --- a/index.ts +++ b/index.ts @@ -39,7 +39,7 @@ function popupMsg(msg: string, time: number, dev: number, style?: style) { top: 0, left: '50%', transform: 'translateX(-50%) translateY(-100%)', - transition: 'all 300ms', + transition: 'all 100ms', 'word-break': 'break-all', 'font-size': '14px' }; @@ -49,14 +49,14 @@ function popupMsg(msg: string, time: number, dev: number, style?: style) { document.body.appendChild(box); setTimeout(() => { box.style.top = `${dev}px`; - }) + }); setTimeout(() => { box.style.top = '0'; - let dur: number | string = box.style.transitionDuration + let dur: number | string = box.style.transitionDuration; if (/ms$/.test(dur)) { - dur = parseFloat(dur) - }else { - dur = parseFloat(dur) * 1000 + dur = parseFloat(dur); + } else { + dur = parseFloat(dur) * 1000; } setTimeout(() => { document.body.removeChild(box);