-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracker.html
More file actions
178 lines (151 loc) · 6.61 KB
/
Copy pathtracker.html
File metadata and controls
178 lines (151 loc) · 6.61 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mini notepad - bln-c</title>
<link rel="stylesheet" href="css/styles.css">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<script src="js/sounds.js"></script>
</head>
<body>
<!-- Mobile nav toggle -->
<button id="nav-toggle" aria-label="Toggle navigation"><span></span><span></span><span></span></button>
<div id="nav-overlay"></div>
<header>
<h1>bln-c - mini notepad</h1>
</header>
<div class="container">
<aside>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="games.html">Catalogue</a></li>
<li><a href="tracker.html">mini notepad</a></li>
<li><a href="devlog.html">Devlog</a></li>
<li><a href="rate.html">Rate My Week</a></li>
<li><a href="wall.html">Sticky Wall</a></li>
<li><a href="messages.html">Messages</a></li>
<li><a href="gomoku.html">Gomoku</a></li>
<li><a href="rankings.html">Rankings</a></li>
<li><a href="showcase.html">showcase maker</a></li>
<br>
<li><a href="login.html">Login</a></li>
<li><a href="register.html">Registration</a></li>
</ul>
</nav>
<button id="theme-toggle">Toggle Monochrome</button>
</aside>
<main>
<h2>mini notepad</h2>
<p>write stuff, close it, done</p>
<div class="tracker-container">
<input type="text" id="tracker-input" placeholder="e.g., finished doing chores..">
<button id="add-achievement">Add</button>
<ul id="achievement-list"></ul>
</div>
<p id="tracker-note" style="color: #64748b; margin-top: 20px; font-size: 0.85rem;"></p>
</main>
</div>
<footer>
<p>© 2026 - CaziWorks - qobble</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<script src="js/supabase-config.js"></script>
<script src="js/script.js"></script>
<script src="js/radio.js"></script>
<script>
let currentUserId = null;
function renderItem(item) {
const li = document.createElement('li');
li.dataset.id = item.id;
li.innerHTML = `
<span>
<input type="checkbox" ${item.done ? 'checked' : ''}>
<span class="item-text" style="${item.done ? 'text-decoration: line-through; opacity: 0.5;' : ''}">${item.text}</span>
</span>
<button class="delete-btn">X</button>`;
li.querySelector('input[type=checkbox]').addEventListener('change', async (e) => {
const textEl = li.querySelector('.item-text');
textEl.style.cssText = e.target.checked
? 'text-decoration: line-through; opacity: 0.5;'
: '';
if (currentUserId) {
await sb.from('tracker_items').update({ done: e.target.checked }).eq('id', item.id);
}
});
li.querySelector('.delete-btn').addEventListener('click', async () => {
li.remove();
if (currentUserId) {
await sb.from('tracker_items').delete().eq('id', item.id);
}
});
return li;
}
(async () => {
const list = document.getElementById('achievement-list');
const inputEl = document.getElementById('tracker-input');
const addBtn = document.getElementById('add-achievement');
const noteEl = document.getElementById('tracker-note');
const { data: { session } } = await sb.auth.getSession();
if (session) {
currentUserId = session.user.id;
noteEl.textContent = '✓ Logged in — your notes are saved to the cloud.';
const { data: items } = await sb
.from('tracker_items')
.select('*')
.eq('user_id', currentUserId)
.order('created_at');
(items || []).forEach(item => list.appendChild(renderItem(item)));
} else {
noteEl.textContent = 'Not logged in — notes will disappear when you close the tab. Log in to save them.';
}
async function addItem() {
const text = inputEl.value.trim();
if (!text) return;
if (currentUserId) {
const { data: newItem } = await sb
.from('tracker_items')
.insert({ user_id: currentUserId, text, done: false })
.select()
.single();
if (newItem) list.appendChild(renderItem(newItem));
} else {
list.appendChild(renderItem({ id: Date.now(), text, done: false }));
}
inputEl.value = '';
}
addBtn.addEventListener('click', addItem);
inputEl.addEventListener('keydown', (e) => { if (e.key === 'Enter') addItem(); });
})();
</script>
<script>
(function () {
var toggle = document.getElementById('nav-toggle');
var overlay = document.getElementById('nav-overlay');
var sidebar = document.querySelector('aside');
if (!toggle || !sidebar) return;
function openNav() {
toggle.classList.add('open');
sidebar.classList.add('open');
overlay.classList.add('open');
document.body.style.overflow = 'hidden';
}
function closeNav() {
toggle.classList.remove('open');
sidebar.classList.remove('open');
overlay.classList.remove('open');
document.body.style.overflow = '';
}
toggle.addEventListener('click', function () {
sidebar.classList.contains('open') ? closeNav() : openNav();
});
overlay.addEventListener('click', closeNav);
// Close sidebar when any nav link is tapped
sidebar.querySelectorAll('a').forEach(function (a) {
a.addEventListener('click', closeNav);
});
})();
</script>
</body>
</html>