refactor(scss): remove alert style and script

It is not used in this theme
This commit is contained in:
Jimmy Cai 2020-09-23 13:22:03 +02:00
parent 26acceb37d
commit a2a49e7537
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18
2 changed files with 1 additions and 44 deletions

View File

@ -40,24 +40,4 @@ a {
box-shadow: 0px -10px 0px rgba(var(--link-background-color), var(--link-background-opacity-hover)) inset; 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;
}
}

View File

@ -65,29 +65,6 @@ let Stack = {
observer.observe(articleTile) 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);
} }
} }