Merge gallery and exhibitions pages into home page
This commit is contained in:
parent
e1654494b3
commit
b45fe42a45
13 changed files with 4945 additions and 224 deletions
|
@ -50,13 +50,6 @@ em {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
@media screen and (min-width: $desktop-media-query) {
|
||||
|
||||
.body--white-background {
|
||||
background-color: var(--white);
|
||||
}
|
||||
}
|
||||
|
||||
// Link style
|
||||
|
||||
a {
|
||||
|
@ -95,71 +88,11 @@ body {
|
|||
// HEADER
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Logo
|
||||
|
||||
.logo {
|
||||
width: 100%;
|
||||
padding: var(--logo-padding);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
&--fixed-center {
|
||||
z-index: 2;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
right: calc(50vw - (var(--logo-width) / 2));
|
||||
display: block;
|
||||
}
|
||||
|
||||
.logo__link {
|
||||
width: var(--logo-width);
|
||||
height: var(--logo-height);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.logo__icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
&--black {
|
||||
stroke: var(--black);
|
||||
transition: stroke 400ms ease-in-out;
|
||||
}
|
||||
|
||||
&--white {
|
||||
stroke: var(--white);
|
||||
transition: stroke 400ms ease-in-out;
|
||||
}
|
||||
|
||||
&--rotate-horizontal-bottom {
|
||||
animation: rotate-horizontal-bottom 800ms ease-in-out infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: $desktop-media-query) {
|
||||
|
||||
.logo {
|
||||
|
||||
&--fixed-right {
|
||||
z-index: 2;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
right: 1.5rem;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sidebar
|
||||
|
||||
.sidebar {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
padding: var(--sidebar-padding);
|
||||
display: flex;
|
||||
|
@ -167,7 +100,6 @@ body {
|
|||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
background-color: transparent;
|
||||
transition: background-color 400ms ease-in-out;
|
||||
|
||||
.sidebar__nav {
|
||||
max-width: 100%;
|
||||
|
@ -186,8 +118,15 @@ body {
|
|||
overflow-x: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
color: var(--black);
|
||||
transition: color 400ms ease-in-out;
|
||||
transition: color 200ms ease-in-out;
|
||||
|
||||
&--white {
|
||||
color: var(--white);
|
||||
|
||||
&:focus-visible {
|
||||
outline: 1px dashed var(--white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar__social {
|
||||
|
@ -208,14 +147,24 @@ body {
|
|||
+ .sidebar__social-link {
|
||||
margin: 0 0 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar__instagram-icon,
|
||||
.sidebar__email-icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
fill: var(--black);
|
||||
transition: fill 400ms ease-in-out;
|
||||
svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
fill: var(--black);
|
||||
transition: fill 200ms ease-in-out;
|
||||
}
|
||||
|
||||
&--white {
|
||||
|
||||
&:focus-visible {
|
||||
outline: 1px dashed var(--white);
|
||||
}
|
||||
|
||||
svg {
|
||||
fill: var(--white);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,9 +173,9 @@ body {
|
|||
.sidebar {
|
||||
|
||||
&--fixed {
|
||||
z-index: 1;
|
||||
overflow-y: auto;
|
||||
position: fixed;
|
||||
z-index: 3;
|
||||
overflow-y: auto;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
@ -240,30 +189,42 @@ body {
|
|||
color: var(--transparent-black);
|
||||
}
|
||||
|
||||
.sidebar__instagram-icon,
|
||||
.sidebar__email-icon {
|
||||
fill: var(--transparent-black);
|
||||
.sidebar__social-link {
|
||||
|
||||
svg {
|
||||
fill: var(--transparent-black);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--transparent-feldgrau);
|
||||
|
||||
|
||||
.sidebar__nav-link {
|
||||
color: var(--black);
|
||||
}
|
||||
|
||||
.sidebar__instagram-icon,
|
||||
.sidebar__email-icon {
|
||||
fill: var(--black);
|
||||
.sidebar__social-link {
|
||||
|
||||
svg {
|
||||
fill: var(--black);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&--white-background {
|
||||
.sidebar__nav-link {
|
||||
|
||||
&:hover {
|
||||
background-color: var(--transparent-white);
|
||||
&:focus-visible {
|
||||
color: var(--black);
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar__social-link {
|
||||
|
||||
&:focus-visible {
|
||||
|
||||
svg {
|
||||
fill: var(--black);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -280,15 +241,32 @@ body {
|
|||
|
||||
// Slider section
|
||||
|
||||
.splide {
|
||||
.slider-section {
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
right: 0;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transition:
|
||||
visibility 0ms 400ms,
|
||||
opacity 400ms ease-in-out;
|
||||
|
||||
&__image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
&--hidden {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition:
|
||||
visibility 0ms,
|
||||
opacity 400ms ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
.splide__image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
// Exhibition section
|
||||
|
||||
.exhibition-section {
|
||||
|
@ -298,19 +276,28 @@ body {
|
|||
@media screen and (min-width: $desktop-media-query) {
|
||||
|
||||
.exhibition-section {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: block;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.exhibition {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transition: opacity 400ms ease-in-out;
|
||||
transition:
|
||||
visibility 0ms,
|
||||
opacity 400ms ease-in-out;
|
||||
|
||||
&--visible {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transition:
|
||||
visibility 0ms 400ms,
|
||||
opacity 400ms ease-in-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,19 +10,3 @@
|
|||
outline-offset: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotate-horizontal-bottom {
|
||||
0% {
|
||||
transform: rotateX(0);
|
||||
transform-origin: bottom;
|
||||
}
|
||||
50% {
|
||||
transform: rotateX(180deg);
|
||||
transform-origin: bottom;
|
||||
}
|
||||
100% {
|
||||
transform: rotateX(0);
|
||||
transform-origin: bottom;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
|
||||
// Dimensions
|
||||
|
||||
--logo-width: 6rem;
|
||||
--logo-height: 3rem;
|
||||
--logo-padding: 1rem;
|
||||
--icon-size: 2.25rem;
|
||||
--sidebar-padding: 1rem;
|
||||
|
||||
|
@ -37,8 +34,6 @@
|
|||
--transparent-black: rgba(0, 0, 0, 0.3);
|
||||
--white: #fff;
|
||||
--transparent-white: rgba(255, 255, 255, 0.9);
|
||||
--feldgrau: #4B6259;
|
||||
--transparent-feldgrau: rgba(75, 98, 89, 0.9);
|
||||
}
|
||||
|
||||
// Media queries
|
||||
|
|
193
assets/js/app.js
193
assets/js/app.js
|
@ -1,4 +1,5 @@
|
|||
import Splide from '@splidejs/splide';
|
||||
import create from 'swipe-events';
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DATA
|
||||
|
@ -10,14 +11,16 @@ const body = document.body;
|
|||
|
||||
// SPLIDE SLIDER
|
||||
|
||||
const logo = document.querySelector('.logo__icon');
|
||||
let slider = document.querySelector('.splide');
|
||||
const slider = document.querySelector('.slider-section');
|
||||
let splideSlider;
|
||||
const slides = document.querySelectorAll('.splide__slide');
|
||||
|
||||
// EXHIBITION IFRAME
|
||||
|
||||
const sidebar = document.querySelector('.sidebar');
|
||||
const sidebarNavLinks = document.querySelectorAll('.sidebar__nav-link--iframe');
|
||||
const sidebarNavLinks = document.querySelectorAll('.sidebar__nav-link');
|
||||
const sidebarEmbeddedNavLinks = document.querySelectorAll('.sidebar__nav-link--iframe');
|
||||
const sidebarSocialLinks = document.querySelectorAll('.sidebar__social-link');
|
||||
const exhibitionIframe = document.querySelector('.exhibition');
|
||||
|
||||
// NAV LINKS TARGET
|
||||
|
@ -48,7 +51,7 @@ function convertRemToPixels(rem) {
|
|||
|
||||
function setUpSlider() {
|
||||
if (slider) {
|
||||
slider = new Splide('.splide', {
|
||||
splideSlider = new Splide('.splide', {
|
||||
type: 'fade',
|
||||
rewind: true,
|
||||
rewindByDrag: true,
|
||||
|
@ -58,86 +61,87 @@ function setUpSlider() {
|
|||
arrows: false,
|
||||
pagination: false,
|
||||
easing: 'ease-in-out',
|
||||
drag: true,
|
||||
wheel: true
|
||||
drag: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function mountSlider() {
|
||||
if (slider) {
|
||||
slider.mount();
|
||||
if (splideSlider) {
|
||||
splideSlider.mount();
|
||||
}
|
||||
}
|
||||
|
||||
function goToNextSlideOnClick() {
|
||||
if (slider) {
|
||||
slider.on('click', function(e) {
|
||||
slider.go('>');
|
||||
});
|
||||
if (sidebar && splideSlider) {
|
||||
sidebar.addEventListener('click', function(e) {
|
||||
if (!e.target.matches('a') && !e.target.parentElement.matches('a')) {
|
||||
splideSlider.go('>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function turnLogoToBlack() {
|
||||
if (logo) {
|
||||
logo.classList.remove('logo__icon--white');
|
||||
logo.classList.add('logo__icon--black');
|
||||
function changeSlideOnSwipe() {
|
||||
if (sidebar && splideSlider) {
|
||||
sidebar.addEventListener('swiped', function(e) {
|
||||
if (e.detail.dir === 'right') {
|
||||
splideSlider.go('>');
|
||||
} else if (e.detail.dir === 'left') {
|
||||
splideSlider.go('<');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function turnLogoToWhite() {
|
||||
if (logo) {
|
||||
logo.classList.remove('logo__icon--black');
|
||||
logo.classList.add('logo__icon--white');
|
||||
function turnSidebarLinksToWhite() {
|
||||
if (sidebarNavLinks) {
|
||||
for (let i = 0; i < sidebarNavLinks.length; i++) {
|
||||
sidebarNavLinks[i].classList.add('sidebar__nav-link--white');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editLogoColor(slide) {
|
||||
if (slide) {
|
||||
if (slide.getAttribute('data-logo-color') === 'white') {
|
||||
turnLogoToWhite();
|
||||
} else if (slide.getAttribute('data-logo-color') === 'black') {
|
||||
turnLogoToBlack();
|
||||
if (sidebarSocialLinks) {
|
||||
for (let i = 0; i < sidebarSocialLinks.length; i++) {
|
||||
sidebarSocialLinks[i].classList.add('sidebar__social-link--white');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editLogoColorOnSliderMounted() {
|
||||
if (slider && slides) {
|
||||
slider.on('mounted', function() {
|
||||
editLogoColor(slides[0]);
|
||||
function turnSidebarLinksToBlack() {
|
||||
if (sidebarNavLinks) {
|
||||
for (let i = 0; i < sidebarNavLinks.length; i++) {
|
||||
sidebarNavLinks[i].classList.remove('sidebar__nav-link--white');
|
||||
}
|
||||
}
|
||||
if (sidebarSocialLinks) {
|
||||
for (let i = 0; i < sidebarSocialLinks.length; i++) {
|
||||
sidebarSocialLinks[i].classList.remove('sidebar__social-link--white');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editNavLinksColor(slide) {
|
||||
if (slide) {
|
||||
if (slide.getAttribute('data-logo-color') === 'white') {
|
||||
turnSidebarLinksToWhite();
|
||||
} else if (slide.getAttribute('data-logo-color') === 'black') {
|
||||
turnSidebarLinksToBlack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editNavLinksColorOnSliderMounted() {
|
||||
if (splideSlider && slides) {
|
||||
splideSlider.on('mounted', function() {
|
||||
editNavLinksColor(slides[0]);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function editLogoColorOnSlideActive() {
|
||||
if (slider) {
|
||||
slider.on('active', function(e) {
|
||||
editLogoColor(e.slide);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function enableLogoRotation() {
|
||||
if (logo) {
|
||||
logo.classList.add('logo__icon--rotate-horizontal-bottom');
|
||||
}
|
||||
}
|
||||
|
||||
function disableLogoRotation() {
|
||||
if (logo) {
|
||||
logo.classList.remove('logo__icon--rotate-horizontal-bottom');
|
||||
}
|
||||
}
|
||||
|
||||
function rotateLogoOnSliderMove() {
|
||||
if (slider && logo) {
|
||||
slider.on('move', function(e) {
|
||||
logo.removeEventListener('animationiteration', disableLogoRotation);
|
||||
enableLogoRotation();
|
||||
});
|
||||
slider.on('moved', function(e) {
|
||||
logo.addEventListener('animationiteration', disableLogoRotation);
|
||||
function editNavLinksColorOnSlideActive() {
|
||||
if (splideSlider) {
|
||||
splideSlider.on('active', function(e) {
|
||||
editNavLinksColor(e.slide);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -150,43 +154,46 @@ function slimDownSidebar() {
|
|||
}
|
||||
}
|
||||
|
||||
function enableExhibitionIframeVisibility() {
|
||||
function enlargeSidebar() {
|
||||
if (sidebar) {
|
||||
sidebar.classList.remove('sidebar--slimmed');
|
||||
}
|
||||
}
|
||||
|
||||
function hideSlider() {
|
||||
if (slider) {
|
||||
slider.classList.add('slider-section--hidden');
|
||||
}
|
||||
}
|
||||
|
||||
function showSlider() {
|
||||
if (slider) {
|
||||
slider.classList.remove('slider-section--hidden');
|
||||
}
|
||||
}
|
||||
|
||||
function enableExhibitionIframe() {
|
||||
if (exhibitionIframe) {
|
||||
exhibitionIframe.classList.add('exhibition--visible');
|
||||
}
|
||||
}
|
||||
|
||||
function disableExhibitionIframeVisibility() {
|
||||
if (exhibitionIframe) {
|
||||
function disableExhibitionIframe() {
|
||||
if (exhibitionIframe && slider) {
|
||||
exhibitionIframe.classList.remove('exhibition--visible');
|
||||
}
|
||||
}
|
||||
|
||||
function editBackgroundColor(sidebarNavLink) {
|
||||
if (body && sidebar) {
|
||||
if (sidebarNavLink.getAttribute('data-background') === 'feldgrau') {
|
||||
body.classList.remove('body--white-background');
|
||||
sidebar.classList.remove('sidebar--white-background');
|
||||
} else if (sidebarNavLink.getAttribute('data-background') === 'white') {
|
||||
body.classList.add('body--white-background');
|
||||
sidebar.classList.add('sidebar--white-background');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadExhibitionIframe() {
|
||||
if (sidebarNavLinks.length > 0 && exhibitionIframe) {
|
||||
for (let i = 0; i < sidebarNavLinks.length; i++) {
|
||||
sidebarNavLinks[i].addEventListener('click', function(e) {
|
||||
if (sidebarEmbeddedNavLinks.length > 0 && exhibitionIframe) {
|
||||
for (let i = 0; i < sidebarEmbeddedNavLinks.length; i++) {
|
||||
sidebarEmbeddedNavLinks[i].addEventListener('click', function(e) {
|
||||
if (window.innerWidth >= convertRemToPixels(mediaQueries.remDesktopWidth)) {
|
||||
logo.removeEventListener('animationiteration', disableLogoRotation);
|
||||
enableLogoRotation();
|
||||
disableExhibitionIframeVisibility();
|
||||
exhibitionIframe.addEventListener('load', function(e) {
|
||||
logo.addEventListener('animationiteration', disableLogoRotation);
|
||||
turnSidebarLinksToBlack();
|
||||
slimDownSidebar();
|
||||
enableExhibitionIframeVisibility();
|
||||
editBackgroundColor(sidebarNavLinks[i]);
|
||||
hideSlider();
|
||||
enableExhibitionIframe();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -197,17 +204,17 @@ function loadExhibitionIframe() {
|
|||
// NAV LINKS TARGET
|
||||
|
||||
function setNavLinksIframeTarget() {
|
||||
if (sidebarNavLinks) {
|
||||
for (let i = 0; i < sidebarNavLinks.length; i++) {
|
||||
sidebarNavLinks[i].setAttribute('target', 'exhibition');
|
||||
if (sidebarEmbeddedNavLinks) {
|
||||
for (let i = 0; i < sidebarEmbeddedNavLinks.length; i++) {
|
||||
sidebarEmbeddedNavLinks[i].setAttribute('target', 'exhibition');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setNavLinksBlankTarget() {
|
||||
if (sidebarNavLinks) {
|
||||
for (let i = 0; i < sidebarNavLinks.length; i++) {
|
||||
sidebarNavLinks[i].setAttribute('target', '_blank');
|
||||
if (sidebarEmbeddedNavLinks) {
|
||||
for (let i = 0; i < sidebarEmbeddedNavLinks.length; i++) {
|
||||
sidebarEmbeddedNavLinks[i].setAttribute('target', '_blank');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,11 +244,11 @@ enableActivePseudoClass();
|
|||
// SPLIDE SLIDER
|
||||
|
||||
setUpSlider();
|
||||
editLogoColorOnSliderMounted();
|
||||
editNavLinksColorOnSliderMounted();
|
||||
mountSlider();
|
||||
goToNextSlideOnClick();
|
||||
editLogoColorOnSlideActive();
|
||||
rotateLogoOnSliderMove();
|
||||
changeSlideOnSwipe();
|
||||
editNavLinksColorOnSlideActive();
|
||||
|
||||
// EXHIBITION IFRAME
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue