diff --git a/100_projects/91-rotating-image-gallery/1.jpg b/100_projects/91-rotating-image-gallery/1.jpg new file mode 100644 index 0000000..fe6484c Binary files /dev/null and b/100_projects/91-rotating-image-gallery/1.jpg differ diff --git a/100_projects/91-rotating-image-gallery/2.jpg b/100_projects/91-rotating-image-gallery/2.jpg new file mode 100644 index 0000000..2735d00 Binary files /dev/null and b/100_projects/91-rotating-image-gallery/2.jpg differ diff --git a/100_projects/91-rotating-image-gallery/3.jpg b/100_projects/91-rotating-image-gallery/3.jpg new file mode 100644 index 0000000..10e2b1a Binary files /dev/null and b/100_projects/91-rotating-image-gallery/3.jpg differ diff --git a/100_projects/91-rotating-image-gallery/4.jpg b/100_projects/91-rotating-image-gallery/4.jpg new file mode 100644 index 0000000..018b8e2 Binary files /dev/null and b/100_projects/91-rotating-image-gallery/4.jpg differ diff --git a/100_projects/91-rotating-image-gallery/5.jpg b/100_projects/91-rotating-image-gallery/5.jpg new file mode 100644 index 0000000..01a3c8a Binary files /dev/null and b/100_projects/91-rotating-image-gallery/5.jpg differ diff --git a/100_projects/91-rotating-image-gallery/6.jpg b/100_projects/91-rotating-image-gallery/6.jpg new file mode 100644 index 0000000..1456938 Binary files /dev/null and b/100_projects/91-rotating-image-gallery/6.jpg differ diff --git a/100_projects/91-rotating-image-gallery/7.jpg b/100_projects/91-rotating-image-gallery/7.jpg new file mode 100644 index 0000000..3778596 Binary files /dev/null and b/100_projects/91-rotating-image-gallery/7.jpg differ diff --git a/100_projects/91-rotating-image-gallery/8.jpg b/100_projects/91-rotating-image-gallery/8.jpg new file mode 100644 index 0000000..4a4c91a Binary files /dev/null and b/100_projects/91-rotating-image-gallery/8.jpg differ diff --git a/100_projects/91-rotating-image-gallery/index.html b/100_projects/91-rotating-image-gallery/index.html new file mode 100644 index 0000000..cde214c --- /dev/null +++ b/100_projects/91-rotating-image-gallery/index.html @@ -0,0 +1,43 @@ + + + + + + + Document + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + diff --git a/100_projects/91-rotating-image-gallery/index.js b/100_projects/91-rotating-image-gallery/index.js new file mode 100644 index 0000000..fa1fde4 --- /dev/null +++ b/100_projects/91-rotating-image-gallery/index.js @@ -0,0 +1,26 @@ +const imageContainerEl = document.querySelector(".image-container"); + +const prevEl = document.getElementById("prev"); +const nextEl = document.getElementById("next"); +let x = 0; +let timer; +prevEl.addEventListener("click", () => { + x = x + 45; + clearTimeout(timer); + updateGallery(); +}); +nextEl.addEventListener("click", () => { + x = x - 45; + clearTimeout(timer); + updateGallery(); +}); + +function updateGallery() { + imageContainerEl.style.transform = `perspective(1000px) rotateY(${x}deg)`; + timer = setTimeout(() => { + x = x - 45; + updateGallery(); + }, 3000); +} + +updateGallery(); diff --git a/100_projects/91-rotating-image-gallery/style.css b/100_projects/91-rotating-image-gallery/style.css new file mode 100644 index 0000000..5ef8aea --- /dev/null +++ b/100_projects/91-rotating-image-gallery/style.css @@ -0,0 +1,59 @@ +body { + margin: 0; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + height: 100vh; + justify-content: center; + background-color: #b6a35f; + overflow: hidden; +} +.image-container { + position: relative; + width: 200px; + height: 200px; + transform-style: preserve-3d; + transform: perspective(1000px) rotateY(0deg); + transition: transform 0.7s; +} +.image-container span { + position: absolute; + top: 0; + left: 0; + width: 100%; + transform: rotateY(calc(var(--i) * 45deg)) translateZ(400px); +} +.image-container span img { + position: absolute; + left: 0; + top: 0; + width: 200px; + height: 150px; +} +.btn-container { + position: relative; + width: 80%; +} +.btn { + position: absolute; + bottom: -80px; + background-color: #aac388; + color: white; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + transition: .3s; + font-size: 18px; +} +.btn:hover { + filter: brightness(1.5); + color: #000; +} +#prev { + left: 20%; +} +#next { + right: 20%; +} \ No newline at end of file