From e78b3c34348f26d40a813612c5a3786f1c56607a Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Tue, 29 Aug 2017 18:07:53 +0800 Subject: Initial SASS build --- src/_parallax.scss | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/_parallax.scss (limited to 'src/_parallax.scss') diff --git a/src/_parallax.scss b/src/_parallax.scss new file mode 100644 index 0000000..c097e1f --- /dev/null +++ b/src/_parallax.scss @@ -0,0 +1,129 @@ +// Parallax +$parallax-deg: 3deg; +$parallax-offset: 6.5px; +$parallax-offset-z: 100px; +$parallax-perspective: 1000px; +$parallax-scale: 1 - unit($parallax-offset-z / $parallax-perspective); + +// Mixin: Parallax direction +@mixin parallax-dir() { + height: 50%; + position: absolute; + width: 50%; + z-index: $zindex-3; +} + +.parallax { + display: block; + height: auto; + position: relative; + width: auto; + + .parallax-content { + height: auto; + @include shadow-variant(1rem); + transform: perspective($parallax-perspective); + transform-style: preserve-3d; + transition: all .4s ease; + width: 100%; + + &::before { + content: ""; + display: block; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; + } + } + + .parallax-front { + align-items: center; + color: $light-color; + display: flex; + height: 100%; + justify-content: center; + left: 0; + position: absolute; + text-align: center; + text-shadow: 0 0 20px fade($dark-color, 50%); + top: 0; + transform: translateZ($parallax-offset-z) scale($parallax-scale); + transition: all .4s ease; + width: 100%; + z-index: $zindex-0; + } + + .parallax-top-left { + @include parallax-dir(); + left: 0; + top: 0; + + &:hover ~ .parallax-content { + transform: perspective($parallax-perspective) rotateX(-$parallax-deg) rotateY($parallax-deg); + + &::before { + background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 50%); + } + + .parallax-front { + transform: translate3d(-$parallax-offset, -$parallax-offset, $parallax-offset-z) scale($parallax-scale); + } + } + } + + .parallax-top-right { + @include parallax-dir(); + right: 0; + top: 0; + + &:hover ~ .parallax-content { + transform: perspective($parallax-perspective) rotateX(-$parallax-deg) rotateY(-$parallax-deg); + + &::before { + background: linear-gradient(-135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 50%); + } + + .parallax-front { + transform: translate3d($parallax-offset, -$parallax-offset, $parallax-offset-z) scale($parallax-scale); + } + } + } + + .parallax-bottom-left { + @include parallax-dir(); + bottom: 0; + left: 0; + + &:hover ~ .parallax-content { + transform: perspective($parallax-perspective) rotateX($parallax-deg) rotateY($parallax-deg); + + &::before { + background: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 50%); + } + + .parallax-front { + transform: translate3d(-$parallax-offset, $parallax-offset, $parallax-offset-z) scale($parallax-scale); + } + } + } + + .parallax-bottom-right { + @include parallax-dir(); + bottom: 0; + right: 0; + + &:hover ~ .parallax-content { + transform: perspective($parallax-perspective) rotateX($parallax-deg) rotateY(-$parallax-deg); + + &::before { + background: linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 50%); + } + + .parallax-front { + transform: translate3d($parallax-offset, $parallax-offset, $parallax-offset-z) scale($parallax-scale); + } + } + } +} -- cgit v1.3.1-26-gb76a From dd03f84e2ad7cffa517bee412d1e15e8de47f88d Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Wed, 30 Aug 2017 20:52:53 +0800 Subject: Fix LESS to SASS issues. Add Examples. --- docs/components.html | 6 ++-- docs/css/docs.css | 9 +++--- docs/dist/spectre-exp.css | 44 +++++++++++++-------------- docs/dist/spectre-exp.min.css | 2 +- docs/dist/spectre.css | 5 ++-- docs/dist/spectre.min.css | 2 +- docs/elements.html | 42 +++++++++++++------------- docs/examples/starter.html | 29 ++++++++++++++++++ docs/experimentals.html | 10 +++---- docs/getting-started.html | 70 +++++++++++++++++++++++-------------------- docs/index.html | 4 +-- docs/layout.html | 6 ++-- docs/src/docs.scss | 11 +++---- docs/utilities.html | 6 ++-- gulpfile.js | 6 ++-- src/_carousels.scss | 6 ++-- src/_chips.scss | 1 - src/_comparison-sliders.scss | 2 +- src/_parallax.scss | 34 ++++++++++----------- 19 files changed, 164 insertions(+), 131 deletions(-) create mode 100644 docs/examples/starter.html (limited to 'src/_parallax.scss') diff --git a/docs/components.html b/docs/components.html index 251401e..b4f90ed 100644 --- a/docs/components.html +++ b/docs/components.html @@ -1,10 +1,10 @@ - + - + Components - Spectre.css CSS Framework @@ -16,7 +16,7 @@