mirror of
https://github.com/ssyyhhrr/stewardle.git
synced 2025-11-18 14:53:38 -05:00
Tutorial Closer
This commit is contained in:
@@ -217,6 +217,7 @@ p a:hover {
|
||||
transform: translate(-50%, -50%);
|
||||
box-shadow: 0 4px 23px 0 rgb(0 0 0 / 20%);
|
||||
padding: 1.6em;
|
||||
transition: all 0.5s;
|
||||
}
|
||||
|
||||
.splitter {
|
||||
@@ -225,6 +226,19 @@ p a:hover {
|
||||
background-color: #3a3a3c;
|
||||
}
|
||||
|
||||
.close {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
right: 1.6em;
|
||||
font-size: 1.4em;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.close:hover {
|
||||
color: #D3D3D3;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.backdrop {
|
||||
width: 150vw;
|
||||
height: 150vh;
|
||||
@@ -234,6 +248,7 @@ p a:hover {
|
||||
padding: 0;
|
||||
transform: translate(-25vw, -25vh);
|
||||
opacity: 0.6;
|
||||
transition: all 0.5s;
|
||||
z-index: 1
|
||||
}
|
||||
|
||||
@@ -255,7 +270,7 @@ p a:hover {
|
||||
}
|
||||
|
||||
.tutorial .team {
|
||||
padding: 7px;
|
||||
padding: 9px;
|
||||
}
|
||||
|
||||
#time {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
let canClose = true
|
||||
|
||||
function autocomplete(inp, arr) {
|
||||
/*the autocomplete function takes two arguments,
|
||||
the text field element and an array of possible autocompleted values:*/
|
||||
@@ -251,4 +253,25 @@ function editDistance(s1, s2) {
|
||||
costs[s2.length] = lastValue;
|
||||
}
|
||||
return costs[s2.length];
|
||||
}
|
||||
|
||||
document.getElementsByClassName("backdrop")[0].onmousedown = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
document.getElementsByClassName("close")[0].onmousedown = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
function close() {
|
||||
if (!canClose) return
|
||||
canClose = false
|
||||
let tutorial = document.getElementsByClassName("tutorial")[0]
|
||||
let backdrop = document.getElementsByClassName("backdrop")[0]
|
||||
tutorial.style.opacity = 0
|
||||
backdrop.style.opacity = 0
|
||||
setTimeout(() => {
|
||||
tutorial.remove()
|
||||
backdrop.remove()
|
||||
}, 500)
|
||||
}
|
||||
Reference in New Issue
Block a user