Skip to content

Commit e48a01f

Browse files
committed
(v0.3.7-beta) Default Settings + Others
Instead of hardcoding the positions of the windows based on a fixed height and width ive now made it so that i can just change the width and height to do that. The vars are in `App.js` as `WINDOW_DEFAULTS`. Made minor changes to progresspanel css
1 parent 6dbb198 commit e48a01f

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ Your PC has been compromised by a group called the "HackClub". Can you regain co
7474
- [X] Fix the Hex in README.txt & Add full url not just /../.. (Fixed v0.1.7.6)
7575
- [X] CRITICAL: THE COLORS OF UI ARE BY DEFAULT BLACK MAKE IT WHITE. (Bug reported by: Felix Gao) (Fixed v0.1.7.8(1))
7676
- [ ] GAME IMPROVEMENT: time pressure. increment like 2 min for each puzzle start with 7 min or sm.
77-
- [ ] Fix puzzle numbering.
77+
- [X] Fix puzzle numbering.
7878
- [ ] Add a way to track progress.
7979
- [ ] Add a puzzle 1.txt or sm; time count starts after opening that file.
8080
- [ ] Lock some apps (Hacked yk)
8181
- [ ] Stress test the terminal.
8282
- [X] Add games like MC(https://classic.minecraft.net/) and sm others. (Added v0.3.2)
8383
- [ ] the grid snapping is offset from the place where icons snap when u release (Snxhit_)
8484
- [ ] Cmd opens on login and then the notepad opens automatically, remove the alert thing.
85+
- [ ] WINDOW_DEFAULTS: Now the position of the windows change with the width and height, added the vars in App.js (Done v0.3.7)
8586

8687

8788
Playtesters & Contributors: Flux3tor, Snxhit_, Matthias, Nx75, Keyboard1000n17, abtheinnovator, redac1ed, TruthEntity, SeradedStripes

src/core/WindowManager.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Rnd } from "react-rnd";
33
import "../styles/core/WindowManager.css"
44
import {X, Square, Copy, Minus, Plus} from 'lucide-react';
55

6+
import {WINDOW_DEFAULTS} from "../data/Apps.js";
7+
68
export default function AppWindow({
79
title,
810
AppComponent,
@@ -18,10 +20,10 @@ export default function AppWindow({
1820
posX,
1921
posY
2022
}) {
21-
const DEFAULT_WIDTH = 600;
22-
const DEFAULT_HEIGHT = 400;
23-
const TASKBAR_HEIGHT = 48;
24-
const PADDING = 36;
23+
const DEFAULT_WIDTH = WINDOW_DEFAULTS.WIDTH;
24+
const DEFAULT_HEIGHT = WINDOW_DEFAULTS.HEIGHT;
25+
const TASKBAR_HEIGHT = WINDOW_DEFAULTS.TASKBAR_HEIGHT;
26+
const PADDING = WINDOW_DEFAULTS.OFFSET;
2527

2628
const [state, setState] = useState({
2729
x: posX,

src/data/Apps.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ export function getNextZ() {
1414
return INITIAL_Z;
1515
}
1616

17+
export const WINDOW_DEFAULTS = {
18+
WIDTH: 750,
19+
HEIGHT: 450,
20+
OFFSET: 30,
21+
TASKBAR_HEIGHT: 48
22+
};
23+
1724
export const APP_REGISTRY = {
1825
explorer: {
1926
title: "Explorer",

src/routes/desktop.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import '../styles/routes/desktop.css';
33
import { Search } from 'lucide-react';
44
import {createRef, useRef, useState, useMemo, useEffect} from "react";
55

6-
import { APP_REGISTRY, INITIAL_Z, getNextZ } from "../data/Apps.js";
6+
import {APP_REGISTRY, INITIAL_Z, getNextZ, WINDOW_DEFAULTS} from "../data/Apps.js";
77
import AppWindow from "../core/WindowManager.jsx";
88

99
import Draggable from 'react-draggable';
@@ -119,13 +119,13 @@ function Desktop() {
119119

120120
if (!apps[name].isOpen) {
121121
if (openApps.length === 0) {
122-
newX = (window.innerWidth / 2) - 300;
123-
newY = (window.innerHeight / 2) - 250;
122+
newX = (window.innerWidth / 2) - (WINDOW_DEFAULTS.WIDTH / 2);
123+
newY = (window.innerHeight / 2) - (WINDOW_DEFAULTS.HEIGHT / 2) - (WINDOW_DEFAULTS.TASKBAR_HEIGHT);
124124
} else {
125-
newX = lastPos.current.x + OFFSET;
126-
newY = lastPos.current.y + OFFSET;
127-
if (newY > window.innerHeight - 500) newY = 100;
128-
if (newX > window.innerWidth - 700) newX = 100;
125+
newX = lastPos.current.x + WINDOW_DEFAULTS.OFFSET;
126+
newY = lastPos.current.y + WINDOW_DEFAULTS.OFFSET;
127+
if (newY > window.innerHeight - WINDOW_DEFAULTS.HEIGHT) newY = 100;
128+
if (newX > window.innerWidth - WINDOW_DEFAULTS.WIDTH) newX = 100;
129129
}
130130
lastPos.current = { x: newX, y: newY };
131131
}

src/styles/components/ProgressPanel.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
.progress-button-active {
2929
padding: 0.7rem 1.2rem;
3030

31-
backdrop-filter: blur(2rem) brightness(3);
31+
backdrop-filter: blur(2rem) brightness(1.5);
3232

3333
border: 1px solid wheat;
3434
}
3535
.progress-button:hover {
3636
padding: 0.7rem 1.2rem;
3737

38-
backdrop-filter: blur(2rem) brightness(3);
38+
backdrop-filter: blur(2rem) brightness(2);
3939
}
4040

4141
.progress-container {
@@ -54,7 +54,7 @@
5454

5555
.progress-sidebar {
5656
border-radius: 0.625rem;
57-
backdrop-filter: blur(2rem) brightness(2);
57+
backdrop-filter: blur(2rem) brightness(1.5);
5858
width: 18rem;
5959
height: 65%;
6060

0 commit comments

Comments
 (0)