Skip to content

Commit 14262ef

Browse files
committed
fixed styling
1 parent bc4377d commit 14262ef

5 files changed

Lines changed: 55 additions & 57 deletions

File tree

package-lock.json

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

src/components/LevelComponent.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function LevelComponent({ onClose, lvl }: LevelProps) {
1717
};
1818
const seed = lvl*71 - 10;
1919
return (
20-
<>
20+
<div className="flex items-center justify-center min-h-screen w-full container">
2121
<style>{`
2222
@keyframes expandDown {
2323
from { transform: scaleY(0); }
@@ -35,26 +35,27 @@ export default function LevelComponent({ onClose, lvl }: LevelProps) {
3535
animation: collapseUp 0.2s ease-in forwards;
3636
transform-origin: center;
3737
}
38+
.container {
39+
position: absolute;
40+
z-index: 1000;
41+
margin: 0px;
42+
}
3843
`}</style>
3944
<div
40-
className={`${isClosing ? 'collapse-up' : 'expand-down'} w-screen h-screen flex gap-10 p-4 font-mono overflow-hidden`}
45+
className={`${isClosing ? 'collapse-up' : 'expand-down'} w-4/5 h-screen flex gap-10 p-4 font-mono overflow-hidden`}
4146
onAnimationEnd={handleAnimationEnd}
4247
>
4348
{/* X button */}
4449
<button
4550
onClick={handleClose}
46-
className="absolute top-9 right-36 text-white text-xl leading-none"
51+
className="absolute top-9 right-10 text-white text-xl leading-none"
4752
>
4853
4954
</button>
5055

51-
<div className="flex-1 bg-[#2a2a2a] rounded-2xl p-3 flex flex-col gap-3">
52-
<InfoComponent seed={seed}/>
53-
</div>
54-
<div className="flex-1 bg-[#2a2a2a] rounded-2xl p-3 flex flex-col gap-3">
55-
<OutputComponent seed={seed} />
56-
</div>
56+
<InfoComponent seed={seed}/>
57+
<OutputComponent seed={seed} />
5758
</div>
58-
</>
59+
</div>
5960
);
6061
}

src/components/OutputComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ nums = [1, 2, 3]
8383
}
8484

8585
return (
86-
<div className="flex-1 p-3 flex flex-col gap-3">
86+
<div className="flex-1 bg-[#2a2a2a] p-3 rounded-2xl flex flex-col gap-3">
8787
{/* Editor */}
8888
<textarea
8989
value={code}

src/pages/home/Home.module.css

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
* {
2-
margin: 0;
3-
padding: 0;
4-
border: 0;
5-
font-size: 100%;
6-
vertical-align: baseline;
7-
overflow: hidden;
8-
/* outline: 1px solid red !important; */
9-
}
10-
111
html, body {
122
width: 100%;
133
height: 100%;
@@ -37,6 +27,9 @@ header {
3727

3828
}
3929

30+
.cleardiv {
31+
clear: both;
32+
}
4033

4134
.solarsystem {
4235
width: 100%;
@@ -46,6 +39,18 @@ header {
4639
}
4740

4841
button {
49-
z-index: 10000;
42+
z-index: 100;
5043
color: white;
51-
}
44+
}
45+
46+
/*
47+
{
48+
margin: 0;
49+
padding: 0;
50+
border: 0;
51+
font-size: 100%;
52+
vertical-align: baseline;
53+
overflow: hidden;
54+
// outline: 1px solid red !important;
55+
}
56+
*/

src/pages/home/Home.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ export default function Home() {
2424

2525
return (
2626
<div>
27-
<button className="ml-100 mt-80 absolute border-4 rounded-3xl p-5" onClick={handleOpen} disabled={isVisible}>
28-
Glorp
29-
</button>
30-
{isVisible && (
31-
<LevelComponent
32-
key={mountKey}
33-
onClose={() => setIsVisible(false)}
34-
lvl={lvlNum}
35-
/>
36-
)}
37-
3827
<header>
3928
<div className={styles["header-brand"]}>
4029
<h1>glorpython</h1>
4130
</div>
4231
</header>
43-
44-
<canvas ref={canvasRef} className={styles.solarsystem}></canvas>
32+
<button className="ml-5 mt-5 absolute border-4 rounded-3xl p-5" onClick={handleOpen} disabled={isVisible}>
33+
Glorp
34+
</button>
35+
<section className="">
36+
{isVisible && (
37+
<LevelComponent
38+
key={mountKey}
39+
onClose={() => setIsVisible(false)}
40+
lvl={lvlNum}
41+
/>
42+
)}
43+
<canvas ref={canvasRef} className={styles.solarsystem}></canvas>
44+
</section>
4545
</div>
4646
);
4747
}

0 commit comments

Comments
 (0)