-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
117 lines (114 loc) · 3.6 KB
/
index.html
File metadata and controls
117 lines (114 loc) · 3.6 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Custom Homepage</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 20px;
}
h1 {
color: #333;
}
#clock {
font-size: 24px;
margin-bottom: 20px;
}
#greeting {
font-size: 18px;
margin-bottom: 20px;
}
#bookmarks {
margin-bottom: 20px;
}
#year-progress {
margin-bottom: 20px;
background-color: #ddd;
border-radius: 5px;
overflow: hidden;
}
#year-progress-bar {
height: 20px;
background-color: #76c7c0;
width: 0%;
transition: width 0.3s;
}
#todo {
margin-top: 20px;
}
#todo-list {
list-style-type: none;
padding: 0;
}
#todo-list li {
background: #fff;
padding: 10px;
margin-bottom: 5px;
border-radius: 5px;
}
input[type="text"] {
width: 200px;
padding: 5px;
}
button {
padding: 5px 10px;
}
</style>
</head>
<body>
<div id="clock"></div>
<div id="greeting">Hello, Nemi!</div>
<div id="bookmarks">
<h2>Bookmarks</h2>
<ul>
<li><a href="https://www.google.com" target="_blank">Google</a></li>
<li><a href="https://www.wikipedia.org" target="_blank">Wikipedia</a></li>
<li><a href="https://www.youtube.com" target="_blank">YouTube</a></li>
</ul>
</div>
<div id="year-progress">
<div id="year-progress-bar"></div>
</div>
<div id="todo">
<h2>To-Do List</h2>
<input type="text" id="todo-input" placeholder="Add a new task...">
<button onclick="addTodo()">Add</button>
<ul id="todo-list"></ul>
</div>
<script>
// Clock Widget
function updateClock() {
const now = new Date();
const options = { hour: '2-digit', minute: '2-digit', second: '2-digit' };
document.getElementById('clock').innerHTML = now.toLocaleTimeString([], options);
}
setInterval(updateClock, 1000);
updateClock();
// Year Progress Percentage Bar
function updateYearProgress() {
const startOfYear = new Date(new Date().getFullYear(), 0, 1);
const endOfYear = new Date(new Date().getFullYear() + 1, 0, 1);
const totalDays = (endOfYear - startOfYear) / (1000 * 60 * 60 * 24);
const currentDays = (new Date() - startOfYear) / (1000 * 60 * 60 * 24);
const progress = (currentDays / totalDays) * 100;
document.getElementById('year-progress-bar').style.width = progress + '%';
}
updateYearProgress();
// To-Do List
function addTodo() {
const input = document.getElementById('todo-input');
const newTodo = input.value.trim();
if (newTodo) {
const li = document.createElement('li');
li.textContent = newTodo;
document.getElementById('todo-list').appendChild(li);
input.value = ''; // Clear input
}
}
</script>
</body>
</html>