Skip to content

Commit

Permalink
Center tiles in layout
Browse files Browse the repository at this point in the history
Now we use masonry layout to center book tiles.
The padding of kiwixHomeBody is decreased to decrease whitespace
  • Loading branch information
juuz0 committed Jun 29, 2022
1 parent 12e0fb6 commit 3dc88fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
10 changes: 9 additions & 1 deletion static/skin/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@ body {
}

.kiwixHomeBody {
padding: 20px 15vw;
padding: 20px 12vw;
min-height: calc(100vh - 170px);
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}

.tagFilterLabel {
Expand All @@ -157,6 +160,7 @@ body {

.book__list {
position: relative;
margin: 0 auto;
}

.book {
Expand Down Expand Up @@ -447,6 +451,10 @@ body {
.kiwixNav__filters {
grid-template-columns: repeat(4, 1fr);
}

.book__wrapper {
margin: 10px;
}
}

@media screen and (max-width: 590px) {
Expand Down
7 changes: 3 additions & 4 deletions static/skin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,9 @@
}
},
sortBy: 'weight',
layoutMode: 'cellsByRow',
cellsByRow: {
columnWidth: '.book',
rowHeight: '.book'
layoutMode: 'masonry',
masonry: {
fitWidth: true,
}
});
footer = document.getElementById('kiwixfooter');
Expand Down
4 changes: 2 additions & 2 deletions test/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ R"EXPECTEDRESULT( src="/ROOT/skin/jquery-ui/external/jquery/jquery.js?cache
src="/ROOT/skin/jquery-ui/jquery-ui.min.js?cacheid=d927c2ff"
href="/ROOT/skin/jquery-ui/jquery-ui.min.css?cacheid=e1de77b3"
href="/ROOT/skin/jquery-ui/jquery-ui.theme.min.css?cacheid=2a5841f9"
href="/ROOT/skin/index.css?cacheid=a1acc52f"
href="/ROOT/skin/index.css?cacheid=1206898d"
src: url("/ROOT/skin/fonts/Poppins.ttf?cacheid=af705837") format("truetype");
src: url("/ROOT/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype");
<script src="/ROOT/skin/isotope.pkgd.min.js?cacheid=2e48d392" defer></script>
<script src="/ROOT/skin/iso6391To3.js?cacheid=ecde2bb3"></script>
<script type="text/javascript" src="/ROOT/skin/index.js?cacheid=e99ed2dd" defer></script>
<script type="text/javascript" src="/ROOT/skin/index.js?cacheid=f7cede39" defer></script>
)EXPECTEDRESULT"
},
{
Expand Down

0 comments on commit 3dc88fc

Please sign in to comment.