diff --git a/src/app/trending-movies/trending-movies.component.html b/src/app/trending-movies/trending-movies.component.html index 690ae00..62351c5 100644 --- a/src/app/trending-movies/trending-movies.component.html +++ b/src/app/trending-movies/trending-movies.component.html @@ -46,9 +46,10 @@

{{ movie.title }}

More info - Average vote: {{ movie.vote_average }} +
+
+
+ diff --git a/src/app/trending-tv/trending-tv.component.html b/src/app/trending-tv/trending-tv.component.html index b037e26..e1dca14 100644 --- a/src/app/trending-tv/trending-tv.component.html +++ b/src/app/trending-tv/trending-tv.component.html @@ -55,9 +55,9 @@

{{ s.name }}

More info - Average vote: {{ s.vote_average }} +
+
+
diff --git a/src/styles.scss b/src/styles.scss index c160301..cd476cd 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -154,4 +154,74 @@ h5 { color: white; font-size: 0.7rem; white-space: nowrap; +} + +/** ============================ + ** variable + ** ============================ */ + $circular-margin: 0px; + $break-small: 320px; + $break-large: 1100px; + + /** ============================ + ** function circular-progress + ** ============================ */ + @function circular-progress($maxPercent, $percent, $color-bar, $color-back) { + $increment: 360 / $maxPercent; + $half: round($maxPercent / 2); + $background-image: ''; + @if $percent < $half { + $nextdeg: 90deg + ($increment * $percent); + $background-image: 'linear-gradient(90deg, #{$color-back} 50%, transparent 50%, transparent), linear-gradient(#{$nextdeg}, #{$color-bar} 50%, #{$color-back} 50%, #{$color-back})'; + + } + @else { + $nextdeg: -90deg + ($increment * ($percent - $half)); + $background-image: 'linear-gradient(#{$nextdeg}, #{$color-bar} 50%, transparent 50%, transparent), linear-gradient(270deg, #{$color-bar} 50%, #{$color-back} 50%, #{$color-back})'; + + } + @return unquote($background-image); + } + + + /** ============================ + ** Mixins Circular Progress + ** ============================ */ + @mixin circular-progress($percent-num, $color1:"#03A9F4") { + //circular-progress function + //circular-progress($maxPercent, $percent, $color-bar, $color-back); + // background: circular-progress(100, $percent-num, #03A9F4, #E0E0E0); + background: circular-progress(100, $percent-num, $color1, #E0E0E0); + border-radius: 50%; + height: 30px; + margin: 2em auto; + position: relative; + min-width: 30px; + margin: $circular-margin; + transition: all .3s linear; + &::before { + background-color: #FAFAFA; + border-radius: 50%; + color: rgba(black, .54); + content: '#{$percent-num}'; + font-size: 0.9rem; + font-weight: bold; + height: 100%; + left: 0; + line-height: 30px; + position: absolute; + text-align: center; + top: 0; + transform: scale(.80); + width: 100%; + } + &:hover { + box-shadow: 0 0 100px 1px rgba(255, 214, 112, 0.35); + } + } + +@for $i from 1 through 100 { + .circular-progress#{$i} { + @include circular-progress($i, #3a8fde); + } } \ No newline at end of file