Answer the question
In order to leave comments, you need to log in
How to hide/show the block correctly so that smooth appearance works?
Good afternoon. There are two blocks that are displayed and hidden according to a certain condition.
Each block consists of an inner svg element and an :after pseudo-element.
It is necessary that their appearance / disappearance be smooth.
Here is an example of styles:
.horizontal-scrollbar {
&__buttons {
position: relative;
}
&__button-left {
position: absolute;
top: 20px;
left: 0;
opacity: 0;
.icon {
position: relative;
fill: $blue;
height: rem(25);
width: rem(25);
transform: rotate(270deg);
cursor: pointer;
z-index: $zi-layer-2;
&:hover {
transform: rotate(270deg) scale(1.2);
}
}
&:after {
position: absolute;
top: -30px;
left: 0;
display: block;
content: '';
width: rem(100);
height: rem(90);
background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0.20));
z-index: $zi-layer-1;
}
&.is-visible {
opacity: 1;
}
}
&__button-right {
position: absolute;
top: 20px;
right: 0;
opacity: 0;
.icon {
position: relative;
fill: $blue;
height: rem(25);
width: rem(25);
transform: rotate(90deg);
cursor: pointer;
z-index: $zi-layer-2;
&:hover {
transform: rotate(90deg) scale(1.2);
}
}
&:after {
position: absolute;
top: -30px;
right: 0;
display: block;
content: '';
width: rem(100);
height: rem(90);
background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0.20));
z-index: $zi-layer-1;
}
&.is-visible {
opacity: 1;
}
}
&__content {
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question