generated from skills/introduction-to-github
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrials.html
147 lines (136 loc) · 4.34 KB
/
trials.html
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Menu</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-image: url("images/pexels-pixabay-262978.jpg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
padding: 75px;
text-align: center;
color: white;
}
header h1 {
font-family: 'Italianno', cursive;
font-size: 3rem;
margin: 0;
}
.menu {
margin: 20px;
}
.maindiv {
background-color: rgb(234, 234, 226);
border-radius: 5px;
margin: 20px 0;
padding: 20px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 20px;
opacity: 0; /* Initially hidden */
transform: translateX(-100%); /* Start off-screen to the left */
transition: all 0.5s ease-in-out; /* Smooth transition */
}
.maindiv.visible {
opacity: 1; /* Fully visible */
transform: translateX(0); /* Slide into place */
}
.suddiv {
background-color: rgb(106, 110, 114);
border-radius: 10px;
text-align: center;
padding: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
transition: transform 0.3s ease-in-out;
}
.suddiv:hover {
transform: scale(1.05);
}
.suddiv img {
width: 100%;
height: 150px;
object-fit: cover;
border-radius: 10px;
}
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px;
}
</style>
</head>
<body>
<header>
<h1>Menu - Mambo Yote Restaurant</h1>
</header>
<section class="menu">
<div class="maindiv">
<div class="suddiv">
<img src="images/pexels-the-castlebar-3902897-19107222.jpg" alt="Breakfast Item">
<h3>Breakfast Item</h3>
<p>Price: $9.99</p>
</div>
<div class="suddiv">
<img src="images/pexels-the-castlebar-3902897-19107222.jpg" alt="Breakfast Item">
<h3>Breakfast Item</h3>
<p>Price: $12.99</p>
</div>
<div class="suddiv">
<img src="images/pexels-the-castlebar-3902897-19107222.jpg" alt="Breakfast Item">
<h3>Breakfast Item</h3>
<p>Price: $8.99</p>
</div>
</div>
<div class="maindiv">
<div class="suddiv">
<img src="images/pexels-the-castlebar-3902897-19107222.jpg" alt="Lunch Item">
<h3>Lunch Item</h3>
<p>Price: $15.99</p>
</div>
<div class="suddiv">
<img src="images/pexels-the-castlebar-3902897-19107222.jpg" alt="Lunch Item">
<h3>Lunch Item</h3>
<p>Price: $13.99</p>
</div>
<div class="suddiv">
<img src="images/pexels-the-castlebar-3902897-19107222.jpg" alt="Lunch Item">
<h3>Lunch Item</h3>
<p>Price: $14.99</p>
</div>
</div>
</section>
<footer>
<p>© 2025 Mambo Yote Restaurant. All rights reserved.</p>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
function isInViewport(element) {
const rect = element.getBoundingClientRect();
return (
rect.top < window.innerHeight && rect.bottom > 0
);
}
const handleScroll = () => {
const maindivs = document.querySelectorAll('.maindiv');
maindivs.forEach(maindiv => {
if (isInViewport(maindiv)) {
maindiv.classList.add('visible');
}
});
};
document.addEventListener('scroll', handleScroll);
handleScroll(); // Trigger on page load in case elements are already in view
});
</script>
</body>
</html>