Update index.html
Browse files- index.html +26 -32
index.html
CHANGED
|
@@ -2,46 +2,40 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<title>
|
| 6 |
<style>
|
| 7 |
-
body { font-family:
|
| 8 |
-
#time { font-weight: bold; margin-bottom: 20px; }
|
| 9 |
ul { list-style-type: none; padding: 0; }
|
| 10 |
-
li { margin:
|
| 11 |
-
.age { color:
|
| 12 |
-
.month { color:
|
| 13 |
-
.day { color:
|
| 14 |
</style>
|
| 15 |
</head>
|
| 16 |
<body>
|
| 17 |
|
| 18 |
-
<
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
<script>
|
| 22 |
-
//
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
const ages = [22, 25, 30];
|
| 40 |
-
const ul = document.getElementById("ageList");
|
| 41 |
-
|
| 42 |
-
ages.forEach(age => {
|
| 43 |
-
const li = document.createElement("li");
|
| 44 |
-
li.innerHTML = `<span class='age'>${age}</span><span class='month'>${month}</span> <span class='day'>${day}</span>`;
|
| 45 |
ul.appendChild(li);
|
| 46 |
});
|
| 47 |
</script>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
+
<title>Future Dates</title>
|
| 6 |
<style>
|
| 7 |
+
body { font-family: sans-serif; padding: 20px; }
|
|
|
|
| 8 |
ul { list-style-type: none; padding: 0; }
|
| 9 |
+
li { margin: 10px 0; padding: 10px; border: 1px solid #ccc; border-radius: 6px; width: fit-content; }
|
| 10 |
+
.age { font-weight: bold; color: #333; margin-right: 10px; }
|
| 11 |
+
.month { color: #0077cc; margin-right: 5px; }
|
| 12 |
+
.day { color: #cc5500; }
|
| 13 |
</style>
|
| 14 |
</head>
|
| 15 |
<body>
|
| 16 |
|
| 17 |
+
<ul id="date-list">
|
| 18 |
+
<!-- Dates will be added here -->
|
| 19 |
+
</ul>
|
| 20 |
|
| 21 |
<script>
|
| 22 |
+
const offsets = [8, 15, 30]; // Days to add
|
| 23 |
+
const ul = document.getElementById("date-list");
|
| 24 |
+
|
| 25 |
+
offsets.forEach(offset => {
|
| 26 |
+
const target = new Date();
|
| 27 |
+
target.setDate(target.getDate() + offset);
|
| 28 |
+
|
| 29 |
+
const month = target.toLocaleString('default', { month: 'short' });
|
| 30 |
+
const day = String(target.getDate());
|
| 31 |
+
|
| 32 |
+
const li = document.createElement('li');
|
| 33 |
+
li.setAttribute('data-offset', offset);
|
| 34 |
+
li.innerHTML = `
|
| 35 |
+
<span class="age">+${offset}</span>
|
| 36 |
+
<span class="month">${month}</span>
|
| 37 |
+
<span class="day">${day}</span>
|
| 38 |
+
`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
ul.appendChild(li);
|
| 40 |
});
|
| 41 |
</script>
|