summaryrefslogtreecommitdiff
path: root/addons/website/static/src/snippets/s_rating/000.scss
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/website/static/src/snippets/s_rating/000.scss
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website/static/src/snippets/s_rating/000.scss')
-rw-r--r--addons/website/static/src/snippets/s_rating/000.scss55
1 files changed, 55 insertions, 0 deletions
diff --git a/addons/website/static/src/snippets/s_rating/000.scss b/addons/website/static/src/snippets/s_rating/000.scss
new file mode 100644
index 00000000..968ee7d3
--- /dev/null
+++ b/addons/website/static/src/snippets/s_rating/000.scss
@@ -0,0 +1,55 @@
+
+.s_rating:not([data-vcss]) {
+ $star: "\f005";
+ $star-o: "\f006";
+ $circle: "\f111";
+ $circle-o: "\f10c";
+ $heart: "\f004";
+ $heart-o: "\f08a";
+ @mixin s_rating_generate_icons($off, $on) {
+ .fa:before {
+ content: $off;
+ }
+ @for $counter from 5 to 0 {
+ &.s_rating_#{$counter} {
+ .fa:nth-of-type(-n+#{$counter}):before {
+ content: $on;
+ }
+ }
+ }
+ }
+ > .s_rating_stars { @include s_rating_generate_icons($star-o, $star); }
+ > .s_rating_squares { @include s_rating_generate_icons($circle-o, $circle); }
+ > .s_rating_hearts { @include s_rating_generate_icons($heart-o, $heart); }
+ > .s_rating_bar {
+ .fa {
+ display: none;
+ }
+ .s_rating_bar {
+ display: flex;
+ height: $progress-height;
+ background-color: $gray-300;
+ &:before {
+ content: "";
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ @include transition($progress-bar-transition);
+ @include gradient-striped();
+ background-size: $progress-height $progress-height;
+ background-color: theme-color('primary');
+ animation: progress-bar-stripes $progress-bar-animation-timing;
+ }
+ }
+ @for $counter from 5 to 0 {
+ &.s_rating_#{$counter} {
+ .s_rating_bar:before {
+ width: percentage($counter/5);
+ }
+ }
+ }
+ }
+ > .s_rating_1x { .fa { font-size: 1em; }; }
+ > .s_rating_2x { .fa { font-size: 2em; }; }
+ > .s_rating_3x { .fa { font-size: 3em; }; }
+}