-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
366 lines (324 loc) · 12.5 KB
/
index.html
File metadata and controls
366 lines (324 loc) · 12.5 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Trinity.css Demo Desktop</title>
<link rel="stylesheet" href="Trinity.css">
<style>
/* Ensure .window is absolutely positioned for drag and drop */
.window {
position: absolute;
/* Initial positioning for demo */
top: 50px;
left: 50%;
transform: translateX(-50%);
margin: 0;
/* Override default margin */
}
.window:nth-of-type(2) {
top: 150px;
left: 60%;
}
</style>
</head>
<body class="desktop-mode">
<div class="desktop" id="desktop-area">
<div class="desktop-icon" style="top: 20px; left: 20px;">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7PTLSwAAAAk1BMVEUAAAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gACi/6K4AAAAO3RSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2NzlP/wT9AAAAAWJLR0QAiAUdSAAAAAlwSFlzAA,
width: 100%;
height: 100%;
" alt="My Computer icon">
<span>My Computer</span>
</div>
<div class="desktop-icon" style="top: 100px; left: 100px;">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7PTLSwAAAAmVBMVEUAAAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gAD/gACb9yH7AAAAO3RSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2NzlP/wT9AAAAAWJLR0QAiAUdSAAAAAlwSFlzAA,
width: 100%;
height: 100%;
" alt="Recycle Bin icon">
<span>Recycle Bin</span>
</div>
<!-- Existing Window adapted for desktop mode -->
<div class="window" id="my-window-1">
<div class="title-bar">
<div class="title-bar-text">My Trinity Window</div>
<div class="title-bar-controls">
<button aria-label="Minimize"></button>
<button aria-label="Maximize"></button>
<button aria-label="Close"></button>
</div>
</div>
<div class="window-body">
<ul class="menu-bar">
<li class="has-dropdown">
<u>F</u>ile
<ul class="dropdown">
<li><u>N</u>ew</li>
<li><u>O</u>pen...</li>
<li class="separator"></li>
<li><u>S</u>ave</li>
<li>Save <u>A</u>s...</li>
<li class="separator"></li>
<li><u>E</u>xit</li>
</ul>
</li>
<li><u>E</u>dit</li>
<li><u>V</u>iew</li>
<li><u>H</u>elp</li>
<li><a href="../index.html" style="color: inherit; text-decoration: none;">Home</a></li>
</ul>
<div class="content-area">
<div class="alert alert-info">This is an **info** alert message.</div>
<div class="tab-container">
<ul class="tab-list">
<li class="active">General</li>
<li>Details</li>
<li>Advanced</li>
</ul>
<div class="tab-content">
<p>This is the content of the General tab.</p>
<div class="field-row-stacked">
<label for="progress-bar">Progress:</label>
<div class="progress-bar" id="progress-bar">
<div style="width: 60%;"></div>
</div>
</div>
</div>
</div>
<p>Here are some of the available controls:</p>
<div class="card">
<fieldset class="group-box">
<legend>Input Controls</legend>
<div class="field-row">
<label for="text-input">Text Input:</label>
<input id="text-input" type="text" value="Hello World">
</div>
<div class="field-row-stacked">
<label for="textarea-field">Textarea:</label>
<textarea id="textarea-field">This is a multiline text area.</textarea>
</div>
</fieldset>
</div>
<fieldset class="group-box">
<legend>List View</legend>
<ul class="list-view">
<li class="list-header">
<span>Name</span>
<span>Type</span>
<span>Size</span>
</li>
<li>
<span>📄 document.txt</span>
<span>Text File</span>
<span>12 KB</span>
</li>
<li class="active">
<span>🖼️ image.png</span>
<span>PNG Image</span>
<span>128 KB</span>
</li>
<li>
<span>📁 assets</span>
<span>Folder</span>
<span>-</span>
</li>
<li>
<span>🎵 music.mp3</span>
<span>MP3 Audio</span>
<span>4.2 MB</span>
</li>
</ul>
</fieldset>
<div class="accordion-item">
<div class="accordion-header">Accordion Section 1</div>
<div class="accordion-content">
<p>Content for accordion section 1. This can contain any HTML elements.</p>
<button>Inside Accordion Button</button>
</div>
</div>
<div class="accordion-item">
<div class="accordion-header">Accordion Section 2</div>
<div class="accordion-content">
<p>Content for accordion section 2.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</div>
</div>
<fieldset class="group-box">
<legend>Options</legend>
<div class="field-row">
<input id="checkbox1" type="checkbox" checked>
<label for="checkbox1">Checkbox Option 1</label>
</div>
<div class="field-row">
<label for="slider">Slider:</label>
<input type="range" id="slider" min="0" max="100" value="75">
</div>
</fieldset>
<div class="field-row" style="justify-content: flex-end; margin-top: 15px;">
<button data-tooltip="Saves all changes and closes the window.">OK</button>
<button>Cancel</button>
</div>
<div class="field-row" style="justify-content: flex-end; margin-top: 15px;">
<button id="show-dialog-btn">Show Dialog</button>
<button id="show-toast-btn">Show Toast</button>
<button id="show-spinner-btn">Show Spinner</button>
</div>
</div>
<div class="status-bar">
<p class="status-bar-field">Ready</p>
<p class="status-bar-field">CAPS</p>
</div>
</div>
</div>
<!-- Another Window for demo -->
<div class="window" id="my-window-2" style="width: 300px; height: 200px;">
<div class="title-bar">
<div class="title-bar-text">Another Window</div>
<div class="title-bar-controls">
<button aria-label="Minimize"></button>
<button aria-label="Maximize"></button>
<button aria-label="Close"></button>
</div>
</div>
<div class="window-body">
<div class="content-area">
<p>This is a second window, which can also be moved.</p>
<button>Click Me</button>
</div>
</div>
</div>
</div> <!-- End of .desktop -->
<div class="taskbar">
<button class="taskbar-start-button">Start</button>
<div class="taskbar-item active">My Trinity Window</div>
<div class="taskbar-item">Another Window</div>
</div>
<!-- Dialog Box -->
<div class="overlay" id="dialog-overlay">
<div class="window dialog">
<div class="title-bar">
<div class="title-bar-text">About Trinity.css</div>
<div class="title-bar-controls">
<button aria-label="Close" id="dialog-close-btn-title"></button>
</div>
</div>
<div class="window-body">
<p>This is a demonstration of Trinity.css, a CSS framework inspired by the Trinity Desktop Environment.</p>
<div class="field-row" style="justify-content: center; margin-top: 15px;">
<button id="dialog-close-btn">Close</button>
</div>
</div>
</div>
</div>
<!-- Notification Toast -->
<div class="toast" id="my-toast">
<p>Operation completed successfully!</p>
</div>
<!-- Spinner -->
<div class="spinner" id="my-spinner">
<div class="spinner-inner"></div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Dialog, Toast, Spinner functionality (existing)
const dialogOverlay = document.getElementById('dialog-overlay');
const showDialogBtn = document.getElementById('show-dialog-btn');
const dialogCloseBtn = document.getElementById('dialog-close-btn');
const dialogCloseBtnTitle = document.getElementById('dialog-close-btn-title');
const myToast = document.getElementById('my-toast');
const showToastBtn = document.getElementById('show-toast-btn');
const mySpinner = document.getElementById('my-spinner');
const showSpinnerBtn = document.getElementById('show-spinner-btn');
if (showDialogBtn) {
showDialogBtn.addEventListener('click', () => {
dialogOverlay.classList.add('visible');
});
}
if (dialogCloseBtn) {
dialogCloseBtn.addEventListener('click', () => {
dialogOverlay.classList.remove('visible');
});
}
if (dialogCloseBtnTitle) {
dialogCloseBtnTitle.addEventListener('click', () => {
dialogOverlay.classList.remove('visible');
});
}
if (showToastBtn) {
showToastBtn.addEventListener('click', () => {
myToast.classList.add('visible');
setTimeout(() => {
myToast.classList.remove('visible');
}, 3000); // Hide after 3 seconds
});
}
if (showSpinnerBtn) {
showSpinnerBtn.addEventListener('click', () => {
mySpinner.classList.add('visible');
setTimeout(() => {
mySpinner.classList.remove('visible');
}, 3000); // Hide after 3 seconds
});
}
// Accordion functionality (existing)
const accordionHeaders = document.querySelectorAll('.accordion-header');
accordionHeaders.forEach(header => {
header.addEventListener('click', () => {
const content = header.nextElementSibling;
header.classList.toggle('active');
if (content.style.display === 'block') {
content.style.display = 'none';
} else {
content.style.display = 'block';
}
});
});
// Movable Window Functionality
const windows = document.querySelectorAll('.window');
let activeWindow = null;
let isDragging = false;
let initialX, initialY, xOffset, yOffset;
windows.forEach(windowElement => {
const titleBar = windowElement.querySelector('.title-bar');
if (titleBar) {
titleBar.addEventListener('mousedown', dragStart);
}
});
function dragStart(e) {
if (e.button === 0) { // Left mouse button
activeWindow = this.closest('.window');
isDragging = true;
const rect = activeWindow.getBoundingClientRect();
initialX = e.clientX;
initialY = e.clientY;
xOffset = e.clientX - rect.left;
yOffset = e.clientY - rect.top;
activeWindow.style.transition = 'none'; // Disable transition during drag
activeWindow.style.cursor = 'grabbing';
document.addEventListener('mousemove', drag);
document.addEventListener('mouseup', dragEnd);
}
}
function drag(e) {
if (!isDragging) return;
e.preventDefault();
const newX = e.clientX - xOffset;
const newY = e.clientY - yOffset;
activeWindow.style.left = `${newX}px`;
activeWindow.style.top = `${newY}px`;
}
function dragEnd() {
isDragging = false;
activeWindow.style.transition = ''; // Re-enable transition
activeWindow.style.cursor = 'grab';
activeWindow = null;
document.removeEventListener('mousemove', drag);
document.removeEventListener('mouseup', dragEnd);
}
});
</script>
</body>
</html>