Skip to content

Commit a73b9ff

Browse files
committed
clean
1 parent 80e47d9 commit a73b9ff

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

src/assets/js/script.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,12 @@ dragHeader.addEventListener("mousedown", (e) => {
168168
document.addEventListener("mousemove", (e) => {
169169
if (!isDragging) return;
170170

171-
// Calculate new position
172171
let x = e.clientX - offsetLeft;
173172
let y = e.clientY - offsetTop;
174173

175-
// Boundary Check (Optional: keeps it inside the screen)
176174
x = Math.max(0, Math.min(x, window.innerWidth - dragContainer.offsetWidth));
177175
y = Math.max(0, Math.min(y, window.innerHeight - dragContainer.offsetHeight));
178176

179-
// Apply position and remove Tailwind's 'bottom' and 'right' so they don't fight the 'top'/'left'
180177
dragContainer.style.bottom = "auto";
181178
dragContainer.style.right = "auto";
182179
dragContainer.style.left = `${x}px`;
@@ -225,7 +222,6 @@ document.addEventListener('mousemove', (e) => {
225222
const dy = e.clientY - resizeStartY;
226223
const dir = resizeDirection;
227224

228-
// Horizontal
229225
if (dir.includes('e')) {
230226
dragContainer.style.width = `${Math.max(MIN_CONSOLE_WIDTH, resizeStartWidth + dx)}px`;
231227
}
@@ -237,7 +233,6 @@ document.addEventListener('mousemove', (e) => {
237233
}
238234
}
239235

240-
// Vertical — only the output area grows/shrinks, header stays fixed
241236
if (dir.includes('s')) {
242237
consoleOutput.style.height = `${Math.max(MIN_OUTPUT_HEIGHT, resizeStartOutputHeight + dy)}px`;
243238
}
@@ -256,12 +251,10 @@ document.addEventListener('mouseup', () => {
256251
resizeDirection = '';
257252
document.body.style.userSelect = '';
258253
document.body.style.cursor = '';
259-
// Restore CSS transition
260254
dragContainer.classList.add('transition-all', 'duration-300', 'ease-in-out');
261255
});
262256

263257
function minimizeConsole() {
264-
// Toggles the height of the output area
265258
if (consoleOutput.style.display === "none") {
266259
consoleOutput.style.display = "block";
267260
consoleContainer.style.width = "20rem"; // w-80
@@ -272,10 +265,8 @@ function minimizeConsole() {
272265
}
273266

274267
function maximizeConsole() {
275-
// Toggles a full-screen-ish mode
276268
consoleContainer.classList.toggle("console-maximized");
277269

278-
// Adjust height when maximized
279270
if (consoleContainer.classList.contains("console-maximized")) {
280271
consoleOutput.style.height = "70vh";
281272
consoleOutput.style.display = "block";
@@ -303,16 +294,13 @@ function reopenConsole() {
303294
const container = document.getElementById("matrix-console-container");
304295
const reopenBtn = document.getElementById("reopen-console-btn");
305296

306-
// Show the console
307297
container.classList.remove("hidden");
308298

309-
// Trigger reflow for animation
310299
void container.offsetWidth;
311300

312301
container.style.opacity = "1";
313302
container.style.transform = "translateY(0)";
314303

315-
// Hide the reopen button
316304
if (reopenBtn) reopenBtn.classList.add("hidden");
317305
}
318306

0 commit comments

Comments
 (0)