🌟 Dive into the world of web design with our latest tutorial! Learn step-by-step how to create a stunning 3D Image Gallery using HTML and CSS. 🖼️💻 Elevate your website with this easy-to-follow guide, perfect for beginners and enthusiasts alike. Impress your audience with a visually engaging gallery that adds a touch of modern flair to your online presence. Watch, learn, and transform your web design skills today! 🔧✨ #webdesign  #html  #css  #tutorial  
index.html 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>3D Image Gallery </title>
</head>
<body>
    <div class="slider">
        <span style="--i:1"><img src="Images/Animeted Loading Button.jpg" 
            alt="Animated Loading Button"></span> 
        <span style="--i:2"><img src="Images/Calculator.jpg" 
            alt="Calculator"></span> 
        <span style="--i:3"><img src="Images/Check Box.jpg" 
            alt="Check Box"></span> 
        <span style="--i:4"><img src="Images/Logo Hover.jpg" 
            alt="Logo Hover"></span> 
        <span style="--i:5"><img src="Images/Netflix.jpg" 
            alt="Netflix"></span> 
        <span style="--i:6"><img src="Images/QR Code Genarator.jpg" 
            alt="QR Code Genarator"></span> 
        <span style="--i:7"><img src="Images/Sign Up.jpg" 
            alt="Sign Up"></span> 
        <span style="--i:8"><img src="Images/Solar System.jpg" 
            alt="Solar System"></span>
    </div>
    <script>
        const slides = document.querySelectorAll('.slide');
slides.forEach((slide, index) => {
    slide.style.setProperty('--i', index);
});
    </script>
</body>
</html>
style.css 
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    background: linear-gradient(to right,rgb(73, 55, 55),gray);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.slider{
    position: relative;
    width: 125px;
    height: 150px;
    transform-style:preserve-3d ;
    animation: rotate 60s linear infinite;
}
@keyframes rotate {
    0%{
        transform:perspective(1000px) rotateY(0deg);
    }
    100%{
        transform:perspective(1000px) rotateY(360deg);
    }
}
.slider span{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height:100%;
    transform-origin:center ;
    transform-style:preserve-3d;
    transform:rotateY(calc(var(--i)*45deg))translateZ(350px) ;
}
.slider span img{
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height:100%;
    border-radius: 5px;
    object-fit: cover;
    transition: 0.5s;
}
.slider span:hover img{
    transform: translateY(-50px) scale(1);
    cursor:pointer;
}
.slider:hover{
    animation-play-state: paused;
}

Comments
Post a Comment