Skip to content

Commit

Permalink
Homepage: discover button
Browse files Browse the repository at this point in the history
  • Loading branch information
falkodev committed Sep 19, 2024
1 parent 8444172 commit 9dbeeb0
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
39 changes: 38 additions & 1 deletion server/modules/@apostrophecms/home-page/ui/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
height: 560px;
width: 100%;
overflow: hidden;
display: flex;

@media (min-width: map-get($breakpoints, 'sm')) {
height: 532px;
}
@media (min-width: map-get($breakpoints, 'md')) {
height: 1873px;
overflow: unset;
}

.pdl-home__cover {
Expand Down Expand Up @@ -178,6 +180,41 @@
}
}

.pdl-home__discover {
background: black;
color: white;
padding: 15px 12px;
font-size: 18px;
border-radius: 4px;
position: sticky;
top: calc(100% - 80px);
margin-bottom: 30px;
margin-left: auto;
margin-right: auto;
align-self: baseline;
display: flex;
gap: 8px;
align-items: center;

@media (min-width: map-get($breakpoints, 'md')) {
top: calc(100% - 90px);
}

&:not(:hover) {
color: white;
svg path {
animation: notHoverArrow 300ms ease;
}
}

&:hover {
color: white;
svg path {
animation: hoverArrow 300ms ease;
}
}
}

.pdl-home__about {
background: black;
color: white;
Expand All @@ -186,7 +223,7 @@
z-index: 3;

font-size: 39px;
padding-top: 20px;
padding-top: 60px;
padding-bottom: 22px;

@media (min-width: map-get($breakpoints, 'sm')) {
Expand Down
6 changes: 5 additions & 1 deletion server/modules/@apostrophecms/home-page/views/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ <h1 class="pdl-home__headline">
{% render fragment.preview(book, { light: true }) %}
</div>
{% endfor %}
<a class="pdl-home__discover" href="#home-about">
{% include "svg-arrow-down.html" %}
{{ __t('pdl:Discover') }}
</a>
</div>
<div class="pdl-home__about" id="home-about">
<div class="pdl-home__about-text">
Expand All @@ -22,7 +26,7 @@ <h1 class="pdl-home__headline">
</div>
<a class="pdl-home__about-link" href="/{{ data.locale }}/about">
{{ __t('pdl:About Public Domain Library') }}
{% include "svg-arrow.html" %}
{% include "svg-arrow-right.html" %}
</a>
</div>
<div class="pdl-home__" style="background: white; height: 500px; width: 100%;"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<svg width="12" height="13" viewBox="0 0 12 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.06004 9.04965V0.5H6.93996V9.04965L10.7424 5.5512L12 6.97967L6 12.5L0 6.97967L1.2576 5.5512L5.06004 9.04965Z" fill="white"/>
</svg>
3 changes: 2 additions & 1 deletion server/modules/asset/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"Start reading now": "Start reading now",
"Credits": "Credits",
"Font Color": "Font Color",
"About Public Domain Library": "About Public Domain Library"
"About Public Domain Library": "About Public Domain Library",
"Discover": "Discover"
}
4 changes: 4 additions & 0 deletions server/modules/asset/ui/src/scss/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@import './_settings';

html {
scroll-behavior: smooth;
}

body, html {
scrollbar-width: none;

Expand Down
26 changes: 24 additions & 2 deletions server/modules/book-page/ui/src/preview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@

@keyframes hoverArrow {
0% {
transform: translateY(0)
transform: translateY(0);
}

50% {
transform: translateY(40px)
transform: translateY(40px);
}

51% {
Expand All @@ -257,6 +257,28 @@
}
}

@keyframes notHoverArrow {
0% {
transform: translateY(0);
}

50% {
transform: translateY(-25px);
}

51% {
visibility: hidden;
}

52% {
transform: translateY(40px);
}

100% {
transform: translateY(0);
}
}

.pdl-book-preview__other {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 9dbeeb0

Please sign in to comment.