-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
99 lines (95 loc) · 3.39 KB
/
index.html
File metadata and controls
99 lines (95 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Minecraft for Education</title>
<style>
.hint-button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
.carousel-container {
width: 80%;
max-width: 600px;
margin: 20px auto;
position: relative;
overflow: hidden;
border: 1px solid #ccc;
border-radius: 8px;
display: none;
}
.carousel-content {
display: flex;
transition: transform 0.3s ease;
}
.carousel-item {
min-width: 100%;
padding: 20px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.carousel-item img {
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
.scroll-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0,0,0,0.5);
color: white;
border: none;
padding: 10px 15px;
cursor: pointer;
font-size: 18px;
}
.scroll-btn.left { left: 10px; }
.scroll-btn.right { right: 10px; }
</style>
</head>
<body>
<button class="hint-button" onclick="toggleHint()">I need a hint</button>
<div class="carousel-container" id="carouselContainer">
<div class="carousel-content" id="carouselContent">
<div class="carousel-item">
<img src="https://i.makeagif.com/media/3-04-2016/LTa2PT.gif" alt="Placeholder Image 1">
<p>This is your first hint with an image!</p>
</div>
<div class="carousel-item">
<img src="https://via.placeholder.com/300x200?text=Image+2" alt="Placeholder Image 2">
<p>Here's a second hint with another image.</p>
</div>
<div class="carousel-item">
<img src="https://via.placeholder.com/300x200?text=Image+3" alt="Placeholder Image 3">
<p>And a third hint if you need more help.</p>
</div>
</div>
<button class="scroll-btn left" onclick="scrollCarousel(-1)">←</button>
<button class="scroll-btn right" onclick="scrollCarousel(1)">→</button>
<script>
let currentItem = 0;
const carouselContent = document.getElementById("carouselContent");
const items = document.querySelectorAll(".carousel-item");
const carouselContainer = document.getElementById("carouselContainer");
function toggleHint() {
if (carouselContainer.style.display === "none" || carouselContainer.style.display === "") {
carouselContainer.style.display = "block";
} else {
carouselContainer.style.display = "none";
}
}
function scrollCarousel(direction) {
currentItem += direction;
if (currentItem < 0) currentItem = items.length - 1;
if (currentItem >= items.length) currentItem = 0;
carouselContent.style.transform = `translateX(-${currentItem * 100}%)`;
}
</script>
</body>
</html>