Changed around line 1
+
+
+
+
+ .clock {
+ position: relative;
+ width: 400px;
+ height: 400px;
+ border: 4px solid #e5e7eb;
+ border-radius: 50%;
+ margin: 20px auto;
+ }
+
+ .time-slot {
+ position: absolute;
+ width: 8px;
+ height: 8px;
+ background: #d1d5db;
+ border-radius: 50%;
+ cursor: pointer;
+ transform: translate(-50%, -50%);
+ transition: background-color 0.2s;
+ }
+
+ .time-slot:hover {
+ background: #60a5fa;
+ }
+
+ .time-slot.active {
+ background: #3b82f6;
+ }
+
+ .center-text {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ text-align: center;
+ color: #4b5563;
+ }
+
+ .alarm-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+ max-width: 400px;
+ margin: 20px auto;
+ }
+
+ .alarm-tag {
+ background: #dbeafe;
+ color: #1e40af;
+ padding: 4px 8px;
+ border-radius: 4px;
+ cursor: pointer;
+ }
+
+
+
+
+
+ const alarms = new Set();
+
+ function createTimeSlots() {
+ const clock = document.querySelector(".clock");
+
+ for (let hour = 0; hour < 24; hour++) {
+ for (let minute = 0; minute < 60; minute += 5) {
+ const angle = ((hour * 60 + minute) / (24 * 60)) * 360 - 90;
+ const radius = 184;
+ const x = 200 + radius * Math.cos((angle * Math.PI) / 180);
+ const y = 200 + radius * Math.sin((angle * Math.PI) / 180);
+
+ const timeSlot = document.createElement("div");
+ const time = `${hour.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}`;
+
+ timeSlot.className = "time-slot";
+ timeSlot.style.left = `${x}px`;
+ timeSlot.style.top = `${y}px`;
+ timeSlot.title = time;
+ timeSlot.onclick = () => toggleAlarm(time, timeSlot);
+
+ clock.appendChild(timeSlot);
+ }
+ }
+ }
+
+ function toggleAlarm(time, slot) {
+ if (alarms.has(time)) {
+ alarms.delete(time);
+ slot.classList.remove("active");
+ } else {
+ alarms.add(time);
+ slot.classList.add("active");
+ }
+ updateAlarmTags();
+ }
+
+ function updateAlarmTags() {
+ const container = document.getElementById("alarm-tags");
+ const countEl = document.getElementById("alarm-count");
+ container.innerHTML = "";
+ countEl.textContent = `${alarms.size} alarm${alarms.size !== 1 ? "s" : ""}`;
+
+ [...alarms].sort().forEach((time) => {
+ const tag = document.createElement("div");
+ tag.className = "alarm-tag";
+ tag.textContent = time;
+ tag.onclick = () => {
+ const slot = document.querySelector(`[title="${time}"]`);
+ toggleAlarm(time, slot);
+ };
+ container.appendChild(tag);
+ });
+ }
+
+ createTimeSlots();
+
+
+