mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
refactor(scss): remove alert style and script
It is not used in this theme
This commit is contained in:
parent
26acceb37d
commit
a2a49e7537
2 changed files with 1 additions and 44 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 a new issue