Refactor homepage slider implementation by removing Swiper dependency and replacing it with a custom slider. Update styles and scripts accordingly, including changes to app.css and app.js for improved functionality and responsiveness. Update package.json to remove swiper dependency.

This commit is contained in:
Mekan1206
2026-08-04 06:37:25 +05:00
parent 96bc848420
commit 11e7398f29
10 changed files with 304 additions and 211 deletions

View File

@@ -168,154 +168,65 @@ blockquote {
}
/* END Basic styles */
/* CAROUSEL */
.image {
width: 100%;
height: 70%;
}
/* Main homepage slider */
.images {
overflow: hidden;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
}
.images-inner {
width: 500%;
transition: all 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
.custom-slider {
overflow: hidden;
width: 100%;
position: relative;
touch-action: pan-y;
cursor: grab;
max-height: 640px;
max-width: 1280px;
margin: 0 auto;
}
.image-slide {
width: 20%;
float: left;
.custom-slider:active {
cursor: grabbing;
}
.image-slide,
.fake-radio,
.radio-btn {
transition: all 0.5s ease-out;
.custom-slider .slider-track {
display: flex;
align-items: flex-start;
width: 100%;
transition: transform 0.6s ease;
will-change: transform;
}
.fake-radio {
float: right;
.custom-slider .slider-track.is-dragging {
transition: none;
}
/* Move slides overflowed container */
#slide1:checked~.images .images-inner {
margin-left: 0;
.custom-slider .slider-slide {
flex: 0 0 100%;
width: 100%;
min-width: 100%;
max-height: 640px;
user-select: none;
-webkit-user-drag: none;
}
#slide2:checked~.images .images-inner {
margin-left: -100%;
.custom-slider .slider-slide img {
display: block;
width: 100%;
max-width: 100%;
max-height: 640px;
height: auto;
object-fit: contain;
margin: 0 auto;
pointer-events: none;
-webkit-user-drag: none;
}
#slide3:checked~.images .images-inner {
margin-left: -200%;
.custom-slider .slider-slide a {
display: block;
-webkit-user-drag: none;
}
/* Color of bullets */
#slide1:checked~div .fake-radio .radio-btn:nth-child(1),
#slide2:checked~div .fake-radio .radio-btn:nth-child(2),
#slide3:checked~div .fake-radio .radio-btn:nth-child(3) {
background: red;
}
.radio-btn {
width: 9px;
height: 9px;
border-radius: 5px;
background: gray;
display: inline-block !important;
margin: 0 1px;
cursor: pointer;
}
/* Color of bullets - END */
/* Text of slides */
#slide1:checked~.labels .label:nth-child(1),
#slide2:checked~.labels .label:nth-child(2),
#slide3:checked~.labels .label:nth-child(3) {
opacity: 1;
}
.label {
opacity: 0;
position: absolute;
}
/* Text of slides - END */
#play1:checked~div .fake-radio .radio-btn:nth-child(1) {
animation: bullet 12300ms infinite -1000ms;
}
#play1:checked~div .fake-radio .radio-btn:nth-child(2) {
animation: bullet 12300ms infinite 3100ms;
}
#play1:checked~div .fake-radio .radio-btn:nth-child(3) {
animation: bullet 12300ms infinite 7200ms;
}
/* Calculate AUTOPLAY for BULLETS - END */
/* Calculate AUTOPLAY for SLIDES */
@keyframes slide {
0%,
25.203252032520325% {
margin-left: 0;
}
33.333333333333336%,
58.53658536585366% {
margin-left: -100%;
}
66.66666666666667%,
91.869918699187% {
margin-left: -200%;
}
}
.st-slider>#play1:checked~.images .images-inner {
animation: slide 12300ms infinite;
}
/* Calculate AUTOPLAY for SLIDES - END */
/* Calculate AUTOPLAY for CAPTION */
@keyframes caption {
0%,
33.32333333333334% {
opacity: 1;
}
33.333333333333336%,
100% {
opacity: 0;
}
}
#play1:checked~.labels .label:nth-child(1) {
animation: caption 12300ms infinite -1000ms;
}
#play1:checked~.labels .label:nth-child(2) {
animation: caption 12300ms infinite 3100ms;
}
#play1:checked~.labels .label:nth-child(3) {
animation: caption 12300ms infinite 7200ms;
}
/* END CAROUSEL */
/* END main homepage slider */
/* Slider */
.mySlides {