mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-23 08:33:38 +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 = [
|
const jsFiles = [
|
||||||
path.src + '/js/helper.js',
|
path.src + '/js/helper.js',
|
||||||
path.src + '/js/data.js',
|
path.src + '/js/data.js',
|
||||||
|
path.src + '/js/ready.js',
|
||||||
path.src + '/js/fontawesome.js',
|
path.src + '/js/fontawesome.js',
|
||||||
path.src + '/js/update.js',
|
path.src + '/js/update.js',
|
||||||
path.src + '/js/state.js',
|
path.src + '/js/state.js',
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: var(--z-index-background);
|
z-index: var(--z-index-background);
|
||||||
animation: appear var(--layout-timing-medium) 1;
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,12 @@ body {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity var(--layout-timing-fast);
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-ready body {
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.is-background-color-by-theme,
|
html.is-background-color-by-theme,
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<!-- nightTab -->
|
<!-- nightTab -->
|
||||||
<script src="js/helper.js"></script>
|
<script src="js/helper.js"></script>
|
||||||
<script src="js/data.js"></script>
|
<script src="js/data.js"></script>
|
||||||
|
<script src="js/ready.js"></script>
|
||||||
<script src="js/fontawesome.js"></script>
|
<script src="js/fontawesome.js"></script>
|
||||||
<script src="js/update.js"></script>
|
<script src="js/update.js"></script>
|
||||||
<script src="js/state.js"></script>
|
<script src="js/state.js"></script>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// log version
|
// log version
|
||||||
console.log("nightTab version", version.get().number, version.get().name);
|
console.log("nightTab version", version.get().number, version.get().name);
|
||||||
|
ready.init();
|
||||||
data.init();
|
data.init();
|
||||||
state.init();
|
state.init();
|
||||||
header.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