mirror of https://github.com/kiwix/libkiwix.git
minor changes in fadeout effect
This commit is contained in:
parent
d6c62b3cd3
commit
1ccafe2d97
|
@ -6,6 +6,8 @@
|
||||||
};
|
};
|
||||||
const filterTypes = ['lang', 'category', 'q'];
|
const filterTypes = ['lang', 'category', 'q'];
|
||||||
const bookMap = new Map();
|
const bookMap = new Map();
|
||||||
|
let footer;
|
||||||
|
let fadeOutDiv;
|
||||||
let iso;
|
let iso;
|
||||||
let isFetching = false;
|
let isFetching = false;
|
||||||
let noResultInjected = false;
|
let noResultInjected = false;
|
||||||
|
@ -56,11 +58,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleFooter(show=false) {
|
function toggleFooter(show=false) {
|
||||||
const footer = document.getElementById('kiwixfooter');
|
|
||||||
const fadeOutDiv = document.getElementById('fadeOut');
|
|
||||||
if (show) {
|
if (show) {
|
||||||
footer.style.display = 'block';
|
footer.style.display = 'block';
|
||||||
fadeOutDiv.style.display = 'none';
|
|
||||||
} else {
|
} else {
|
||||||
footer.style.display = 'none';
|
footer.style.display = 'none';
|
||||||
fadeOutDiv.style.display = 'block';
|
fadeOutDiv.style.display = 'block';
|
||||||
|
@ -96,7 +95,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAndInjectEmptyMessage() {
|
function checkAndInjectEmptyMessage() {
|
||||||
const kiwixBodyDiv = document.getElementsByClassName('kiwixHomeBody')[0];
|
|
||||||
if (!bookMap.size) {
|
if (!bookMap.size) {
|
||||||
if (!noResultInjected) {
|
if (!noResultInjected) {
|
||||||
noResultInjected = true;
|
noResultInjected = true;
|
||||||
|
@ -158,6 +156,7 @@
|
||||||
isFetching = false;
|
isFetching = false;
|
||||||
incrementalLoadingParams.start = 0;
|
incrementalLoadingParams.start = 0;
|
||||||
incrementalLoadingParams.count = viewPortToCount();
|
incrementalLoadingParams.count = viewPortToCount();
|
||||||
|
fadeOutDiv.style.display = 'none';
|
||||||
bookMap.clear();
|
bookMap.clear();
|
||||||
params = new URLSearchParams(window.location.search);
|
params = new URLSearchParams(window.location.search);
|
||||||
if (filterType) {
|
if (filterType) {
|
||||||
|
@ -173,9 +172,14 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
async function loadSubset() {
|
async function loadSubset() {
|
||||||
if (incrementalLoadingParams.count && window.innerHeight + window.scrollY >= document.body.offsetHeight) {
|
if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
|
||||||
|
if (incrementalLoadingParams.count) {
|
||||||
loadAndDisplayBooks();
|
loadAndDisplayBooks();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
fadeOutDiv.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', (event) => {
|
window.addEventListener('resize', (event) => {
|
||||||
|
@ -199,6 +203,8 @@
|
||||||
},
|
},
|
||||||
sortBy: 'weight'
|
sortBy: 'weight'
|
||||||
});
|
});
|
||||||
|
footer = document.getElementById('kiwixfooter');
|
||||||
|
fadeOutDiv = document.getElementById('fadeOut');
|
||||||
await loadAndDisplayBooks();
|
await loadAndDisplayBooks();
|
||||||
await loadAndDisplayOptions('#languageFilter', langList);
|
await loadAndDisplayOptions('#languageFilter', langList);
|
||||||
await loadAndDisplayOptions('#categoryFilter', categoryList);
|
await loadAndDisplayOptions('#categoryFilter', categoryList);
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
margin: 30px 0;
|
margin: 0 0 15px;
|
||||||
}
|
}
|
||||||
.book {
|
.book {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -76,6 +76,9 @@
|
||||||
.kiwixFilter {
|
.kiwixFilter {
|
||||||
margin: 8px 10px;
|
margin: 8px 10px;
|
||||||
}
|
}
|
||||||
|
.kiwixSearch, .searchButton {
|
||||||
|
margin: 0 13px 0 0;
|
||||||
|
}
|
||||||
.kiwixSearchForm {
|
.kiwixSearchForm {
|
||||||
margin: 8px 10px;
|
margin: 8px 10px;
|
||||||
float: right;
|
float: right;
|
||||||
|
@ -128,9 +131,6 @@
|
||||||
top: 48%;
|
top: 48%;
|
||||||
left: 42%;
|
left: 42%;
|
||||||
}
|
}
|
||||||
.shadow {
|
|
||||||
box-shadow: 0 6px 2px -3px grey;
|
|
||||||
}
|
|
||||||
.loader-spinner {
|
.loader-spinner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -50%;
|
top: -50%;
|
||||||
|
@ -145,6 +145,7 @@
|
||||||
animation: spin 1s linear infinite;
|
animation: spin 1s linear infinite;
|
||||||
margin-top: 35px;
|
margin-top: 35px;
|
||||||
margin-bottom: -35px;
|
margin-bottom: -35px;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
/* Safari */
|
/* Safari */
|
||||||
@-webkit-keyframes spin {
|
@-webkit-keyframes spin {
|
||||||
|
@ -161,7 +162,8 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.fadeOut {
|
.fadeOut {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
|
display: none;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
@ -169,6 +171,10 @@
|
||||||
height: 80px;
|
height: 80px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.spacer {
|
||||||
|
height: 20px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="{{root}}/skin/isotope.pkgd.min.js" defer></script>
|
<script src="{{root}}/skin/isotope.pkgd.min.js" defer></script>
|
||||||
<script src="{{root}}/skin/categoryList.js"></script>
|
<script src="{{root}}/skin/categoryList.js"></script>
|
||||||
|
@ -186,7 +192,7 @@
|
||||||
</select>
|
</select>
|
||||||
<form id='kiwixSearchForm' class='kiwixSearchForm'>
|
<form id='kiwixSearchForm' class='kiwixSearchForm'>
|
||||||
<input type="text" name="q" id="searchFilter" class='kiwixSearch'>
|
<input type="text" name="q" id="searchFilter" class='kiwixSearch'>
|
||||||
<input type="submit" value="Submit"/>
|
<input type="submit" class="searchButton" value="Search"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="kiwixHomeBody">
|
<div class="kiwixHomeBody">
|
||||||
|
@ -194,6 +200,7 @@
|
||||||
<div id="fadeOut" class="fadeOut"></div>
|
<div id="fadeOut" class="fadeOut"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="loader"><div class="loader-spinner"></div></div>
|
<div class="loader"><div class="loader-spinner"></div></div>
|
||||||
|
<div class="spacer"></div>
|
||||||
<div id="kiwixfooter">Powered by <a href="https://kiwix.org">Kiwix</a></div>
|
<div id="kiwixfooter">Powered by <a href="https://kiwix.org">Kiwix</a></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue