mirror of https://github.com/kiwix/libkiwix.git
minoor changes in responsive behaviour
This commit is contained in:
parent
55672b0288
commit
2effb3490e
|
@ -1,13 +1,3 @@
|
||||||
@font-face {
|
|
||||||
font-family: "poppins";
|
|
||||||
src: url("{{root}}/skin/fonts/Poppins.ttf") format("truetype");
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: "roboto";
|
|
||||||
src: url("{{root}}/skin/fonts/Roboto.ttf") format("truetype");
|
|
||||||
}
|
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*::after,
|
*::after,
|
||||||
*::before {
|
*::before {
|
||||||
|
@ -34,7 +24,7 @@ body {
|
||||||
background-color: #f4f6f8;
|
background-color: #f4f6f8;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 20px 11vw;
|
padding: 20px 11vw;
|
||||||
height: 17vh;
|
height: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kiwixNav__results {
|
.kiwixNav__results {
|
||||||
|
@ -67,7 +57,8 @@ body {
|
||||||
|
|
||||||
.kiwixHomeBody {
|
.kiwixHomeBody {
|
||||||
padding: 20px 15vw;
|
padding: 20px 15vw;
|
||||||
min-height: 79vh;
|
min-height: calc(100vh - 230px);
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.book__list {
|
.book__list {
|
||||||
|
@ -115,13 +106,14 @@ body {
|
||||||
|
|
||||||
.book__description {
|
.book__description {
|
||||||
grid-column: 1 / 3;
|
grid-column: 1 / 3;
|
||||||
margin: 1px 10px;
|
margin: 0.5px 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 9;
|
-webkit-line-clamp: 8;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
font-family: roboto;
|
font-family: roboto;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
|
font-size: 1.2rem;
|
||||||
color: #4d4d4d;
|
color: #4d4d4d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,10 +134,10 @@ body {
|
||||||
|
|
||||||
.book__tags {
|
.book__tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: right;
|
text-align: end;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
justify-content: end;
|
justify-content: flex-end;
|
||||||
font-family: roboto;
|
font-family: roboto;
|
||||||
color: #909090;
|
color: #909090;
|
||||||
}
|
}
|
||||||
|
@ -159,9 +151,8 @@ body {
|
||||||
.book__links > a, .book__links > span {
|
.book__links > a, .book__links > span {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: right;
|
text-align: -webkit-right;
|
||||||
justify-content: end;
|
justify-content: flex-end;
|
||||||
align-items: flex-end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.book__links > a {
|
.book__links > a {
|
||||||
|
@ -184,11 +175,12 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.noResults {
|
.noResults {
|
||||||
position: absolute;
|
|
||||||
top: 48%;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noResults > a {
|
||||||
|
color: #3498db;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loader-spinner {
|
.loader-spinner {
|
||||||
|
@ -231,7 +223,7 @@ body {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
height: 3vh;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kiwixfooter > a {
|
.kiwixfooter > a {
|
||||||
|
@ -240,8 +232,13 @@ body {
|
||||||
|
|
||||||
@media screen and (max-width: 1100px) {
|
@media screen and (max-width: 1100px) {
|
||||||
|
|
||||||
|
.kiwixNav {
|
||||||
|
height: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
.kiwixHomeBody {
|
.kiwixHomeBody {
|
||||||
padding: 20px 11vw;
|
padding: 20px 10vw;
|
||||||
|
min-height: calc(100vh - 280px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.kiwixNav__filters {
|
.kiwixNav__filters {
|
||||||
|
@ -250,43 +247,22 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 650px) {
|
@media screen and (max-width: 650px) {
|
||||||
|
|
||||||
|
.kiwixNav {
|
||||||
|
height: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kiwixHomeBody {
|
||||||
|
min-height: calc(100vh - 380px);
|
||||||
|
}
|
||||||
|
|
||||||
.kiwixNav__filters {
|
.kiwixNav__filters {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-height: 900px) {
|
@media screen and (max-width: 340px) {
|
||||||
|
|
||||||
.kiwixNav {
|
|
||||||
height: 31vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.kiwixHomeBody {
|
.kiwixHomeBody {
|
||||||
min-height: 64vh;
|
padding: 20px 5vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kiwixfooter {
|
|
||||||
height: 5vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-height: 450px) {
|
|
||||||
|
|
||||||
.kiwixNav {
|
|
||||||
height: 55vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.kiwixHomeBody {
|
|
||||||
min-height: 39vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.kiwixfooter {
|
|
||||||
height: 5vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.noResults {
|
|
||||||
top: 65%;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
const bookOrderMap = new Map();
|
const bookOrderMap = new Map();
|
||||||
const filterCookieName = 'filters';
|
const filterCookieName = 'filters';
|
||||||
const oneDayDelta = 86400000;
|
const oneDayDelta = 86400000;
|
||||||
|
let loader;
|
||||||
let footer;
|
let footer;
|
||||||
let fadeOutDiv;
|
let fadeOutDiv;
|
||||||
let iso;
|
let iso;
|
||||||
|
@ -75,7 +76,7 @@
|
||||||
.filter((tag, index, tags) => tags.indexOf(tag) === index).join(' | ');
|
.filter((tag, index, tags) => tags.indexOf(tag) === index).join(' | ');
|
||||||
let downloadLink;
|
let downloadLink;
|
||||||
try {
|
try {
|
||||||
downloadLink = book.querySelector('link[type="application/x-zim"]').getAttribute('href');
|
downloadLink = book.querySelector('link[type="application/x-zim"]').getAttribute('href').split('.meta4')[0];
|
||||||
} catch {
|
} catch {
|
||||||
downloadLink = '';
|
downloadLink = '';
|
||||||
}
|
}
|
||||||
|
@ -135,16 +136,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAndInjectEmptyMessage() {
|
function checkAndInjectEmptyMessage() {
|
||||||
|
const kiwixHomeBody = document.querySelector('.kiwixHomeBody');
|
||||||
if (!bookOrderMap.size) {
|
if (!bookOrderMap.size) {
|
||||||
if (!noResultInjected) {
|
if (!noResultInjected) {
|
||||||
noResultInjected = true;
|
noResultInjected = true;
|
||||||
iso.remove(document.getElementsByClassName('book__list')[0].getElementsByTagName('a'));
|
iso.remove(document.getElementsByClassName('book__list')[0].getElementsByTagName('a'));
|
||||||
iso.layout();
|
iso.layout();
|
||||||
const spanTag = document.createElement('span');
|
const divTag = document.createElement('div');
|
||||||
spanTag.setAttribute('class', 'noResults');
|
divTag.setAttribute('class', 'noResults');
|
||||||
spanTag.innerHTML = `No result. Would you like to <a href="/?lang=">reset filter?</a>`;
|
divTag.innerHTML = `No result. Would you like to<a href="/?lang="> reset filter?</a>`;
|
||||||
document.querySelector('body').append(spanTag);
|
kiwixHomeBody.append(divTag);
|
||||||
spanTag.getElementsByTagName('a')[0].onclick = (event) => {
|
kiwixHomeBody.setAttribute('style', 'display: flex; justify-content: center; align-items: center');
|
||||||
|
divTag.getElementsByTagName('a')[0].onclick = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
window.history.pushState({}, null, `${window.location.href.split('?')[0]}?lang=`);
|
window.history.pushState({}, null, `${window.location.href.split('?')[0]}?lang=`);
|
||||||
setCookie(filterCookieName, 'lang=');
|
setCookie(filterCookieName, 'lang=');
|
||||||
|
@ -157,6 +160,7 @@
|
||||||
} else if (noResultInjected) {
|
} else if (noResultInjected) {
|
||||||
noResultInjected = false;
|
noResultInjected = false;
|
||||||
document.getElementsByClassName('noResults')[0].remove();
|
document.getElementsByClassName('noResults')[0].remove();
|
||||||
|
kiwixHomeBody.removeAttribute('style');
|
||||||
}
|
}
|
||||||
loader.removeAttribute('style');
|
loader.removeAttribute('style');
|
||||||
return false;
|
return false;
|
||||||
|
@ -254,6 +258,7 @@
|
||||||
});
|
});
|
||||||
footer = document.getElementById('kiwixfooter');
|
footer = document.getElementById('kiwixfooter');
|
||||||
fadeOutDiv = document.getElementById('fadeOut');
|
fadeOutDiv = document.getElementById('fadeOut');
|
||||||
|
loader = document.querySelector('.loader');
|
||||||
await loadAndDisplayBooks();
|
await loadAndDisplayBooks();
|
||||||
await loadAndDisplayOptions('#languageFilter', langList);
|
await loadAndDisplayOptions('#languageFilter', langList);
|
||||||
await loadAndDisplayOptions('#categoryFilter', categoryList);
|
await loadAndDisplayOptions('#categoryFilter', categoryList);
|
||||||
|
|
|
@ -27,6 +27,17 @@
|
||||||
href="{{root}}/skin/home.css"
|
href="{{root}}/skin/home.css"
|
||||||
rel="Stylesheet"
|
rel="Stylesheet"
|
||||||
/>
|
/>
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: "poppins";
|
||||||
|
src: url("{{root}}/skin/fonts/Poppins.ttf") format("truetype");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "roboto";
|
||||||
|
src: url("{{root}}/skin/fonts/Roboto.ttf") format("truetype");
|
||||||
|
}
|
||||||
|
</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>
|
||||||
<script src="{{root}}/skin/langList.js"></script>
|
<script src="{{root}}/skin/langList.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue