Skip to content

Commit

Permalink
Merge pull request #65 from hana-maria/feature/hannah
Browse files Browse the repository at this point in the history
Time reactive ui #9
  • Loading branch information
vansh-codes authored Oct 9, 2024
2 parents a3964b1 + 6f0dc53 commit f14445d
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 1 deletion.
Binary file added assets/moon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/moon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChaosWeb - The Disorderly UI Experiment</title>
<link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" href="../assets/logo/favicon.ico" type="image/x-icon">

<link rel="shortcut icon" href="../assets/logo/favicon.ico" type="image/x-icon">

</head>
<body>
<!--ALL SVGs taken from https://undraw.co/-->
Expand Down Expand Up @@ -46,5 +48,6 @@ <h1 id="chaos-header">ChaosWeb - The Disorderly UI Experiment</h1>
</div>

<script src="js/script.js"></script>
<script src="js/night_time.js" defer></script>
</body>
</html>
13 changes: 13 additions & 0 deletions js/night_time.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function redirectBasedOnTime() {
const currentHour = new Date().getHours();

if (currentHour >= 2 && currentHour < 5) {
window.location.href = 'night_time.html';
}
else {
window.location.href = 'index.html';
}
}
redirectBasedOnTime();
setTimeout(redirectBasedOnTime, 60000);

18 changes: 18 additions & 0 deletions night_time.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChaosWeb - The Disorderly UI Experiment</title>
<link rel="stylesheet" href="style1.css">

</head>
<body>
<div class="moon1">
<img src="assets/moon1.png" width="650px"></img>
</div>
<div class="text">Too late to reach us.</div>
<div class="text">Come back during daylight.</div>
</body>
<script src="js/night_time.js"></script>
</html>
40 changes: 40 additions & 0 deletions style1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
body {
padding: 0;
margin: 0;
background-color: darkslateblue;
font-family: Arial, Helvetica, sans-serif;
}

.moon1 {
display: flex;
justify-content: center;
cursor: pointer;
}

.moon1 img {
width: 650px;
transition: 0.3s ease;
}

.moon1 img:hover {
content: url(assets/moon2.png); /* This changes the image source on hover */
}

.text {
display: flex;
justify-content: center;
color: white;
font-size: 50px;
text-align: center;
animation: float 3s ease-in-out infinite; /* Apply floating animation */
}

/* Floating animation */
@keyframes float {
0%, 100% {
transform: translateY(0); /* Start and end position */
}
50% {
transform: translateY(-10px); /* Move up */
}
}

0 comments on commit f14445d

Please sign in to comment.