الگو:تصویرچهار: تفاوت میان نسخه‌ها

از ویکی تریدر | اولین دانشنامه تخصصی بازارهای مالی فارکس و ارز دیجیتال
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
بدون خلاصۀ ویرایش
برچسب: برگردانده‌شده
خط ۱: خط ۱:
<html lang="en">
<html lang="en">
<head>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Infinite Horizontal Image Slider</title>
     <style>
     <style>
        /* Container for the slider */
body {
        .slider-container {
align-items: center;
            display: flex;
background: #E3E3E3;
            justify-content: center;
display: flex;
            align-items: center;
height: 100vh;
            overflow: hidden;
justify-content: center;
            width: 100%;
}
            height: 300px; /* Adjust the height as needed */
            padding: 20px;
            position: relative;
        }


        /* Slider track that holds the images */
@mixin white-gradient {
        .slider-track {
background: linear-gradient(to right,  rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
            display: flex;
}
            animation: slideAnimation 120s linear infinite; /* Adjust duration for speed */
        }


        /* Individual image container */
$animationSpeed: 40s;
        .slide {
            position: relative;
            width: 250px; /* You can adjust the width */
            height: 100%;
            margin-right: 15px;
            overflow: hidden;
            border-radius: 10px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: transform 0.3s ease;
        }


        /* Images inside the slide */
// Animation
        .slide img {
@keyframes scroll {
            width: 100%;
0% { transform: translateX(0); }
            height: 100%;
100% { transform: translateX(calc(-250px * 7))}
            object-fit: cover;
}
            border-radius: 10px;
            transition: transform 0.3s ease;
        }


        /* Hover effect to zoom in the image */
        .slide:hover img {
            transform: scale(1.1); /* Scale the image when hovered */
        }


        /* Parallax effect: Move the background image based on mouse position */
// Styling
        .slide:hover {
.slider {
            transform: scale(1.05); /* Slightly zoom the image when hovering */
background: white;
        }
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, .125);
height: 100px;
margin: auto;
overflow:hidden;
position: relative;
width: 960px;
&::before,
&::after {
@include white-gradient;
content: "";
height: 100px;
position: absolute;
width: 200px;
z-index: 2;
}
&::after {
right: 0;
top: 0;
transform: rotateZ(180deg);
}


        /* Keyframes for the sliding animation */
&::before {
        @keyframes slideAnimation {
left: 0;
            0% { transform: translateX(0%); } /* Start at the beginning */
top: 0;
            100% { transform: translateX(-100%); } /* Move to the left */
}
        }
 
.slide-track {
        /* Optional: Adding some text or description over the image (you can add it) */
animation: scroll $animationSpeed linear infinite;
        .slide .description {
display: flex;
            position: absolute;
width: calc(250px * 14);
            bottom: 10px;
}
            left: 10px;
            color: white;
.slide {
            font-size: 16px;
height: 100px;
            background: rgba(0, 0, 0, 0.5);
width: 250px;
            padding: 5px 10px;
}
            border-radius: 5px;
}
            opacity: 0;
            transition: opacity 0.3s ease;
        }
 
        .slide:hover .description {
            opacity: 1; /* Show description when hovering */
        }
 
        /* Responsive design */
        @media (max-width: 768px) {
            .slider-container {
                height: 200px;
            }
 
            .slide {
                width: 80%;
            }
        }
 
        /* When mouse hovers over the slider, pause the animation */
        .slider-container:hover .slider-track {
            animation-play-state: paused;
        }
     </style>
     </style>
</head>
</head>
<body>
<body>
    <div class="slider-container">
<div class="slider">
        <div class="slider-track">
<div class="slide-track">
            <!-- 40 unique slides with 8 images repeated -->
<div class="slide">
            <div class="slide">
                 <img src="https://wikitrader.net/images/9/92/Trade-psychology-019.jpg" alt="Slide 1">
                 <img src="https://wikitrader.net/images/9/92/Trade-psychology-019.jpg" alt="Slide 1">
                 <div class="description">Slide 1</div>
                 <div class="description">Slide 1</div>

نسخهٔ ‏۲۳ دسامبر ۲۰۲۴، ساعت ۲۲:۵۲

Slide 1
Slide 1
Slide 2
Slide 2
Slide 3
Slide 3
Slide 4
Slide 4
Slide 5
Slide 5
Slide 6
Slide 6
Slide 7
Slide 7
Slide 8
Slide 8