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/_comparison-sliders.scss | 114 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 src/_comparison-sliders.scss (limited to 'src/_comparison-sliders.scss') diff --git a/src/_comparison-sliders.scss b/src/_comparison-sliders.scss new file mode 100644 index 0000000..153bb0a --- /dev/null +++ b/src/_comparison-sliders.scss @@ -0,0 +1,114 @@ +// Image comparison slider +// Credit: http://codepen.io/solipsistacp/pen/Gpmaq +.comparison-slider { + height: 50vh; + overflow: hidden; + position: relative; + width: 100%; + + .comparison-before, + .comparison-after { + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + position: absolute; + top: 0; + + img { + height: 100%; + object-fit: none; + object-position: left center; + position: absolute; + width: 100%; + } + } + + .comparison-before { + width: 100%; + z-index: 1; + + .comparison-label { + right: $unit-4; + } + } + + .comparison-after { + max-width: 100%; + min-width: 0; + z-index: 2; + + &::before { + background: transparent; + content: ""; + cursor: default; + height: 100%; + left: 0; + position: absolute; + right: $unit-4; + top: 0; + z-index: $zindex-0; + } + + &::after { + background: currentColor; + border-radius: 50%; + box-shadow: 0 -5px, 0 5px; + color: $light-color; + content: ""; + height: 3px; + position: absolute; + right: $unit-2; + top: 50%; + transform: translate(50%, -50%); + width: 3px; + } + + .comparison-label { + left: $unit-4; + } + } + + .comparison-resizer { + animation: first-run 1.5s 1 ease-in-out; + cursor: ew-resize; + height: $unit-4; + left: 0; + max-width: 100%; + min-width: $unit-4; + opacity: 0; + outline: none; + position: relative; + resize: horizontal; + top: 50%; + transform: translateY(-50%) scaleY(30); + width: 0; + } + + .comparison-label { + background: fade($dark-color, 50%); + bottom: $unit-4; + color: $light-color; + padding: $unit-1 $unit-2; + position: absolute; + user-select: none; + } +} + +@keyframes first-run { + 0% { + width: 0; + } + 25% { + width: $unit-12; + } + 50% { + width: $unit-4; + } + 75% { + width: $unit-6; + } + 100% { + width: 0; + } +} -- 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/_comparison-sliders.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 @@