Skip to content

Commit 5a17845

Browse files
committed
(v0.1.5.5-alpha) Notepad App
Shesh this was fast i guess i finally learnt react n css actually. Anyways i completed the notepad application which was the README.txt. I will however make this generalised so that i can make noteppad i.e. txt files easily in future!
1 parent 43d565b commit 5a17845

File tree

4 files changed

+106
-6
lines changed

4 files changed

+106
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Your PC has been compromised by a group called the "HackClub". Can you regain co
3030
- [ ] Explorer App. (Started in v0.1.5.1). Sidebar (v0.1.5.2)
3131
- [X] Tabs v0.1.5.3 BUG: TITLE IS OVERFLOWING (Fixed v0.1.5.4)
3232
- [X] Universal tab feature (generalised) using `tabs: true` in App.js (Added in v0.1.5.4)
33-
- [ ] Notepad App
33+
- [X] Notepad App. (Made in v0.1.5.5)
34+
- [ ] Notepad Generalised component
3435
- [ ] CHANGE CHROME TO BRAVE
3536
- [ ] Terminal

src/apps/README.txt.jsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "../styles/apps/readme_txt.css"
2-
import {ChevronRight, House, MoveLeft, MoveRight, MoveUp, RotateCw} from "lucide-react";
2+
import { Heading1, Bold, Italic, Link2, Settings } from "lucide-react";
33

44
function Readme_txt() {
55

@@ -8,9 +8,37 @@ function Readme_txt() {
88
<div className={"readme-ribbon"}>
99
<div className={"readme-file-edit-view"}>
1010
<div className={"readme-file-edit-view-container"}>
11-
11+
<p>File</p>
12+
</div>
13+
<div className={"readme-file-edit-view-container"}>
14+
<p>Edit</p>
15+
</div>
16+
<div className={"readme-file-edit-view-container"}>
17+
<p>View</p>
1218
</div>
1319
</div>
20+
<div className={"readme-functions"}>
21+
<div className={"readme-settings-container"}>
22+
<Heading1 size={18} strokeWidth={1.5} />
23+
</div>
24+
<div className={"readme-settings-container"}>
25+
<Bold size={18} strokeWidth={1.5} />
26+
</div>
27+
<div className={"readme-settings-container"}>
28+
<Italic size={18} strokeWidth={1.5} />
29+
</div>
30+
<div className={"readme-settings-container"}>
31+
<Link2 size={18} strokeWidth={1.5} />
32+
</div>
33+
</div>
34+
<div className={"readme-settings"}>
35+
<div className={"readme-settings-container"}>
36+
<Settings size={18} strokeWidth={1.5} />
37+
</div>
38+
</div>
39+
</div>
40+
<div className={"readme-body"} contentEditable={true}>
41+
Hello this is content editable btw
1442
</div>
1543
</div>
1644
)

src/core/WindowManager.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ export default function AppWindow({
6767

6868
return (
6969
<Rnd
70+
resizeHandleStyles={{
71+
top: { cursor: 'ns-resize' },
72+
bottom: { cursor: 'ns-resize' },
73+
left: { cursor: 'ew-resize' },
74+
right: { cursor: 'ew-resize' },
75+
topRight: { cursor: 'nesw-resize' },
76+
bottomRight: { cursor: 'nwse-resize' },
77+
bottomLeft: { cursor: 'nesw-resize' },
78+
topLeft: { cursor: 'nwse-resize' },
79+
}}
80+
7081
bounds=""
7182
dragGrid={[1, 1]}
7283
size={fullscreen ? { width: "100vw", height: window.innerHeight - 48 } : { width: state.width, height: state.height }}

src/styles/apps/readme_txt.css

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,88 @@
77
align-items: center;
88

99
background-color: #181818;
10-
overflow: auto;
10+
overflow: hidden;
1111

1212
border-radius: 0 0 8px 8px;
1313
}
1414

1515
.readme-ribbon {
1616
width: 100%;
17-
height: 2.25rem;
17+
height: 2.5rem;
1818

1919
display: flex;
2020
flex-direction: row;
2121
align-items: center;
22+
justify-content: center;
2223

2324
background-color: #0e0e0e;
24-
2525
border: #0e0e0e solid 1px;
2626
}
2727

2828
.readme-file-edit-view {
29+
position: absolute;
30+
left: 0;
31+
32+
display: flex;
33+
flex-direction: row;
34+
align-items: center;
35+
36+
gap: 0.4rem;
37+
margin-left: 0.4rem;
38+
}
39+
.readme-file-edit-view-container {
40+
padding: 0.3rem 0.75rem;
41+
font-size: 0.9rem;
42+
43+
display: flex;
44+
flex-direction: row;
45+
align-items: center;
46+
47+
border-radius: 0.3rem;
48+
49+
transition: background-color var(--hover-animation) var(--hover-animation-type);
50+
}
51+
.readme-file-edit-view-container:hover {
52+
background-color: var(--border);
53+
}
54+
55+
.readme-functions {
2956
display: flex;
3057
flex-direction: row;
3158
align-items: center;
59+
}
60+
61+
.readme-settings {
62+
position: absolute;
63+
right: 0;
64+
65+
margin-right: 0.4rem;
66+
}
67+
.readme-settings-container {
68+
display: flex;
69+
flex-direction: row;
70+
align-items: center;
71+
72+
padding: 0.35rem;
73+
border-radius: 0.3rem;
74+
75+
transition: background-color var(--hover-animation) var(--hover-animation-type);
76+
}
77+
.readme-settings-container:hover {
78+
background-color: var(--border);
79+
}
80+
81+
.readme-body {
82+
height: 100%;
83+
84+
margin-left: 1rem;
85+
margin-top: 1rem;
86+
87+
width: calc(100% - 1rem);
3288

89+
white-space: pre-wrap;
90+
word-wrap: break-word;
91+
overflow-y: auto;
3392

93+
outline: none;
3494
}

0 commit comments

Comments
 (0)