mirror of
https://github.com/danbulant/ester_os
synced 2026-05-27 05:42:04 +00:00
Simple boot animation
This commit is contained in:
parent
256d76855b
commit
d417b97674
2 changed files with 63 additions and 0 deletions
|
|
@ -1,6 +1,15 @@
|
||||||
import RendererDef from '../defs/renderer';
|
import RendererDef from '../defs/renderer';
|
||||||
import RenderStates from '../defs/renderStates';
|
import RenderStates from '../defs/renderStates';
|
||||||
|
import Welcome from './welcome';
|
||||||
|
|
||||||
|
import './styles/boot.css';
|
||||||
|
|
||||||
|
/*
|
||||||
|
A word why this is the only renderer that doesn't have prepare() function that prepares
|
||||||
|
rendering elements between actually rendering them.
|
||||||
|
It's quite simple: this is the first renderer to start, so we want to user to see
|
||||||
|
something as fast as possible, so they don't stare at white screen.
|
||||||
|
*/
|
||||||
export default class Boot implements RendererDef {
|
export default class Boot implements RendererDef {
|
||||||
name = "boot";
|
name = "boot";
|
||||||
removePrevious = true;
|
removePrevious = true;
|
||||||
|
|
@ -10,9 +19,26 @@ export default class Boot implements RendererDef {
|
||||||
console.log("Boot renderer active");
|
console.log("Boot renderer active");
|
||||||
this.state = RenderStates.Rendered;
|
this.state = RenderStates.Rendered;
|
||||||
|
|
||||||
|
const body = document.body;
|
||||||
|
|
||||||
|
var boot = document.createElement("div");
|
||||||
|
body.appendChild(boot);
|
||||||
|
boot.className = "boot-rendered";
|
||||||
|
boot.id = "boot";
|
||||||
|
|
||||||
|
var text = document.createElement("div");
|
||||||
|
text.innerText = "Booting Ester OS!";
|
||||||
|
text.className = "boot-text";
|
||||||
|
|
||||||
|
boot.appendChild(text);
|
||||||
|
|
||||||
|
var w = new Welcome();
|
||||||
|
w.prepare().then(()=>{w.render()});
|
||||||
}
|
}
|
||||||
eject(){
|
eject(){
|
||||||
console.log("Boot renderer ejected");
|
console.log("Boot renderer ejected");
|
||||||
this.state = RenderStates.Ejected;
|
this.state = RenderStates.Ejected;
|
||||||
|
|
||||||
|
document.body.removeChild(document.getElementById("boot"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
37
client/src/renderers/styles/boot.css
Normal file
37
client/src/renderers/styles/boot.css
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
@import url("/fonts/roboto/roboto_medium_macroman/stylesheet.css");
|
||||||
|
|
||||||
|
.boot-rendered {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgb(31, 31, 31);
|
||||||
|
color: white;
|
||||||
|
font-size: 30px;
|
||||||
|
font-family: "robotomedium";
|
||||||
|
animation-name: boot-text-anim;
|
||||||
|
animation-duration: 2s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
}
|
||||||
|
@keyframes boot-text-anim {
|
||||||
|
0% {
|
||||||
|
text-shadow: 0 0 0 rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
text-shadow: 0 0 5px rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
text-shadow: 0 0 0 rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.boot-text {
|
||||||
|
position: fixed;
|
||||||
|
text-align: center;
|
||||||
|
width: 400px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -200px;
|
||||||
|
height: 100px;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -50px;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue