Skip to content

Commit 5becc0b

Browse files
author
ShinniUwU
committed
Fixed a lot of stuffies :3
Switched to luxon instead of using Mytimenow's script, Fixed site's readability, Removed unsued css stuff
1 parent 1213522 commit 5becc0b

File tree

4 files changed

+497
-62
lines changed

4 files changed

+497
-62
lines changed

css.css

+31-54
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,46 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Raleway&display=swap');
2-
31
body {
4-
background-color: #fbdceb;
2+
background-color: #f8c5d0;
53
color: #333;
6-
font-family: 'Raleway', sans-serif;
7-
font-size: 16px; /* Increase font size for better readability */
4+
font-size: 16px;
5+
line-height: 1.6;
86
}
7+
98
h1 {
109
margin-top: 20px;
11-
font-size: 24px; /* Increase font size for headings */
10+
font-size: 24px;
1211
}
1312

1413
* {
1514
text-align: center;
16-
color: white;
17-
font-family: 'Raleway', sans-serif;
15+
color: #333;
16+
font-family: 'Proxima Nova', Georgia, sans-serif;
1817
font-weight: bolder;
19-
animation: glow 1.5s ease-in-out infinite alternate; /* Add the glow animation to all text elements */
20-
}
21-
@keyframes glow {
22-
to {
23-
text-shadow: none;
24-
}
25-
}
26-
27-
a {
28-
visibility: hidden;
29-
}
30-
31-
div.embed-clock-copyright {
32-
background-color: transparent !important;
3318
}
3419

3520
table {
3621
display: inline;
22+
font-size: 18px; /* Increased font size for better visibility */
3723
}
3824

3925
#hrt {
4026
font-size: 18px;
41-
margin-top: 20px; /* Add more spacing between sections */
27+
margin-top: 20px;
4228
}
4329

44-
4530
#img1 {
4631
width: 200px;
4732
height: 200px;
4833
border-radius: 20px;
49-
margin-top: 20px; /* Add more spacing between sections */
34+
margin-top: 20px;
5035
}
36+
5137
img {
52-
width: 100%; /* Ensure images are responsive */
38+
width: 100%;
5339
height: auto;
5440
border-radius: 10px;
5541
transition: transform 0.3s ease-in-out;
5642
}
5743

58-
5944
img:hover {
6045
transform: scale(1.1);
6146
}
@@ -75,37 +60,21 @@ img:hover {
7560
margin-top: 20px;
7661
}
7762

78-
#birthdayTime {
63+
#birthdayTime, #datingTime {
7964
font-size: 18px;
8065
margin-top: 10px;
8166
}
82-
#datingTime {
83-
font-size: 18px;
84-
margin-top: 20px; /* Add more spacing between sections */
85-
}
86-
8767

8868
.img {
8969
margin-top: 20px;
9070
}
9171

92-
.ttn-thetimenow-clock {
93-
color: white !important;
94-
}
95-
96-
.ttn-thetimenow-clock-date {
97-
font-size: 24px !important;
98-
}
99-
100-
.info {
101-
font-size: 16px; /* Maintain consistent font size for information */
102-
margin-top: 10px;
103-
}
10472
.countdownContainer {
105-
margin: 0 auto; /* Center the countdown table */
73+
margin: 0 auto;
10674
}
75+
10776
.countdownContainer td {
108-
padding: 5px 10px; /* Add padding to table cells */
77+
padding: 5px 10px;
10978
}
11079

11180
.gif-container {
@@ -130,16 +99,24 @@ img:hover {
13099
height: 80px;
131100
margin: 5px;
132101
border-radius: 10px;
133-
animation: slideDown 0.5s ease-in-out forwards; /* Apply slideDown animation */
134-
}
135-
102+
animation: slideDown 0.5s ease-in-out forwards;
103+
}
136104

