hugo-toha/assets/styles/sections/about.scss
Augusto Pace d3968ca711
Fixed and improved circular progess animation on about section (#850)
Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
2023-12-29 23:04:27 +06:00

232 lines
4.7 KiB
SCSS

@use 'sass:map';
$progress-bar-colors: (
'blue': #048dff,
'yellow': #eebb4d,
'pink': #ed63d2,
'green': #2dca73,
'sky': #00c9e3,
'orange': #ff7c7c,
);
@mixin circular-progress-bar-color() {
@each $color, $value in $progress-bar-colors {
&.#{$color} {
.circular-progress-bar {
border-color: $value;
}
}
}
}
@mixin circular-progress-animation-breakpoints() {
$progress: 0;
$duration: 0;
$delay: 1.8;
@for $i from 0 through 20 {
.circular-progress-percentage-#{$progress} {
animation: circular-loading-#{$progress} #{$duration}s linear forwards 1.8s;
}
.circular-progress-percentage-#{$progress}-delay {
animation-delay: #{$delay}s;
}
$progress: $progress + 5;
$duration: $duration + 0.18;
$delay: $duration + 1.8;
}
}
@mixin circular-progress-animation-keyframes($progress, $degree, $keyframes) {
@for $i from 0 through $keyframes {
@keyframes circular-loading-#{$progress} {
0% {
transform: rotate(0);
}
100% {
transform: rotate(#{$degree}deg);
}
}
$progress: $progress + 5;
$degree: $degree + 18;
}
}
.about-section {
.social-link {
list-style: none;
padding: 0.2rem;
a {
font-size: 1.5rem;
color: get-light-color('text-color');
padding: 0.5rem;
&:hover {
color: get-light-color('accent-color');
@include transition();
}
}
}
.circular-progress {
width: 150px;
height: 150px;
line-height: 150px;
background: none;
margin: 0 auto;
box-shadow: none;
position: relative;
&::after {
content: '';
width: 100%;
height: 100%;
border-radius: 50%;
border: 12px solid get-light-color('bg-primary');
position: absolute;
top: 0;
left: 0;
}
span {
width: 50%;
height: 100%;
overflow: hidden;
position: absolute;
top: 0;
z-index: 1;
}
.circular-progress-bar {
width: 100%;
height: 100%;
background: none;
border-width: 12px;
border-style: solid;
position: absolute;
top: 0;
}
.circular-progress-left {
left: 0;
.circular-progress-bar {
left: 100%;
border-top-right-radius: 80px;
border-bottom-right-radius: 80px;
border-left: 0;
transform-origin: center left;
}
}
.circular-progress-right {
right: 0;
.circular-progress-bar {
left: -100%;
border-top-left-radius: 80px;
border-bottom-left-radius: 80px;
border-right: 0;
transform-origin: center right;
}
}
.circular-progress-value {
width: 90%;
height: 90%;
padding: 1rem;
border-radius: 50%;
background: get-light-color('text-color');
font-size: 1rem;
color: get-light-color('bg-primary');
line-height: initial;
text-align: center;
position: absolute;
top: 5%;
left: 5%;
display: flex;
justify-content: center;
align-items: center;
}
@include circular-progress-bar-color();
@include circular-progress-animation-breakpoints();
@include circular-progress-animation-keyframes($progress: 0, $degree: 0, $keyframes: 20);
}
@include media('<=large') {
.circular-progress {
margin-bottom: 20px;
}
}
@include media('<=medium') {
.about-section.container {
max-width: 100%;
}
.circular-progress {
width: 135px;
height: 135px;
}
}
@include media('<=small') {
.circular-progress {
width: 150px;
height: 150px;
}
.circular-progress .circular-progress-value {
font-size: 1rem;
}
}
@include media('<=tiny') {
.col-6 {
flex: auto;
max-width: 100%;
}
.social-link {
flex-wrap: wrap;
}
.certificate-badge {
padding-left: 2rem;
padding-right: 2rem;
}
.circular-progress {
width: 200px;
height: 200px;
.circular-progress-left .circular-progress-bar {
border-top-right-radius: 100px;
border-bottom-right-radius: 100px;
}
.circular-progress-right .circular-progress-bar {
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
}
}
}
}
html[data-theme='dark'] {
.about-section {
.social-link {
a {
color: get-dark-color('text-color');
&:hover {
color: get-dark-color('accent-color');
}
}
}
.circular-progress {
&::after {
border: 12px solid get-dark-color('bg-primary');
}
.circular-progress-value {
background: get-dark-color('inverse-text-color');
color: get-dark-color('text-color');
}
}
}
}