diff --git a/source/index.html b/source/index.html index 1a35eee..5c40b4c 100644 --- a/source/index.html +++ b/source/index.html @@ -16,7 +16,7 @@ - Меню + Меню @@ -39,21 +39,21 @@ - + - + - + @@ -62,7 +62,7 @@ - + @@ -168,12 +168,12 @@ История - + - + diff --git a/source/js/modules/ChangeThemeColor.js b/source/js/modules/ChangeThemeColor.js new file mode 100644 index 0000000..1542a87 --- /dev/null +++ b/source/js/modules/ChangeThemeColor.js @@ -0,0 +1,21 @@ +const sliderControls = document.querySelectorAll(`.js-control`); +const pageHeaderMenu = document.querySelector(`.js-menu`); +const socialBlockToggler = document.querySelector(`.js-social-block-toggler`); +const socialLink = document.querySelectorAll(`.js-social-link`); + +const themes = [`purple`, `blue`, `grey`]; + +export const themeColorElements = [...sliderControls, pageHeaderMenu, socialBlockToggler, ...socialLink]; + +export const setThemeColor = function (theme) { + for (const element of themeColorElements) { + resetThemeColor(element); + element.classList.add(theme); + } +}; + +export const resetThemeColor = function (element) { + for (let color of themes) { + element.classList.remove(color); + } +}; diff --git a/source/js/modules/full-page-scroll.js b/source/js/modules/full-page-scroll.js index eadfc80..02d6fc1 100644 --- a/source/js/modules/full-page-scroll.js +++ b/source/js/modules/full-page-scroll.js @@ -1,5 +1,6 @@ import throttle from 'lodash/throttle'; import {SCREEN_BLOCKER_TIMEOUT} from "./animations"; +import {elements, resetThemeColor, setThemeColor, themeColorElements} from "./ChangeThemeColor"; export default class FullPageScroll { constructor() { @@ -50,6 +51,13 @@ export default class FullPageScroll { changePageDisplay() { const activeScreen = this.screenElements[this.activeScreen]; this.scrollBlockerTimeout = activeScreen.classList.contains(`screen--prizes`) ? SCREEN_BLOCKER_TIMEOUT : 0; + if (activeScreen.classList.contains(`screen--story`)) { + setThemeColor(`purple`); + } else { + for (const element of themeColorElements) { + resetThemeColor(element); + } + } this.showScreenBlocker(); setTimeout(() => { this.changeVisibilityDisplay(); diff --git a/source/js/modules/menu.js b/source/js/modules/menu.js index c691987..0ac5388 100644 --- a/source/js/modules/menu.js +++ b/source/js/modules/menu.js @@ -1,6 +1,6 @@ export default () => { let header = document.querySelector(`.js-header`); - let menuToggler = document.querySelector(`.js-menu-toggler`); + let menuToggler = document.querySelector(`.js-social-block-toggle`); let menuLinks = document.querySelectorAll(`.js-menu-link`); if (menuToggler) { diff --git a/source/js/modules/slider.js b/source/js/modules/slider.js index 450adfc..d4770ad 100644 --- a/source/js/modules/slider.js +++ b/source/js/modules/slider.js @@ -1,4 +1,5 @@ import Swiper from "swiper"; +import {setThemeColor} from "./ChangeThemeColor"; export default () => { let storySlider; @@ -19,12 +20,16 @@ export default () => { slideChange: () => { if (storySlider.activeIndex === 0 || storySlider.activeIndex === 1) { sliderContainer.style.backgroundImage = `url("img/slide1.jpg"), linear-gradient(180deg, rgba(83, 65, 118, 0) 0%, #523E75 16.85%)`; + setThemeColor(`purple`); } else if (storySlider.activeIndex === 2 || storySlider.activeIndex === 3) { sliderContainer.style.backgroundImage = `url("img/slide2.jpg"), linear-gradient(180deg, rgba(45, 54, 179, 0) 0%, #2A34B0 16.85%)`; + setThemeColor(`blue`); } else if (storySlider.activeIndex === 4 || storySlider.activeIndex === 5) { sliderContainer.style.backgroundImage = `url("img/slide3.jpg"), linear-gradient(180deg, rgba(92, 138, 198, 0) 0%, #5183C4 16.85%)`; + setThemeColor(`grey`); } else if (storySlider.activeIndex === 6 || storySlider.activeIndex === 7) { sliderContainer.style.backgroundImage = `url("img/slide4.jpg"), linear-gradient(180deg, rgba(45, 39, 63, 0) 0%, #2F2A42 16.85%)`; + setThemeColor(`purple`); } }, resize: () => { @@ -53,12 +58,16 @@ export default () => { slideChange: () => { if (storySlider.activeIndex === 0) { sliderContainer.style.backgroundImage = `url("img/slide1.jpg")`; + setThemeColor(`purple`); } else if (storySlider.activeIndex === 2) { sliderContainer.style.backgroundImage = `url("img/slide2.jpg")`; + setThemeColor(`blue`); } else if (storySlider.activeIndex === 4) { sliderContainer.style.backgroundImage = `url("img/slide3.jpg")`; + setThemeColor(`grey`); } else if (storySlider.activeIndex === 6) { sliderContainer.style.backgroundImage = `url("img/slide4.jpg")`; + setThemeColor(`purple`); } }, resize: () => { diff --git a/source/scss/blocks/form.scss b/source/scss/blocks/form.scss index 74d0824..cad2541 100644 --- a/source/scss/blocks/form.scss +++ b/source/scss/blocks/form.scss @@ -113,6 +113,7 @@ margin-right: 1rem; padding: 0 2.5rem; width: calc(100% - 5rem); + right: 5rem; height: 4rem; font-size: 1.6rem; } @@ -186,27 +187,13 @@ } .form--result { + .form__button { opacity: 0; } .form__field { width: 0; - @media (min-width: $stop-scaling) { - width: 0; - } - - @media (orientation: portrait) { - width: 0; - } - - @media (max-width: $tablet) and (orientation: landscape) { - width: 0; - } - - @media (max-width: $mobile) and (orientation: landscape) { - width: 0; - } } } @@ -214,13 +201,37 @@ .form__field { padding: 0 5.6rem; width: calc(100% - 21rem); + + @media (orientation: portrait) { + width: calc(100% - 5rem); + } } } .screen--result.screen--show { .form__field{ - animation: result-input 0.5s linear forwards; - animation-delay: 1s; + padding: 0 5.6rem; + opacity: 1; + width: calc(100% - 31rem); + + @media (min-width: $stop-scaling) { + width: calc(100% - 310px); + } + + @media (orientation: portrait) { + padding: 0 2.5rem; + width: calc(100% - 5rem); + } + + @media (max-width: $tablet) and (orientation: landscape) { + padding: 0 2.5rem; + width: calc(100% - 9rem); + } + + @media (max-width: $mobile) and (orientation: landscape) { + padding: 0 2.5rem; + width: calc(100% - 5rem); + } } .form__button { animation: form-btn-color 0.75s, form-btn-fade 0.5s; diff --git a/source/scss/blocks/intro.scss b/source/scss/blocks/intro.scss index 047892a..0743dc8 100644 --- a/source/scss/blocks/intro.scss +++ b/source/scss/blocks/intro.scss @@ -32,6 +32,11 @@ font-size: 12rem; line-height: 1.2em; letter-spacing: -0.04em; + transform: translateY(50%); + + .text__word { + margin: -50px 5px 0; + } @media (min-width: $stop-scaling) { max-width: 990px; @@ -40,7 +45,7 @@ @media (max-width: $tablet) and (orientation: portrait) { max-width: 100%; - font-size: 3.6rem; + font-size: 3.5rem; } @media (max-width: $tablet) and (orientation: landscape) { @@ -157,7 +162,7 @@ font-family: $font-alt; font-weight: 400; font-size: 4.8rem; - line-height: 0.906; + line-height: 1em; letter-spacing: -0.04em; @media (min-width: $stop-scaling) { diff --git a/source/scss/blocks/page-header.scss b/source/scss/blocks/page-header.scss index cd1842a..af4fd05 100644 --- a/source/scss/blocks/page-header.scss +++ b/source/scss/blocks/page-header.scss @@ -150,6 +150,7 @@ padding: 4rem 3.5rem; color: $c-dark; background-color: $c-light; + transition: transform 0.3s ease-out; .page-header--menu-opened & { transform: translateX(0); @@ -185,6 +186,51 @@ line-height: 1.0418; color: $c-light; + &.purple { + a { + &:hover, + &:focus { + color: $c-dark !important; + outline: none; + + &::after { + opacity: 1; + background-color: $c-dark !important; + } + } + } + } + + &.blue { + a { + &:hover, + &:focus { + color: $c-blue !important; + outline: none; + + &::after { + opacity: 1; + background-color: $c-blue !important; + } + } + } + } + + &.grey { + a { + &:hover, + &:focus { + color: $c-grey-accent !important; + outline: none; + + &::after { + opacity: 1; + background-color: $c-grey-accent !important; + } + } + } + } + @media (min-width: $stop-scaling) { font-size: 12px; } diff --git a/source/scss/blocks/result.scss b/source/scss/blocks/result.scss index b1adec9..ce50a82 100644 --- a/source/scss/blocks/result.scss +++ b/source/scss/blocks/result.scss @@ -128,6 +128,21 @@ } } +@keyframes result-btn-fade-out { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes result-btn-scroll { + 100% { + transform: translateX(0) rotate(0); + } +} + .result { flex-grow: 1; display: flex; @@ -150,6 +165,17 @@ @media (max-width: $mobile) and (orientation: landscape) { padding: 3rem 0; } + + &--negative { + .result__button { + opacity: 0; + transition: opacity 0.3s ease; + + span { + transform: translateX(8rem) rotate(90deg); + } + } + } } .result__image { @@ -438,3 +464,15 @@ img.result__prize-image { animation-delay: 0.47s; } } + +.screen--result.screen--show { + .result--negative { + .result__button { + animation: result-btn-fade-out 0.5s forwards; + + span { + animation: result-btn-scroll 0.5s forwards; + } + } + } +} diff --git a/source/scss/blocks/rules.scss b/source/scss/blocks/rules.scss index b1d7b2e..b0c87c5 100644 --- a/source/scss/blocks/rules.scss +++ b/source/scss/blocks/rules.scss @@ -48,6 +48,19 @@ } } +@keyframes rules-btn-mobile { + 25% { + opacity: 1; + color: transparent; + } + + 100% { + color: rgba(#5f458c, 1); + opacity: 1; + width: 100%; + } +} + .rules { position: relative; flex-grow: 1; @@ -256,19 +269,29 @@ } .rules__link { + display: flex; + justify-content: center; + align-items: center; position: absolute; bottom: 6rem; right: 5.6rem; width: 71px; height: 71px; - line-height: 1.5em; + line-height: 71px; color: rgba(#5f458c, 0); + padding: 0 2.9rem; opacity: 0; animation: rules-btn 750ms; animation-fill-mode: forwards; animation-delay: 1s; + @media (max-width: $tablet) and (orientation: portrait) { + animation: rules-btn-mobile 750ms; + animation-fill-mode: forwards; + animation-delay: 1s; + } + &:before { transition: transform 0.2s linear; } diff --git a/source/scss/blocks/screen.scss b/source/scss/blocks/screen.scss index b72674d..7b6548c 100644 --- a/source/scss/blocks/screen.scss +++ b/source/scss/blocks/screen.scss @@ -68,16 +68,25 @@ color: $c-dark; background-color: $c-light; z-index: 1; - transition: bottom 0.5s cubic-bezier(0.17,1,0.8,0.98); + transition: bottom 0.5s cubic-bezier(0.17,1,0.8,0.98), width 0.3s linear, height 0.3s linear; @media (max-width: $tablet) and (orientation: portrait) { width: 3.5rem; height: 3.5rem; border-radius: 0 3.6rem 0 0; + .screen__footer-announce { + opacity: 0; + transition: opacity 0.3s linear; + transition-delay: 0.3s; + } &.screen__footer--full { width: 100%; height: 18rem; + + .screen__footer-announce { + opacity: 1; + } } } @@ -86,9 +95,19 @@ height: 3.5rem; border-radius: 0 3.6rem 0 0; + .screen__footer-announce, .screen__footer-note { + opacity: 0; + transition: opacity 0.3s linear; + transition-delay: 0.4s; + } + &.screen__footer--full { width: 100%; height: 16rem; + + .screen__footer-announce, .screen__footer-note { + opacity: 1; + } } } } @@ -376,4 +395,19 @@ .screen--rules { background-color: $c-dark; + + &.active { + .disclaimer { + li { + opacity: 1; + } + } + } + + .disclaimer { + li { + opacity: 0; + transition: opacity 1s ease; + } + } } diff --git a/source/scss/blocks/slider.scss b/source/scss/blocks/slider.scss index f1001ce..5260ebf 100644 --- a/source/scss/blocks/slider.scss +++ b/source/scss/blocks/slider.scss @@ -1,3 +1,13 @@ +@keyframes slider-control { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + transform: translateX(0) rotate(0); + } +} + .slider { position: relative; flex-grow: 1; @@ -160,12 +170,99 @@ width: 4rem; height: 4rem; color: $c-dark; + opacity: 0; + + &--prev { + transform: translateX(-8rem) rotate(-90deg); + } + + &--next { + transform: translateX(8rem) rotate(90deg); + } @media (min-width: $stop-scaling) { width: 40px; height: 40px; } + &.purple { + color: $c-light-purple; + + &:hover { + color: $c-dark; + } + + &:focus { + color: $c-dark; + + &::before { + border-color: $c-dark; + } + } + + &:active, + &:active:focus { + color: $c-light; + + &::before { + background-color: $c-dark; + border-color: $c-dark; + } + } + } + + &.blue { + color: $c-blue-accent; + + &:hover { + color: $c-blue; + } + + &:focus { + color: $c-blue; + + &::before { + border-color: $c-blue; + } + } + + &:active, + &:active:focus { + color: $c-light; + + &::before { + background-color: $c-blue; + border-color: $c-blue; + } + } + } + + &.grey { + color: $c-grey; + + &:hover { + color: $c-grey-accent; + } + + &:focus { + color: $c-grey-accent; + + &::before { + border-color: $c-grey-accent; + } + } + + &:active, + &:active:focus { + color: $c-light; + + &::before { + background-color: $c-grey-accent; + border-color: $c-grey-accent; + } + } + } + &::before { @include center; content: ""; @@ -175,6 +272,7 @@ border: 2px solid $c-light; border-radius: 50%; z-index: -1; + transition: all 0.3s ease; } svg { @@ -219,11 +317,6 @@ border-color: $c-purple; } } - - &.swiper-button-disabled { - opacity: 0.5; - pointer-events: none; - } } .slider__pagination.swiper-pagination { @@ -238,6 +331,8 @@ font-weight: 400; font-size: 2.4rem; line-height: 4rem; + opacity: 0; + transition: opacity 0.3s ease-out; @media (min-width: $stop-scaling) { bottom: 28px; @@ -294,3 +389,12 @@ transition: none; } } + +.screen--story.active { + .slider__control { + animation: slider-control 0.3s ease-out forwards; + } + .slider__pagination { + opacity: 1; + } +} diff --git a/source/scss/blocks/social-block.scss b/source/scss/blocks/social-block.scss index bd41b03..09683ce 100644 --- a/source/scss/blocks/social-block.scss +++ b/source/scss/blocks/social-block.scss @@ -22,6 +22,49 @@ background-color: $c-purple; border: 2px solid $c-purple; } + + &:focus { + color: $c-light; + } + + &.purple { + color: $c-light; + + &:focus { + color: $c-light; + } + + &::before { + background-color: $c-dark; + border-color: $c-dark; + } + } + + &.blue { + color: $c-light; + + &:focus { + color: $c-light; + } + + &::before { + background-color: $c-blue; + border-color: $c-blue; + } + } + + &.grey { + color: $c-light; + + &:focus { + color: $c-light; + } + + &::before { + background-color: $c-blue-accent; + border-color: $c-blue-accent; + } + } } } } @@ -35,6 +78,7 @@ color: $c-dark; border-radius: 50%; transition: color 0.3s ease 0.5s; + @media (max-width: $tablet) and (orientation: portrait) { display: none; } @@ -96,6 +140,75 @@ border-color: $c-purple; } } + + &.purple { + color: $c-light-purple; + + &:focus { + outline: none; + color: $c-dark; + + &::before { + border-color: $c-dark; + } + } + + &:active, + &:active:focus { + color: $c-light; + + &::before { + background-color: $c-dark; + border-color: $c-dark; + } + } + } + + &.blue { + color: $c-blue-accent; + + &:focus { + outline: none; + color: $c-blue; + + &::before { + border-color: $c-blue; + } + } + + &:active, + &:active:focus { + color: $c-light; + + &::before { + background-color: $c-blue; + border-color: $c-blue; + } + } + } + + &.grey { + color: $c-grey; + + &:focus { + outline: none; + color: $c-grey-accent; + + &::before { + border-color: $c-grey-accent; + } + } + + &:active, + &:active:focus { + color: $c-light; + + &::before { + background-color: $c-grey-accent; + border-color: $c-grey-accent; + } + } + } } .social-block__list { @@ -188,6 +301,7 @@ opacity: 0; top: 5px; transition: all 0.4s ease; + @media (min-width: $stop-scaling) { width: 40px; height: 40px; @@ -263,6 +377,84 @@ } } } + + &.purple { + &:hover { + color: $c-dark; + } + + &:focus { + color: $c-dark; + border-color: $c-dark; + } + + &:active, + &:active:focus { + color: $c-dark; + } + + @media (max-width: $tablet) and (orientation: portrait) { + color: $c-light; + background-color: $c-dark; + } + + @media (max-width: $mobile) and (orientation: landscape) { + color: $c-light; + background-color: $c-dark; + } + } + + &.blue { + &:hover { + color: $c-blue; + } + + &:focus { + color: $c-blue-accent; + border-color: $c-blue-accent; + } + + &:active, + &:active:focus { + color: $c-blue-accent; + } + + @media (max-width: $tablet) and (orientation: portrait) { + color: $c-light; + background-color: $c-blue; + } + + @media (max-width: $mobile) and (orientation: landscape) { + color: $c-light; + background-color: $c-blue; + } + } + + &.grey { + &:hover { + color: $c-grey-accent; + } + + &:focus { + color: $c-grey-accent; + border-color: $c-grey-accent; + } + + &:active, + &:active:focus { + color: $c-grey-accent; + } + + @media (max-width: $tablet) and (orientation: portrait) { + color: $c-light; + background-color: $c-grey-accent; + } + + @media (max-width: $mobile) and (orientation: landscape) { + color: $c-light; + background-color: $c-grey-accent; + } + } } .document-ready { diff --git a/source/scss/general/variables.scss b/source/scss/general/variables.scss index 63a8f35..5798f8e 100644 --- a/source/scss/general/variables.scss +++ b/source/scss/general/variables.scss @@ -1,7 +1,15 @@ $c-light: #ffffff; -$c-dark: #5f458c; $c-purple: #a67ee5; +$c-light-purple: #a17de4; +$c-dark: #5f458c; + +$c-blue-accent: #3f72ee; +$c-blue: #9fceff; + +$c-grey: #a7d4ff; +$c-grey-accent: #3f72ee; + $font: "Proxima Nova", "Arial", sans-serif; $font-alt: "Radical", "Arial", sans-serif;