-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
60 lines (55 loc) · 1.61 KB
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logo Preloader Example</title>
<style>
/* Preloader styling */
#preloader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #ffffff; /* White background */
display: flex;
justify-content: center;
align-items: center;
z-index: 9999; /* Ensure it overlays everything */
}
/* Logo styling */
#logo {
width: 150px; /* Adjust size as needed */
filter: grayscale(100%);
transition: filter 5s ease-in-out; /* Smooth transition for color */
}
</style>
</head>
<body>
<!-- Preloader Section -->
<div id="preloader">
<img src="assets/img/Emran_Ali_Logo_Icon.png" alt="Logo" id="logo">
</div>
<!-- Main Content -->
<div style="display: none;" id="main-content">
<h1>Welcome to My Website</h1>
<p>Your main content goes here...</p>
</div>
<script>
// JavaScript to handle the preloader
window.addEventListener("load", () => {
const logo = document.getElementById("logo");
const preloader = document.getElementById("preloader");
const mainContent = document.getElementById("main-content");
// Transition to full color
logo.style.filter = "grayscale(0%)";
// Hide preloader after the animation
setTimeout(() => {
preloader.style.display = "none";
mainContent.style.display = "block";
}, 5000); // Match this duration with the CSS transition
});
</script>
</body>
</html>