From a2a49e7537655839f9d52b7b847b0c01fdb2494c Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Wed, 23 Sep 2020 13:22:03 +0200 Subject: [PATCH] refactor(scss): remove alert style and script It is not used in this theme --- assets/scss/style.scss | 22 +--------------------- assets/ts/main.ts | 23 ----------------------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/assets/scss/style.scss b/assets/scss/style.scss index a0ccbf6..5e07b9c 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -40,24 +40,4 @@ a { box-shadow: 0px -10px 0px rgba(var(--link-background-color), var(--link-background-opacity-hover)) inset; } } -} - -.alert { - position: fixed; - right: 20px; - bottom: 20px; - z-index: 5; - background: var(--card-background); - max-width: 400px; - padding: 15px 20px; - border-radius: var(--card-border-radius); - line-height: 1.75; - color: var(--card-text-color-secondary); - box-shadow: var(--shadow-l2); - - @media (max-width: $on-phone) { - max-width: 100vw; - width: calc(100% - 30px); - left: 15px; - } -} +} \ No newline at end of file diff --git a/assets/ts/main.ts b/assets/ts/main.ts index c7ddaab..b9164cc 100644 --- a/assets/ts/main.ts +++ b/assets/ts/main.ts @@ -65,29 +65,6 @@ let Stack = { observer.observe(articleTile) } - }, - alert: (content, time = 5000, animationSpeed = 500) => { - const alert = document.createElement('div'); - alert.innerHTML = content; - alert.className = 'alert'; - alert.style.visibility = 'hidden'; - document.body.appendChild(alert); - - alert.style.transform = `translateY(${alert.clientHeight + 50}px)`; - alert.style.transition = `transform ${animationSpeed / 1000}s ease`; - - setTimeout(() => { - alert.style.removeProperty('visibility'); - alert.style.transform = `translateY(0)`; - }, animationSpeed); - - setTimeout(() => { - alert.style.transform = `translateY(${alert.clientHeight + 50}px)`; - }, animationSpeed + time); - - setTimeout(() => { - alert.remove(); - }, 2 * animationSpeed + time); } }