Skip to content

Commit

Permalink
Move download button to end of tile
Browse files Browse the repository at this point in the history
Changed the position of download button to the end of tile.
Added a proper download icon with the text.
When the button is hovered it changes colour to royal blue.
  • Loading branch information
juuz0 committed May 14, 2024
1 parent 0160722 commit 83f4ec8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 21 deletions.
1 change: 1 addition & 0 deletions static/resources_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ skin/magnet.png
skin/feed.svg
skin/langSelector.svg
skin/download.png
skin/download-white.svg
skin/hash.png
skin/search-icon.svg
skin/iso6391To3.js
Expand Down
7 changes: 7 additions & 0 deletions static/skin/download-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 34 additions & 20 deletions static/skin/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,21 @@

.book__link {
text-decoration: none;
grid-column: 1 / 3;
grid-row: 1 / 3;
}

.book__wrapper {
color: #444343;
height: 248px;
height: 258px;
width: 250px;
margin: 15px;
background-color: #f7f7f7;
border: 1px solid #ececec;
border-radius: 3px;
display: grid;
grid-template-columns: 65px 1fr;
grid-template-rows: 70px 120px 1fr 1fr;
grid-gap: 5px;
display: flex;
flex-direction: column;
justify-content: space-between;
transition: transform 0.25s;
gap: 4px;
}

.book__wrapper:hover {
Expand All @@ -177,8 +175,12 @@

.book__link__wrapper {
display: grid;
grid-template-areas:
"bookIcon bookHeader"
"bookDesc bookDesc"
;
grid-template-columns: 65px 1fr;
grid-template-rows: 70px 120px 1fr 1fr;
grid-template-rows: 70px 120px;
}

.book__icon {
Expand All @@ -190,6 +192,7 @@
align-content: center;
justify-content: center;
margin: 10px 0 0 10px;
grid-area: bookIcon;
}

.book__header {
Expand All @@ -201,6 +204,7 @@
height: 100%;
align-items: center;
align-content: center;
grid-area: bookHeader;
}

.book__title {
Expand All @@ -211,28 +215,34 @@
}

.book__download {
font-size: 1.1rem;
margin: 3px 0;
font-size: 1.2rem;
background: #00b4e4;
padding: 8px;
border-radius: 0 0 2px 2px;
display: flex;
align-items: center;
justify-content: center;
outline: 1px solid #ececec;
}

.book__download > img {
height: 16px;
width: 16px;
}

.book__download > span {
cursor: pointer;
text-decoration: none;
position: relative;
padding: 0 3px 1px;
font-family: roboto;
background: #00b4e4;
color: white;
box-shadow: 0 0 0 0;
border-radius: 2px;
}

.book__download > span:hover {
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1)
.book__download:hover {
background: royalblue;
}

.book__description {
grid-column: 1 / 3;
margin: 10px 10px 5px;
overflow: hidden;
display: -webkit-box;
Expand All @@ -243,6 +253,13 @@
font-size: 1.2rem;
color: #4d4d4d;
line-height: 1.25;
grid-area: bookDesc;
}

.book__meta {
display: flex;
justify-content: space-between;
padding: 0 10px 4px;
}

.book__languageTag {
Expand All @@ -255,7 +272,6 @@
color: black;
height: 25px;
width: 25px;
margin: 10px auto 0 10px;
border-radius: 5px;
font-size: 0.85rem;
}
Expand All @@ -266,8 +282,6 @@
font-size: 1.1rem;
justify-content: flex-end;
font-family: roboto;
margin-right: 10px;
margin-top: 10px;
overflow: hidden;
}

Expand Down
4 changes: 3 additions & 1 deletion static/skin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@
<div class="book__icon" ${faviconAttr}></div>
<div class="book__header">
<div id="book__title">${title}</div>
${downloadLink ? `<div class="book__download"><span data-link="${downloadLink}">${$t("download")} ${humanFriendlyZimSize ? ` - ${humanFriendlyZimSize}</span></div>`: ''}` : ''}
</div>
<div class="book__description" title="${description}">${description}</div>
</div>
</a>
<div class="book__meta">
<div class="book__languageTag" ${languageAttr}>${getLanguageCodeToDisplay(langCode)}</div>
<div class="book__tags"><div class="book__tags--wrapper">${tagHtml}</div></div>
</div>
${downloadLink ? `<div class="book__download"><img src="${root}/skin/download-white.svg"><span data-link="${downloadLink}">${$t("download")} ${humanFriendlyZimSize ? ` - ${humanFriendlyZimSize}</span></div>`: ''}` : ''}
</div></div>`;
return divTag;
}
Expand Down

0 comments on commit 83f4ec8

Please sign in to comment.