mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-23 00:23:28 +01:00
[design] add page load fade in
This commit is contained in:
parent
3e6084b9ea
commit
13d60525e0
@ -75,6 +75,7 @@ const cssFiles = [
|
||||
const jsFiles = [
|
||||
path.src + '/js/helper.js',
|
||||
path.src + '/js/data.js',
|
||||
path.src + '/js/ready.js',
|
||||
path.src + '/js/fontawesome.js',
|
||||
path.src + '/js/update.js',
|
||||
path.src + '/js/state.js',
|
||||
|
@ -6,7 +6,6 @@
|
||||
height: 100vh;
|
||||
pointer-events: none;
|
||||
z-index: var(--z-index-background);
|
||||
animation: appear var(--layout-timing-medium) 1;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,12 @@ body {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
opacity: 0;
|
||||
transition: opacity var(--layout-timing-fast);
|
||||
}
|
||||
|
||||
.is-ready body {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
html.is-background-color-by-theme,
|
||||
|
@ -7,6 +7,7 @@
|
||||
<!-- nightTab -->
|
||||
<script src="js/helper.js"></script>
|
||||
<script src="js/data.js"></script>
|
||||
<script src="js/ready.js"></script>
|
||||
<script src="js/fontawesome.js"></script>
|
||||
<script src="js/update.js"></script>
|
||||
<script src="js/state.js"></script>
|
||||
|
@ -1,5 +1,6 @@
|
||||
// log version
|
||||
console.log("nightTab version", version.get().number, version.get().name);
|
||||
ready.init();
|
||||
data.init();
|
||||
state.init();
|
||||
header.init();
|
||||
|
36
src/js/ready.js
Normal file
36
src/js/ready.js
Normal file
@ -0,0 +1,36 @@
|
||||
var ready = (function() {
|
||||
|
||||
var bind = {};
|
||||
|
||||
bind.loaded = {
|
||||
func: function() {
|
||||
render.loaded();
|
||||
bind.loaded.remove();
|
||||
},
|
||||
add: function() {
|
||||
window.addEventListener("load", bind.loaded.func, false);
|
||||
},
|
||||
remove: function() {
|
||||
window.removeEventListener("load", bind.loaded.func);
|
||||
}
|
||||
};
|
||||
|
||||
var render = {};
|
||||
|
||||
render.loaded = function() {
|
||||
var html = helper.e("html");
|
||||
helper.addClass(html, "is-ready");
|
||||
};
|
||||
|
||||
var init = function() {
|
||||
bind.loaded.add();
|
||||
};
|
||||
|
||||
// exposed methods
|
||||
return {
|
||||
init: init,
|
||||
bind: bind,
|
||||
render: render
|
||||
};
|
||||
|
||||
})();
|
Loading…
Reference in New Issue
Block a user