webapp/src/components/_shared/SolidSwiper/Swiper.module.scss

383 lines
6.6 KiB
SCSS
Raw Normal View History

2023-07-17 22:24:37 +00:00
:root {
--slide-height: 300px;
2023-11-06 20:33:57 +00:00
--navigation-reserve: 48px;
2023-07-17 22:24:37 +00:00
@include media-breakpoint-up(md) {
--slide-height: 500px;
2023-11-06 20:33:57 +00:00
--navigation-reserve: 56px;
2023-07-17 22:24:37 +00:00
}
}
.Swiper {
display: block;
margin: 2rem 0;
flex-direction: column;
&.ArticleCardSwiper {
margin-bottom: 6rem;
2023-11-08 21:55:27 +00:00
padding-bottom: 2rem;
}
.sliderTitle {
@include font-size(4.5rem);
text-align: center;
padding: 4rem 0 0;
}
&.articleMode {
background: var(--background-color-invert);
color: var(--default-color-invert);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
2023-11-04 15:37:28 +00:00
a {
color: var(--default-color-invert);
border-color: var(--default-color-invert);
}
2023-11-04 15:37:28 +00:00
.container {
2023-11-13 18:56:47 +00:00
margin: auto;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
gap: 20px;
2023-07-17 22:24:37 +00:00
width: 100%;
.thumbsHolder {
2023-07-17 22:24:37 +00:00
width: auto;
}
.thumbs {
2024-01-23 16:32:57 +00:00
// overflow: hidden;
box-sizing: border-box;
margin: 0;
position: relative;
2024-05-06 21:51:07 +00:00
&>swiper-container {
display: flex;
flex-direction: row;
gap: 10px;
}
.thumbsNav {
height: 100%;
overflow: hidden;
width: 24px;
&.prev {
top: 50%;
left: 0;
transform: translateY(-50%);
}
&.next {
top: 50%;
right: 0;
left: unset;
transform: translateY(-50%);
}
}
}
}
&.mobileView {
.container {
padding: 0;
2024-01-23 16:32:57 +00:00
.thumbs {
& swiper-slide {
// bind to html element <swiper-slide/>
width: unset !important;
}
}
}
}
}
&.editorMode {
color: #0d0d0d;
.holder {
width: 100%;
}
}
.action {
border-radius: 50%;
width: 32px;
height: 32px;
align-items: center;
justify-content: center;
position: absolute;
top: 16px;
right: 16px;
2023-11-04 15:37:28 +00:00
background: rgb(var(--default-color) 0.3);
cursor: pointer;
2023-08-26 10:45:35 +00:00
z-index: 12;
display: none;
.icon {
width: 14px;
height: 14px;
}
}
.holder {
position: relative;
box-sizing: border-box;
overflow: hidden;
2023-11-10 03:16:42 +00:00
width: 100%;
.counter {
@include font-size(1.2rem);
@include media-breakpoint-up(sm) {
top: 477px;
}
position: absolute;
z-index: 2;
top: 276px;
2023-07-17 22:24:37 +00:00
right: 0;
font-weight: 600;
padding: 0.2rem 0.8rem;
color: var(--background-color);
background-color: var(--default-color);
}
.image {
display: flex;
align-items: center;
justify-content: center;
2023-07-17 22:24:37 +00:00
height: var(--slide-height);
background: var(--placeholder-color-semi);
position: relative;
img {
max-height: 100%;
2023-11-06 07:05:01 +00:00
width: auto;
cursor: zoom-in;
}
}
2023-08-26 10:45:35 +00:00
&:hover .action {
display: flex;
}
}
.navigation {
display: flex;
position: absolute;
top: 0;
bottom: 0;
align-items: center;
cursor: pointer;
2023-11-06 20:33:57 +00:00
height: 100%;
2023-11-09 21:40:47 +00:00
width: 10%;
2023-07-17 22:24:37 +00:00
z-index: 2;
&.disabled {
opacity: 0.5;
cursor: inherit;
}
&.prev {
2023-11-13 18:56:47 +00:00
background-image: linear-gradient(to right, #000, rgb(0 0 0 / 0%));
left: 0;
}
&.next {
2023-11-13 18:56:47 +00:00
background-image: linear-gradient(to left, #000, rgb(0 0 0 / 0%));
2023-11-06 20:33:57 +00:00
justify-content: end;
right: 0;
}
.icon {
2023-11-06 20:33:57 +00:00
height: var(--navigation-reserve);
width: var(--navigation-reserve);
transition: 0.3s ease-in-out;
}
&:not(.disabled):hover .icon {
2023-07-17 22:24:37 +00:00
opacity: 0.6;
}
}
&.articleMode .navigation {
2023-07-17 22:24:37 +00:00
.icon {
filter: invert(1);
}
}
.slideDescription {
margin-top: 8px;
align-self: flex-start;
2023-07-17 22:24:37 +00:00
.articleTitle {
@include font-size(1.4rem);
}
.source {
@include font-size(1.2rem);
2023-11-04 15:37:28 +00:00
color: var(--secondary-color);
}
2023-07-17 22:24:37 +00:00
.body {
@include font-size(1.7rem);
2023-11-04 15:37:28 +00:00
margin-top: 24px;
2023-07-17 22:24:37 +00:00
* {
2024-01-23 16:32:57 +00:00
color: var(--default-color-invert) !important; // Force fix migration errors with inline styles
}
2023-07-17 22:24:37 +00:00
@include media-breakpoint-up(md) {
2023-11-04 15:37:28 +00:00
// margin-left: calc((100% + 130px) * 0.15);
2023-07-17 22:24:37 +00:00
margin-left: calc(15% + 24px);
}
}
}
.thumbs {
margin: 3rem 0;
2023-07-17 22:24:37 +00:00
max-height: var(--slide-height);
position: relative;
.navigation {
2023-07-17 22:24:37 +00:00
height: auto;
&.prev {
2023-11-13 18:56:47 +00:00
left: calc(0px - var(--navigation-reserve));
}
&.next {
2023-11-13 18:56:47 +00:00
right: calc(0px - var(--navigation-reserve));
}
}
.upload {
border: 1px solid #ccced3;
box-sizing: border-box;
cursor: pointer;
.inner {
position: relative;
z-index: 1000;
width: 110px;
height: 75px;
display: flex;
align-items: center;
justify-content: center;
}
}
.imageThumb {
width: 110px;
height: 75px;
background-size: cover;
background-position: 50% 50%;
background-color: var(--placeholder-color-semi);
opacity: 0.5;
filter: grayscale(1);
transition:
filter 0.3s ease-in-out,
opacity 0.5s ease-in-out;
.thumbAction {
display: none;
position: absolute;
top: 6px;
right: 6px;
flex-direction: column;
gap: 5px;
.action {
position: static;
display: flex;
width: 18px;
height: 18px;
&.hidden {
display: none;
}
.icon {
width: 8px;
height: 8px;
}
}
}
&:hover {
opacity: 1;
cursor: pointer;
2023-07-17 22:24:37 +00:00
filter: none;
.thumbAction {
display: flex;
}
}
}
}
.addSlides {
display: flex;
align-items: center;
justify-content: center;
margin: 2rem auto;
}
.description {
display: flex;
flex-direction: column;
gap: 0.5em;
margin: 1em 0;
.input {
@include font-size(1.4rem);
padding: 0;
margin: 0;
border: none;
height: 1.2em;
&:focus {
outline: none;
}
&::placeholder {
color: var(--placeholder-color);
}
&.title {
font-weight: 500;
}
}
}
2023-07-17 22:24:37 +00:00
:global(.swiper-lazy-preloader) {
top: calc(var(--slide-height) / 2);
}
}
:global(.swiper-slide-thumb-active) {
.imageThumb {
opacity: 1 !important;
2023-07-17 22:24:37 +00:00
filter: none !important;
.thumbAction {
display: flex !important;
}
}
.swiper-button-prev,
.swiper-rtl .swiper-button-next {
top: 200px !important;
}
}