137-
/* Add animation for sliding down */
138105
@keyframes slideDown {
139106
0% {
140-
transform: translateY(-100%);
107+
transform: translateY(-100%);
141108
}
142109
100% {
143-
transform: translateY(0);
110+
transform: translateY(0);
144111
}
145-
}
112+
}
113+
img {
114+
width: 100%;
115+
height: auto;
116+
border-radius: 10px;
117+
transition: transform 0.3s ease-in-out;
118+
}
119+
120+
img:hover {
121+
transform: scale(1.1);
122+
}

index.html

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>HRT & BDAY COUNTER</title>
77
<link rel="stylesheet" href="css.css">
8-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
9-
8+
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/3.4.4/luxon.min.js" integrity="sha512-dUlSLLkxslGILhPdCkALwk4szPhp3xmZIKFtlUD+O9Lslq41Aksmdt5OGqpomDoT4FsCUH70jQU8ezZHI3v1RQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
109
<link rel="icon" type="image/x-icon" href="https://i.ibb.co/MVByQfj/27133-removebg-preview.png">
1110
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
1211
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
12+
<link rel="stylesheet" type="text/css" href="fonts/fonts.min.css" />
1313
</head>
1414
<body data-aos="fade-up" data-aos-duration="500">
1515
<header>
16-
<h1>The current time and day for me right now:</h1>
17-
<div class="thetimenow-embeddable-clock" data-type="clock" data-font-color="#000000" data-border-color="transperent" data-background-color="transperent" data-font-size="60" data-location-type="country" data-location-id="188">
18-
<a href="https://www.thetimenow.com/bulgaria" rel="nofollow" target="_blank">© The Time Now</a>
19-
</div>
20-
<script type="text/javascript" src="https://www.thetimenow.com/ttn-embed.min.js"></script>
21-
16+
<h1>The current time and day for me right now:</h1>
2217
</header>
2318
<main>
2419

js.js

+46
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,52 @@ document.addEventListener('DOMContentLoaded', function () {
2323
let buttonClicked = false; // Variable to track button click
2424
let gifCount = 0; // Variable to track the number of displayed GIFs
2525

26+
27+
28+
let currentTimestamp = luxon.DateTime.local().setZone("Europe/Sofia").toMillis();
29+
30+
function updateTime() {
31+
// Get the current time in Bulgaria
32+
const bulgariaTime = luxon.DateTime.now().setZone("Europe/Sofia");
33+
34+
// Format the time in AM/PM format
35+
const formattedTime = bulgariaTime.toLocaleString({
36+
hour: 'numeric',
37+
minute: '2-digit',
38+
hour12: true
39+
});
40+
41+
// Get the existing time element or create a new one if it doesn't exist
42+
let timeElement = document.getElementById('formattedTime');
43+
if (!timeElement) {
44+
timeElement = document.createElement('div');
45+
timeElement.id = 'formattedTime';
46+
timeElement.style.marginTop = '20px'; // Add spacing below h1
47+
timeElement.style.fontSize = '54px'; // Set the font size
48+
// Get the header element
49+
const header = document.querySelector('header');
50+
// Insert the formatted time element after the h1 within the header
51+
header.insertBefore(timeElement, header.children[1]); // Insert after the h1
52+
}
53+
54+
// Set the text content of the time element to the formatted time
55+
timeElement.textContent = `${formattedTime}`;
56+
57+
// Schedule the next update
58+
scheduleNextUpdate();
59+
}
60+
61+
function scheduleNextUpdate() {
62+
const newTimestamp = luxon.DateTime.local().setZone("Europe/Sofia").toMillis();
63+
const timeDifference = newTimestamp - currentTimestamp;
64+
currentTimestamp = newTimestamp;
65+
setTimeout(updateTime, timeDifference);
66+
}
67+
68+
// Call updateTime initially to set the time
69+
updateTime();
70+
71+
2672
function countdown() {
2773
const now = new Date();
2874

0 commit comments

Comments
 (0)