Skip to content
Snippets Groups Projects
Commit a99d42d9 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

optimize tile layout for small screens

parent 92bfd84d
No related branches found
No related tags found
2 merge requests!2246Translated using Weblate (German),!2244Resolve "Rework Startpage"
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
let tile_width = parseFloat(window.getComputedStyle(document.querySelector("#tiles > a")).width.replace("px", "")); let tile_width = parseFloat(window.getComputedStyle(document.querySelector("#tiles > a")).width.replace("px", ""));
let tile_gap = parseFloat(window.getComputedStyle(document.querySelector("#tiles"))["column-gap"].replace("px", "")); let tile_gap = parseFloat(window.getComputedStyle(document.querySelector("#tiles"))["column-gap"].replace("px", ""));
let client_width = document.querySelector("html").clientWidth; let client_width = document.querySelector("html").clientWidth;
let client_height = document.querySelector("html").clientHeight;
let desired_tile_count = 8; let desired_tile_count = 8;
...@@ -72,7 +73,12 @@ ...@@ -72,7 +73,12 @@
console.log(client_width, tile_width, tile_gap, desired_tile_count); console.log(client_width, tile_width, tile_gap, desired_tile_count);
console.log("Six Tiles", tile_width * 6 + 5 * tile_gap); console.log("Six Tiles", tile_width * 6 + 5 * tile_gap);
if (native_tile_count + min_advertisements > desired_tile_count) { if (native_tile_count + min_advertisements > desired_tile_count) {
desired_tile_count *= 2; // Allow 2x3 Tiles on small displays
if (desired_tile_count == 2 && client_height > 850) {
desired_tile_count *= 3;
} else {
desired_tile_count *= 2;
}
} }
......
...@@ -32,7 +32,7 @@ div#tiles-container { ...@@ -32,7 +32,7 @@ div#tiles-container {
} }
@media(max-width: @four_row_width) { @media(max-width: @four_row_width) {
width: @two_row_width; width: 100%;
} }
display: flex; display: flex;
...@@ -46,6 +46,11 @@ div#tiles-container { ...@@ -46,6 +46,11 @@ div#tiles-container {
>a { >a {
width: @tile_width; width: @tile_width;
@media(max-width: @four_row_width) {
width: calc(50% - @tile_gap);
}
display: flex; display: flex;
row-gap: .5rem; row-gap: .5rem;
flex-direction: column; flex-direction: column;
...@@ -62,7 +67,7 @@ div#tiles-container { ...@@ -62,7 +67,7 @@ div#tiles-container {
width: @image_size; width: @image_size;
height: @image_size; height: @image_size;
padding: 0.5rem; padding: 0.5rem;
background-color: @highlight-color; background-color: fade(@highlight-color, 60%);
border-radius: 5px; border-radius: 5px;
transition: background-color 0.5s; transition: background-color 0.5s;
...@@ -79,7 +84,6 @@ div#tiles-container { ...@@ -79,7 +84,6 @@ div#tiles-container {
>div.title { >div.title {
font-size: .8rem; font-size: .8rem;
color: fade(@text-color, 60%); color: fade(@text-color, 60%);
transition: color 0.5s;
width: @tile_width; width: @tile_width;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
...@@ -87,6 +91,10 @@ div#tiles-container { ...@@ -87,6 +91,10 @@ div#tiles-container {
text-align: center; text-align: center;
line-height: 1; line-height: 1;
>div.main-title {
transition: color 0.5s;
}
>div.sub-title { >div.sub-title {
height: 1em; height: 1em;
} }
...@@ -94,7 +102,7 @@ div#tiles-container { ...@@ -94,7 +102,7 @@ div#tiles-container {
&:hover { &:hover {
>div.image { >div.image {
background-color: lighten(@highlight-color, 10%); background-color: @highlight-color;
} }
>div.title { >div.title {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment