Fix some responsive and style
All checks were successful
continuous-integration/drone/push Build is passing

- Fullscreen: center image + add a background color
- Carousel: don't cut informations
- Title location font size
- Style location line height
- Photo reveal effect
- Photo has now a transparent png
This commit is contained in:
2020-04-04 19:10:40 +02:00
parent 7601fe8b44
commit bdc305a77a
12 changed files with 43 additions and 28 deletions

View File

@@ -24,26 +24,33 @@ export const animateIn = scope => {
} }
}) })
// Photo (reveal on scroll) // Photo (reveal on scroll)
imagesLoaded(scope.querySelector('.photo__image'), instance => { const photoImage = scope.querySelector('.photo__image')
const image = instance.elements[0] const photoAnim = anime.timeline({
easing: 'easeOutQuart',
duration: 2000,
autoplay: false
})
photoAnim.add({
targets: scope.querySelector('.photo__picture'),
opacity: [0, 1]
}, 50)
photoAnim.add({
targets: scope.querySelector('.photo__picture img'),
scale: [1.12, 1]
}, 50)
// Show photo when image is loaded
imagesLoaded(photoImage, instance => {
const photoReveal = ScrollOut({ const photoReveal = ScrollOut({
once: true, once: true,
targets: image, targets: photoImage,
onShown (el) { onShown: el => photoAnim.restart()
// Load the photo then reveal it
anime({
targets: el.querySelector('img'),
scale: [1.12, 1],
opacity: [0, 1],
easing: 'easeOutQuart',
duration: 2000,
delay: 50
})
}
}) })
}) })
// Number parallax on scroll // Number parallax on scroll
const nbParallaxMedia = window.matchMedia('(min-width: 768px)') const nbParallaxMedia = window.matchMedia('(min-width: 768px)')
const nbParallax = matchMedia => { const nbParallax = matchMedia => {

View File

@@ -53,7 +53,7 @@
<source media="(min-width: 500px)" data-srcset={getThumbnail(private_hash, 650)}> <source media="(min-width: 500px)" data-srcset={getThumbnail(private_hash, 650)}>
<source media="(min-width: 300px)" data-srcset={getThumbnail(private_hash, 400)}> <source media="(min-width: 300px)" data-srcset={getThumbnail(private_hash, 400)}>
{#if layout === 'list'} {#if layout === 'list'}
<img src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" <img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
alt={imgAlt} alt={imgAlt}
width={defaultWidth} height={defaultHeight} width={defaultWidth} height={defaultHeight}
class="lazyload"> class="lazyload">

View File

@@ -148,7 +148,7 @@
on:click={openFullscreen} on:click={openFullscreen}
> >
<picture class="gallery__picture"> <picture class="gallery__picture">
<source media="(min-width: 968px)" srcset={getThumbnail(image.private_hash, 1400)}> <source media="(min-width: 968px)" srcset={getThumbnail(image.private_hash, 1200)}>
<source media="(min-width: 800px)" srcset={getThumbnail(image.private_hash, 900)}> <source media="(min-width: 800px)" srcset={getThumbnail(image.private_hash, 900)}>
<source media="(min-width: 500px)" srcset={getThumbnail(image.private_hash, 600)}> <source media="(min-width: 500px)" srcset={getThumbnail(image.private_hash, 600)}>
<source media="(min-width: 300px)" srcset={getThumbnail(image.private_hash, 400)}> <source media="(min-width: 300px)" srcset={getThumbnail(image.private_hash, 400)}>

View File

@@ -1,6 +1,4 @@
<script context="module"> <script context="module">
import { apiEndpoints } from 'utils/store'
export async function preload (page, session) { export async function preload (page, session) {
const req = await this.fetch(apiEndpoints.gql, { const req = await this.fetch(apiEndpoints.gql, {
method: 'post', method: 'post',
@@ -68,6 +66,7 @@
import { fade } from 'svelte/transition' import { fade } from 'svelte/transition'
import { stores } from '@sapper/app' import { stores } from '@sapper/app'
import { import {
apiEndpoints,
site, site,
continents, continents,
countries, countries,

View File

@@ -2,6 +2,7 @@ html {
font: #{$base-font-size} $font-sans; font: #{$base-font-size} $font-sans;
color: $color-text; color: $color-text;
min-width: 320px; min-width: 320px;
overflow-x: hidden;
} }
body { body {
@include font-smooth; @include font-smooth;
@@ -80,7 +81,7 @@ button {
// Title: Locations // Title: Locations
.title-location { .title-location {
font-family: $font-serif; font-family: $font-serif;
font-size: rem(68px); font-size: rem(48px);
line-height: 1; line-height: 1;
color: $color-secondary; color: $color-secondary;
text-align: center; text-align: center;
@@ -165,7 +166,7 @@ button {
font-family: $font-serif; font-family: $font-serif;
font-size: rem(24px); font-size: rem(24px);
color: #fff; color: #fff;
line-height: 1; line-height: 1.15;
text-align: center; text-align: center;
a { a {

View File

@@ -1,6 +1,5 @@
// Main page // Main page
.housesof { .housesof {
overflow: hidden;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;

View File

@@ -36,7 +36,7 @@
font-size: rem(32px); font-size: rem(32px);
color: $color-secondary; color: $color-secondary;
@include breakpoint (sm) { @include breakpoint (md) {
font-size: rem(48px); font-size: rem(48px);
} }
} }
@@ -44,7 +44,7 @@
height: 40px; height: 40px;
margin: 24px 0 16px; margin: 24px 0 16px;
@include breakpoint (sm) { @include breakpoint (md) {
height: 64px; height: 64px;
margin-bottom: 24px; margin-bottom: 24px;
} }

View File

@@ -210,13 +210,12 @@
*/ */
&__infos { &__infos {
position: relative; position: relative;
z-index: 3; z-index: 2;
} }
// Locations // Locations
&__locations { &__locations {
position: relative; position: relative;
overflow: hidden;
min-height: 80px; min-height: 80px;
@include breakpoint (sm) { @include breakpoint (sm) {
@@ -236,6 +235,7 @@
transition: transform 0.9s $ease-quart, opacity 0.9s $ease-quart; transition: transform 0.9s $ease-quart, opacity 0.9s $ease-quart;
will-change: transform, opacity; will-change: transform, opacity;
margin-top: 32px; margin-top: 32px;
padding-bottom: 4px;
@include breakpoint (sm) { @include breakpoint (sm) {
margin-top: pxVW(80); margin-top: pxVW(80);
@@ -268,6 +268,8 @@
*/ */
&__dots { &__dots {
display: none; display: none;
position: relative;
z-index: 3;
@include breakpoint (xs) { @include breakpoint (xs) {
display: flex; display: flex;

View File

@@ -15,6 +15,7 @@
overflow-x: auto; overflow-x: auto;
opacity: 0; opacity: 0;
transform: scale(1.1); transform: scale(1.1);
background: $color-primary;
transition: transform 0.8s $ease-quart, opacity 0.8s $ease-quart; transition: transform 0.8s $ease-quart, opacity 0.8s $ease-quart;
will-change: transform, opacity; will-change: transform, opacity;
@@ -24,6 +25,7 @@
display: block; display: block;
height: 100%; height: 100%;
width: auto; width: auto;
margin: 0 auto;
} }
// Open // Open

View File

@@ -39,20 +39,24 @@
// Locations // Locations
&__locations { &__locations {
min-height: 200px; min-height: 120px;
margin-top: 72px; margin-top: 72px;
@include breakpoint (sm) { @include breakpoint (sm) {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
margin-bottom: pxVW(232); min-height: 200px;
margin-top: 112px; margin-top: 112px;
margin-bottom: pxVW(120);
// display: grid; // display: grid;
// grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); // grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
// grid-column-gap: 120px; // grid-column-gap: 120px;
// grid-row-gap: pxVW(120); // grid-row-gap: pxVW(120);
} }
@include breakpoint (md) {
margin-bottom: pxVW(232);
}
@include breakpoint (xl) { @include breakpoint (xl) {
margin-bottom: 232px; margin-bottom: 232px;
} }

View File

@@ -45,7 +45,7 @@
position: sticky; position: sticky;
z-index: 10; z-index: 10;
top: 32px; top: 32px;
height: 100%; width: 100%;
} }
} }

View File

@@ -1,6 +1,7 @@
// Introduction // Introduction
.intro { .intro {
background-color: $color-tertiary; background-color: $color-tertiary;
overflow: hidden;
// Title // Title
.title-parallax { .title-parallax {