I am proud of using animation in my project for the first time:
.footer__content {
@include u.padding_all(3rem);
@include c.display-flex($justify: center, $direction: column);
h2 {
@include u.text-style(uppercase, 0.5rem);
overflow: hidden;
border-right: .15em solid v.$very-dark-gray;
white-space: nowrap;
display: inline-block;
margin: 0 auto;
animation: typing 15s steps(20, end) infinite, blink-caret .75s step-end infinite;
@include u.no-animation {
animation: none;
}
}
p {
@include u.padding_y(1rem);
}
@include c.mobile {
@include u.padding_all(1rem);
}
}
/* The typing effect */
@keyframes typing {
from,
to {
max-width: 0
}
50% {
max-width: 100%
}
}
/* The typewriter cursor effect */
@keyframes blink-caret {
from,
to {
border-color: transparent
}
50% {
border-color: v.$very-dark-gray;
}
}
What challenges did you encounter, and how did you overcome them?
After adding transitions to my slides, the Shop Now
button stopped working. The hover worked only for the last slide. But I was able to fix it using pointer-events
:
.hero__slide {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
pointer-events: none;
.hero__image {
transform: translateX(-100%);
@include u.transition(opacity, 1s, ease-out);
@include u.no-animation {
transition: none;
}
}
.hero__content {
transform: translateX(100%);
@include u.transition(opacity, 1s, ease-out);
@include u.no-animation {
transition: none;
}
@include u.padding_all(6rem);
p {
@include u.padding_y(1rem);
}
button {
@include u.text-style(uppercase, 0.8rem);
color: v.$black;
@include u.transition(color, 0.3s, ease);
&:hover {
color: v.$dark-gray;
}
}
@include c.mobile {
@include u.padding_all(2.5rem);
}
}
}
.active {
opacity: 1;
position: relative;
@include u.transition(opacity, 1s, ease-in);
pointer-events: auto;
@include u.no-animation {
transition: none;
}
.hero__content,
.hero__image {
transform: translateX(0);
@include u.transition(all, 1s, ease-in);
@include u.no-animation {
transition: none;
}
@include c.mobile {
@include u.transition(opacity, 1s, ease-in);
@include u.no-animation {
transition: none;
}
}
}
}
What specific areas of your project would you like help with?
How to use SCSS more efficiently and how to organise my styling code in a better way. Also, any input on transitions & animations would be good too!