Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit38fd80e7a02a158dce1ba1edb4d6144e2325585a (patch)
Author
 Yan Zhu <picturepan2@hotmail.com>
2018-11-25 16:48:28 +0800
Committer
 Yan Zhu <picturepan2@hotmail.com>
2018-11-25 16:48:28 +0800
Files5d0d52c669c6dc0de8f55997cc81ac9e95a0498d /src
Spectre-Dark-Gruvbox-38fd80e7a02a158dce1ba1edb4d6144e2325585a.tar
Spectre-Dark-Gruvbox-38fd80e7a02a158dce1ba1edb4d6144e2325585a.tar.gz
Spectre-Dark-Gruvbox-38fd80e7a02a158dce1ba1edb4d6144e2325585a.zip
Parentb058afc44ab1f2bc142fadf12df063dd56ed1f8a (diff)
Change Carousels image number to variable #428
2 files changed, 23 insertions, 13 deletions
-rw-r--r--src/_carousels.scss34
-rw-r--r--src/_viewer-360.scss2
diff --git a/src/_carousels.scss b/src/_carousels.scss
index 5b4eaf5..66dc51b 100644
--- a/src/_carousels.scss
+++ b/src/_carousels.scss
@@ -1,4 +1,17 @@
// Carousels
+// The number of carousel images
+$carousel-number: 8;
+
+%carousel-image-checked {
+ animation: carousel-slidein .75s ease-in-out 1;
+ opacity: 1;
+ z-index: $zindex-1;
+}
+
+%carousel-nav-checked {
+ color: $gray-color-light;
+}
+
.carousel {
background: $bg-color;
display: block;
@@ -57,19 +70,16 @@
}
.carousel-locator {
- &:nth-of-type(1):checked ~ .carousel-container .carousel-item:nth-of-type(1),
- &:nth-of-type(2):checked ~ .carousel-container .carousel-item:nth-of-type(2),
- &:nth-of-type(3):checked ~ .carousel-container .carousel-item:nth-of-type(3),
- &:nth-of-type(4):checked ~ .carousel-container .carousel-item:nth-of-type(4) {
- animation: carousel-slidein .75s ease-in-out 1;
- opacity: 1;
- z-index: $zindex-1;
+ @for $i from 1 through ($carousel-number) {
+ &:nth-of-type(#{$i}):checked ~ .carousel-container .carousel-item:nth-of-type(#{$i}) {
+ @extend %carousel-image-checked;
+ }
}
- &:nth-of-type(1):checked ~ .carousel-nav .nav-item:nth-of-type(1),
- &:nth-of-type(2):checked ~ .carousel-nav .nav-item:nth-of-type(2),
- &:nth-of-type(3):checked ~ .carousel-nav .nav-item:nth-of-type(3),
- &:nth-of-type(4):checked ~ .carousel-nav .nav-item:nth-of-type(4) {
- color: $gray-color-light;
+
+ @for $i from 1 through ($carousel-number) {
+ &:nth-of-type(#{$i}):checked ~ .carousel-nav .nav-item:nth-of-type(#{$i}) {
+ @extend %carousel-nav-checked;
+ }
}
}
diff --git a/src/_viewer-360.scss b/src/_viewer-360.scss
index 8d5fd61..332fba4 100644
--- a/src/_viewer-360.scss
+++ b/src/_viewer-360.scss
@@ -1,5 +1,5 @@
// 360 Degree Viewer
-// The number of images options
+// The number of images
$image-height: 9rem;
$image-number: 36 !default;
$image-width: 24rem;