refactor(scss): remove alert style and script
It is not used in this theme
This commit is contained in:
parent
26acceb37d
commit
a2a49e7537
@ -41,23 +41,3 @@ a {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user