-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout.html
265 lines (224 loc) · 10.6 KB
/
about.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About Us</title>
<link rel="icon" href="logo black.png" type="image/x-icon">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Honk&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
</head>
<style>
body {
height: 200vh;
width: 100vw;
background-color: black;
margin: 0;
overflow-x: hidden;
cursor: none;
}
#title {
position: relative;
top: 125px;
left: -65%;
font-size: 6.5rem;
color: white;
transition: transform 0.5s ease;
font-family: "Playfair Display",serif;
font-optical-sizing: auto;
font-style: normal;
display: flex;
justify-content: baseline;
gap:50vh;
align-items: center;
}
#image-track {
display: flex;
gap: 4vmin;
position: absolute;
left: 2%;
top: calc(50% + 250px);
transform: translate(0%, -50%);
user-select: none;
}
#image-track > .image {
width: 40vmin;
height: 56vmin;
object-fit: cover;
object-position: 100% center;
filter: brightness(50%);
transition: filter 0.3s ease;
}
#image-track > .image:hover {
filter: brightness(100%);
}
#about-us {
position: absolute;
top: calc(50% + 500px);
color: white;
font-family: "Poppins", sans-serif;
padding: 20px;
margin-left: -200px;
right: 100px;
max-width: 800px;
margin: 30px auto;
line-height: 1.6;
transition: transform 0.5s ease, font-size 0.5s ease;
transform: translateX(-200%);
font-size: 2rem;
}
#about-us.active {
transform: translateX(-25%);
font-size: 4rem;
}
#about-us h2 {
font-family: "Poppins", sans-serif;
font-size: 2rem;
margin-top: 20px;
}
#about-us p {
font-size: 1.2rem;
}
#about-us ul {
list-style: disc;
padding-left: 20px;
}
#about-us ul li {
font-size: 1.2rem;
}
.custom-cursor {
width: 30px;
height: 30px;
background-color: white;
border-radius: 50%;
position: absolute;
pointer-events: none;
transform: scale(0);
transition: transform 0.2s ease;
}
.custom-cursor.active {
transform: scale(1);
}
a{
text-decoration: none;
color: inherit;
transition: 0.5s;
}
a:hover{
color: bisque;
}
</style>
<body>
<div id="title">About Us
<a href="menu.html" style="font-size: 40px;">Menu</a>
</div>
<div id="image-track" data-mouse-down-at="0" data-prev-percentage="0">
<img class="image" src="https://images.unsplash.com/photo-1519955266818-0231b63402bc?q=80&w=1770&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" draggable="false" />
<img class="image" src="https://images.unsplash.com/photo-1484318571209-661cf29a69c3?q=80&w=1770&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" draggable="false" />
<img class="image" src="https://i.pinimg.com/736x/95/85/30/958530d4edfb1dd0ac0adf06da26c15f.jpg" draggable="false" />
<img class="image" src="https://media.istockphoto.com/id/1186330177/photo/south-indian-traditional-meal.jpg?s=612x612&w=0&k=20&c=NDF5jgsgmWU-sLsiIsOILf4v6J6bN2Ushgkg-72P0vc=" draggable="false" />
<img class="image" src="https://i.pinimg.com/736x/4f/11/fb/4f11fb991d01ce3b0cb942703df03d89.jpg" draggable="false" />
<img class="image" src="https://i.pinimg.com/736x/52/32/59/523259e16e4b6514cf9ceed30fa8401e.jpg" draggable="false" />
<img class="image" src="https://images.unsplash.com/photo-1615196451843-54c40a46d1e9?q=80&w=1771&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" draggable="false" />
<img class="image" src="https://plus.unsplash.com/premium_photo-1671490809136-ef694acc76d2?q=80&w=1932&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" draggable="false" />
</div>
<div id="about-us">
<h2>Welcome to भारत | The Jewels Of India</h2>
<p>Your ultimate guide to discovering the hidden gems of India. We are your gateway to discovering the enchanting, less-trodden paths of this incredible country, providing you with unique travel experiences far from the usual crowded spots.</p>
<h2>Who Are We?</h2>
<p>We are a team of passionate travelers, explorers, and storytellers who believe that every corner of India has a story to tell. Our story started with a quest to uncover India's secret wonders and share their beauty with the world. From secluded mountain villages and pristine beaches to ancient towns and undiscovered natural marvels, we are here to ignite your spirit of adventure.</p>
<h2>Our Vision</h2>
<p>We envision a world where travelers go beyond the usual routes and explore the uncharted territories. We aim to create a community of explorers who appreciate the beauty of offbeat destinations, contributing to sustainable tourism and supporting local communities.</p>
<h2>What We Offer</h2>
<ul>
<li><strong>Immersive Guides:</strong> Dive deep into the history, culture, and beauty of lesser-known destinations through our meticulously crafted guides.</li>
<li><strong>Expert Travel Tips:</strong> Navigate your adventures with confidence using our practical travel tips, from the best times to visit to insider advice on local customs and transport.</li>
<li><strong>Inspirational Stories:</strong> Get inspired by the captivating travelogues and personal experiences of fellow explorers who have ventured into India's hidden gems.</li>
<li><strong>Sustainable Travel Insights:</strong> Learn how to travel responsibly, leaving a positive impact on the communities and environments you encounter.</li>
</ul>
<h2>Join Us</h2>
<p>Whether you're an avid traveler or someone looking for a unique getaway, We are here to help you explore the unexplored. Together, let's unveil the hidden wonders of India and create stories that last a lifetime.</p>
</div>
<div class="custom-cursor" id="custom-cursor"></div>
<script>
const title = document.getElementById("title");
const track = document.getElementById("image-track");
const customCursor = document.getElementById("custom-cursor");
const handleOnDown = e => track.dataset.mouseDownAt = e.clientX;
const handleOnUp = () => {
track.dataset.mouseDownAt = "0";
track.dataset.prevPercentage = track.dataset.percentage;
}
const handleOnMove = e => {
if(track.dataset.mouseDownAt === "0") return;
const mouseDelta = parseFloat(track.dataset.mouseDownAt) - e.clientX,
maxDelta = window.innerWidth / 2;
const percentage = (mouseDelta / maxDelta) * -100,
nextPercentageUnconstrained = parseFloat(track.dataset.prevPercentage) + percentage;
// Calculate the max percentage value to prevent over-scrolling
const imageWidthVmin = 40; // width in vmin
const imageGapVmin = 4; // gap in vmin
const totalImages = 8;
const additionalMarginPx = 27; // additional margin in pixels
const viewportWidthVmin = (window.innerWidth / window.innerHeight) * 100;
const trackWidthVmin = (imageWidthVmin + imageGapVmin) * totalImages - imageGapVmin;
// Convert additional margin from pixels to vmin
const additionalMarginVmin = additionalMarginPx * (window.innerHeight / window.innerWidth);
// Max percentage calculation
const maxPercentage = -((trackWidthVmin - viewportWidthVmin) / trackWidthVmin) * 100 - (additionalMarginVmin / trackWidthVmin) * 100;
const constrainedPercentage = Math.max(Math.min(nextPercentageUnconstrained, 0), maxPercentage);
track.dataset.percentage = constrainedPercentage;
track.animate({
transform: `translate(${constrainedPercentage}%, -50%)`
}, { duration: 1200, fill: "forwards" });
for(const image of track.getElementsByClassName("image")) {
image.animate({
objectPosition: `${100 + constrainedPercentage}% center`
}, { duration: 1200, fill: "forwards" });
}
}
window.onmousedown = e => handleOnDown(e);
window.ontouchstart = e => handleOnDown(e.touches[0]);
window.onmouseup = e => handleOnUp(e);
window.ontouchend = e => handleOnUp(e.touches[0]);
window.onmousemove = e => handleOnMove(e);
window.ontouchmove = e => handleOnMove(e.touches[0]);
const aboutUs = document.getElementById("about-us");
const handleScroll = () => {
const scrollPosition = window.scrollY;
const aboutUsPosition = aboutUs.offsetTop;
if (scrollPosition >= aboutUsPosition - window.innerHeight / 2) {
aboutUs.classList.add("active");
} else {
aboutUs.classList.remove("active");
}
};
window.addEventListener("scroll", handleScroll);
document.querySelectorAll('.image').forEach(image => {
image.addEventListener('mouseenter', () => {
customCursor.classList.add('active');
document.body.style.cursor = 'none';
});
image.addEventListener('mouseleave', () => {
customCursor.classList.remove('active');
document.body.style.cursor = 'auto';
});
image.addEventListener('mousemove', (e) => {
customCursor.style.left = `${e.pageX}px`;
customCursor.style.top = `${e.pageY}px`;
});
});
window.addEventListener('mousemove', (e) => {
if (!e.target.classList.contains('image')) {
customCursor.classList.remove('active');
document.body.style.cursor = 'auto';
}
});
title.style.transform = `translateX(100vw)`;
</script>
</body>
</html>