classier end
This commit is contained in:
parent
57cdea41f9
commit
ee36c2d8fb
@ -9,6 +9,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
<span id="end">Libre</span>
|
||||
|
||||
<!-- Import maps polyfill -->
|
||||
<!-- Remove this when import maps will be widely supported -->
|
||||
|
11
main.js
11
main.js
@ -453,8 +453,7 @@ function playerCollisions() {
|
||||
|
||||
if ( !escaped && raftOctree.capsuleIntersect( playerCollider ) ) {
|
||||
|
||||
escaped = true;
|
||||
alert("Congrats! You finally escaped.");
|
||||
end.className = "escaped";
|
||||
|
||||
}
|
||||
|
||||
@ -478,6 +477,12 @@ function playerCollisions() {
|
||||
|
||||
}
|
||||
|
||||
addEventListener("animationend", (event) => {
|
||||
escaped = true;
|
||||
document.exitPointerLock();
|
||||
});
|
||||
|
||||
|
||||
function updatePlayer( deltaTime ) {
|
||||
|
||||
let damping = Math.exp( - 4 * deltaTime ) - 1;
|
||||
@ -627,6 +632,6 @@ function animate() {
|
||||
|
||||
if ( showStats ) stats.update();
|
||||
|
||||
requestAnimationFrame( animate );
|
||||
if ( !escaped ) requestAnimationFrame( animate );
|
||||
|
||||
}
|
54
style.css
54
style.css
@ -1,10 +1,46 @@
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
font-family: Monospace;
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
overscroll-behavior: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
margin: 0;
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
font-family: Monospace;
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
overscroll-behavior: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
canvas {
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
@keyframes escaped{
|
||||
0% {
|
||||
opacity: 0%;
|
||||
background: transparent;
|
||||
height: 10vh;
|
||||
padding-top: 90vh;
|
||||
}
|
||||
}
|
||||
|
||||
#end {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
font-size: 10vh;
|
||||
font-family: Georgia, serif;
|
||||
color: gray;
|
||||
justify-content: center;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#end.escaped {
|
||||
display: flex;
|
||||
animation: escaped 5s;
|
||||
height: 50vh;
|
||||
padding-top: 50vh;
|
||||
opacity: 100%;
|
||||
background: white;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user