Add responsive on Homepage elements
This commit is contained in:
@@ -57,7 +57,8 @@
|
|||||||
on:mouseleave={handleMouseLeave}
|
on:mouseleave={handleMouseLeave}
|
||||||
sveltekit-noscroll
|
sveltekit-noscroll
|
||||||
>
|
>
|
||||||
<Image id={country.flag.id} alt="Flag of {country.name}" width={32} height={32} />
|
<Image class="location__flag" id={country.flag.id} alt="Flag of {country.name}" width={32} height={32} />
|
||||||
|
<div class="text">
|
||||||
<dl>
|
<dl>
|
||||||
<dt class="location__name">
|
<dt class="location__name">
|
||||||
{name}
|
{name}
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
{#if isNew}
|
{#if isNew}
|
||||||
<Badge text="New" />
|
<Badge text="New" />
|
||||||
{/if}
|
{/if}
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="location__photos">
|
<div class="location__photos">
|
||||||
<span>{photoIndex}</span>
|
<span>{photoIndex}</span>
|
||||||
|
|||||||
@@ -34,11 +34,16 @@
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.text-medium {
|
.text-medium {
|
||||||
font-size: rem(28px);
|
font-size: rem(20px);
|
||||||
font-family: $font-sans;
|
font-family: $font-sans;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
|
line-height: 1.4;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
font-size: rem(28px);
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.text-small {
|
.text-small {
|
||||||
font-size: rem(22px);
|
font-size: rem(22px);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -47,7 +52,7 @@
|
|||||||
|
|
||||||
.text-label {
|
.text-label {
|
||||||
font-size: rem(12px);
|
font-size: rem(12px);
|
||||||
line-height: 1.5;
|
line-height: 1.4;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
min-height: 16px;
|
min-height: 16px;
|
||||||
margin-top: 20px;
|
|
||||||
|
|
||||||
// Small size
|
// Small size
|
||||||
&--small {
|
&--small {
|
||||||
|
|||||||
@@ -1,19 +1,31 @@
|
|||||||
.box-cta {
|
.box-cta {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 144px;
|
margin: 0 auto;
|
||||||
height: 176px;
|
width: 260px;
|
||||||
padding: 24px 16px;
|
height: 88px;
|
||||||
|
padding: 24px 32px 24px 48px;
|
||||||
background-color: $color-primary-tertiary20;
|
background-color: $color-primary-tertiary20;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
flex-direction: column;
|
||||||
|
width: 144px;
|
||||||
|
height: 176px;
|
||||||
|
padding: 24px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
margin: auto 0;
|
margin: auto 0;
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -25,5 +37,12 @@
|
|||||||
span {
|
span {
|
||||||
display: block;
|
display: block;
|
||||||
color: $color-secondary-light;
|
color: $color-secondary-light;
|
||||||
|
text-align: left;
|
||||||
|
margin-left: 24px;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
margin-left: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,27 @@
|
|||||||
.location {
|
.location {
|
||||||
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
text-decoration: none;
|
}
|
||||||
|
|
||||||
// Background circle
|
// Background circle
|
||||||
&:after {
|
&:after {
|
||||||
|
display: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@@ -25,6 +33,10 @@
|
|||||||
background-color: rgba($color-tertiary, 0.1);
|
background-color: rgba($color-tertiary, 0.1);
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
transition: transform 0.75s var(--ease-quart), opacity 0.75s var(--ease-quart);
|
transition: transform 0.75s var(--ease-quart), opacity 0.75s var(--ease-quart);
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hover
|
// Hover
|
||||||
@@ -40,22 +52,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flag
|
// Flag
|
||||||
|
&__flag {
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
margin-right: 24px;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Location name
|
// Location name
|
||||||
&__name {
|
&__name {
|
||||||
display: block;
|
display: block;
|
||||||
color: $color-secondary;
|
color: $color-secondary;
|
||||||
margin: 20px 0 8px;
|
margin: 0 0 4px;
|
||||||
font-size: rem(48px);
|
font-size: rem(32px);
|
||||||
font-family: $font-serif;
|
font-family: $font-serif;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
transition: color 0.75s var(--ease-quart);
|
transition: color 0.75s var(--ease-quart);
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
margin: 20px 0 8px;
|
||||||
|
font-size: rem(48px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
@@ -65,14 +89,19 @@
|
|||||||
|
|
||||||
// Badge
|
// Badge
|
||||||
.badge {
|
.badge {
|
||||||
|
display: inline-flex;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
bottom: -8px;
|
bottom: -8px;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Photos
|
// Photos
|
||||||
&__photos {
|
&__photos {
|
||||||
|
display: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
@@ -87,6 +116,10 @@
|
|||||||
box-shadow: 0 8px 8px rgba(#000, 0.1), 0 16px 28px rgba(#000, 0.12);
|
box-shadow: 0 8px 8px rgba(#000, 0.1), 0 16px 28px rgba(#000, 0.12);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
transition: opacity 0.5s var(--ease-quart);
|
transition: opacity 0.5s var(--ease-quart);
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
.browse {
|
.browse {
|
||||||
|
margin-top: 96px;
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
&__description {
|
&__description {
|
||||||
|
font-size: rem(20px);
|
||||||
|
margin: 0 auto 32px;
|
||||||
|
max-width: 230px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
font-size: rem(28px);
|
||||||
margin-bottom: 56px;
|
margin-bottom: 56px;
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continents
|
// Continents
|
||||||
@@ -17,15 +26,35 @@
|
|||||||
|
|
||||||
// Locations
|
// Locations
|
||||||
&__locations {
|
&__locations {
|
||||||
|
width: 70%;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 88px auto 80px;
|
||||||
|
padding: 0 32px;
|
||||||
|
|
||||||
|
@include bp (mob-lg) {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
justify-content: center;
|
||||||
|
grid-gap: 40px 24px;
|
||||||
|
width: 85%;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
@include bp (sm) {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row wrap;
|
flex-flow: row wrap;
|
||||||
justify-content: center;
|
width: 100%;
|
||||||
max-width: 1200px;
|
|
||||||
margin: 104px auto 80px;
|
margin: 104px auto 80px;
|
||||||
justify-items: center;
|
}
|
||||||
|
|
||||||
.location {
|
.location {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
|
||||||
|
@include bp (mob-lg) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
@include bp (sm) {
|
||||||
margin: 0 22px 56px;
|
margin: 0 22px 56px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -7,18 +7,27 @@
|
|||||||
color: $color-text;
|
color: $color-text;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-bottom: clamp(100px, 27vw, 600px);
|
padding-bottom: clamp(250px, 27vw, 600px);
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
h1 {
|
h1 {
|
||||||
color: $color-secondary;
|
color: $color-secondary;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
margin-top: -20px;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
margin-top: -100px;
|
margin-top: -100px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Text
|
// Text
|
||||||
p {
|
p {
|
||||||
|
max-width: 350px;
|
||||||
|
margin: 100px auto 32px;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
margin: 20px auto 32px;
|
||||||
max-width: 524px;
|
max-width: 524px;
|
||||||
margin: 0 auto 32px;
|
}
|
||||||
}
|
}
|
||||||
// Button
|
// Button
|
||||||
.button {
|
.button {
|
||||||
@@ -31,9 +40,13 @@
|
|||||||
&__photos {
|
&__photos {
|
||||||
position: relative;
|
position: relative;
|
||||||
max-width: 2000px;
|
max-width: 2000px;
|
||||||
height: clamp(500px, 45vw, 900px);
|
height: clamp(400px, 45vw, 900px);
|
||||||
|
margin: calc(-1 * clamp(200px, 20vw, 500px)) auto 0;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
margin: calc(-1 * clamp(300px, 20vw, 500px)) auto 0;
|
margin: calc(-1 * clamp(300px, 20vw, 500px)) auto 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
&__collage {
|
&__collage {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(32, 1fr);
|
grid-template-columns: repeat(32, 1fr);
|
||||||
@@ -137,10 +150,15 @@
|
|||||||
|
|
||||||
p {
|
p {
|
||||||
font-family: $font-sans;
|
font-family: $font-sans;
|
||||||
font-size: rem(32px);
|
font-size: rem(28px);
|
||||||
color: $color-tertiary;
|
color: $color-tertiary;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
padding: 0 20px;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
font-size: rem(32px);
|
||||||
|
}
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
@@ -149,13 +167,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cards {
|
.cards {
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-top: 48px;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
|
display: flex;
|
||||||
margin-top: 72px;
|
margin-top: 72px;
|
||||||
|
}
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
|
margin: 20px auto 0;
|
||||||
|
|
||||||
|
@include bp (sm) {
|
||||||
margin: 0 16px;
|
margin: 0 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user