Skip to content

Commit 7547dc0

Browse files
author
rmen527
committed
Add basic structure to textboxes
1 parent f2b4276 commit 7547dc0

5 files changed

Lines changed: 49 additions & 7 deletions

File tree

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@fontsource/fira-code": "^5.2.7",
1314
"@tailwindcss/vite": "^4.2.2",
1415
"react": "^19.2.4",
1516
"react-dom": "^19.2.4",

src/components/Textbox.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ interface TextboxProps {
99

1010
export default function Textbox(props: TextboxProps) {
1111
return (
12-
<div style={{ backgroundColor: "red" }}>
13-
{props.text}
12+
<div style={{ backgroundColor: props.lightcol }}>
13+
<div>
14+
<img src={"/" + props.headerimage} alt={props.headerimage} />
15+
</div>
16+
<div style={{ backgroundColor: props.darkcol }}>
17+
<p style={{ fontFamily: "'Fira Code', Arial"}}>{props.text}</p>
18+
</div>
19+
1420
</div>
1521
)
1622
}

src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
@import "@fontsource/fira-code/400.css";
12
@import "tailwindcss";

src/pages/home/Home.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,50 @@ function Home() {
1010
<div className="flex-1 flex flex-col">
1111

1212
{/* logo */}
13-
<div>Logo</div>
13+
<div><img src="logo.png" alt="Logo" /></div>
1414

1515
{/* python and alien code */}
1616
<div className="flex">
1717
<div className="flex-1">
18-
Python Code
18+
<Textbox
19+
lightcol="#005DA9"
20+
darkcol="#002E53"
21+
text="Python Code"
22+
headerimage="pythoncode.png"
23+
/>
1924
</div>
2025
<div className="flex-1">
21-
Alien Code
26+
<Textbox
27+
lightcol="#00A93D"
28+
darkcol="#00531F"
29+
text="Alien Code"
30+
headerimage="aliencode.png"
31+
/>
2232
</div>
2333
</div>
2434

2535
{/* task */}
26-
<div>task</div>
36+
<div>
37+
<Textbox
38+
lightcol="#5E5E5E"
39+
darkcol="#2E2E2E"
40+
text="Task"
41+
headerimage="task.png"
42+
/>
43+
</div>
2744
</div>
2845

2946
{/* right */}
3047
<div className="flex-1">
3148
<div>Code</div>
32-
<div>Output</div>
49+
<div>
50+
<Textbox
51+
lightcol="#5E5E5E"
52+
darkcol="#2E2E2E"
53+
text="Output"
54+
headerimage="output.png"
55+
/>
56+
</div>
3357
</div>
3458

3559

0 commit comments

Comments
 (0)