Skip to content

Commit 148a7b2

Browse files
authored
Carousel effect feature (#689)
* Add files via upload * Create l * Add files via upload * Delete carousel_effect/l * Delete c1.png * Delete c2.png * Delete c3.png * Update README.md * Add files via upload * Update README.md * Update README.md * Update README.md * Add files via upload * Update README.md * Create l * Add files via upload * Delete output/l * Delete images/carousel_demo.mp4 * Delete output directory * Create l * Add files via upload * Delete carousel_effect/output/l
1 parent 61ea6ca commit 148a7b2

File tree

7 files changed

+108
-0
lines changed

7 files changed

+108
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Please be aware that the demos may exhibit significant accessibility issues, suc
4343
- [Carousel](#carousel)
4444
- [Compass Loader](#compass-loader)
4545
- [City Animation Footer](#city-animation-footer)
46+
- [Carousel Effect](#carousel-effect)
4647
- [Counter of Checked Checkboxes](#counter-of-checked-check-boxes)
4748
- [Download_buttons](#Download_buttons)
4849
- [Dog Box Animation](#dog-box-animation)
@@ -1012,6 +1013,16 @@ Please be aware that the demos may exhibit significant accessibility issues, suc
10121013

10131014
---
10141015

1016+
## <a id="carousel-effect"></a>Carousel Effect
1017+
1018+
1019+
[Download the demo video](https://raw.githubusercontent.com/amrutha-m206/You-Dont-Need-JavaScript/carousel_effect-feature/images/carousel_demo.mp4)
1020+
1021+
1022+
1023+
1024+
**[⬆ back to top](#quick-links)**
1025+
10151026
## Contributors
10161027

10171028
Thanks to these wonderful people who have contributed to this project!

carousel_effect/img1.jpg

7.91 KB
Loading

carousel_effect/img2.jpg

2.15 MB
Loading

carousel_effect/img3.jpg

428 KB
Loading

carousel_effect/index.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Carousel</title>
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
<div class="carousel">
11+
<input type="radio" name="slides" id="slide1" checked>
12+
<input type="radio" name="slides" id="slide2">
13+
<input type="radio" name="slides" id="slide3">
14+
15+
<div class="slides">
16+
<div class="slide" id="image1"><img src="img1.jpg" alt="Image 1"></div>
17+
<div class="slide" id="image2"><img src="img2.jpg" alt="Image 2"></div>
18+
<div class="slide" id="image3"><img src="img3.jpg" alt="Image 3"></div>
19+
</div>
20+
21+
<div class="navigation">
22+
<label for="slide1"></label>
23+
<label for="slide2"></label>
24+
<label for="slide3"></label>
25+
</div>
26+
</div>
27+
28+
</body>
29+
</html>
384 KB
Binary file not shown.

carousel_effect/style.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
body{
2+
background-color: rgb(163, 193, 163);
3+
}
4+
.carousel {
5+
position: relative;
6+
width: 80%;
7+
max-width: 800px;
8+
height: 50vh;
9+
margin: 0 auto;
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
overflow: hidden;
14+
border-radius: 10px;
15+
16+
}
17+
18+
.slides {
19+
display: flex;
20+
width: 800%;
21+
height: 100%;
22+
transition: transform 1s ease;
23+
animation: slideAnimation 12s infinite;
24+
}
25+
26+
@keyframes slideAnimation {
27+
0%, 33.33% { transform: translateX(0%); }
28+
33.34%, 66.66% { transform: translateX(-100%); }
29+
66.67%, 100% { transform: translateX(-200%); }
30+
}
31+
32+
.slide {
33+
width: 100%;
34+
flex: 1 0 100%;
35+
}
36+
37+
.slide img {
38+
width: 100%;
39+
height: 100%;
40+
object-fit: contain;
41+
}
42+
43+
input[type="radio"] {
44+
display: none;
45+
}
46+
47+
.navigation {
48+
position: absolute;
49+
bottom: 15px;
50+
display: flex;
51+
justify-content: center;
52+
width: 100%;
53+
}
54+
55+
.navigation label {
56+
display: inline-block;
57+
width: 12px;
58+
height: 12px;
59+
margin: 0 6px;
60+
background: #ccc;
61+
border-radius: 50%;
62+
cursor: pointer;
63+
transition: background 0.3s;
64+
}
65+
66+
input[type="radio"]:checked + label {
67+
background: #333;
68+
}

0 commit comments

Comments
 (0)