Skip to content

Commit c5e705b

Browse files
committed
Merge branch 'main' into simon2
2 parents 6cfc50b + 0e5e691 commit c5e705b

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/components/LevelComponent.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export default function LevelComponent({ onClose, lvl }: LevelProps) {
1515
const handleAnimationEnd = () => {
1616
if (isClosing) onClose();
1717
};
18-
const seed = lvl*71 - 10;
18+
const seed = lvl * 71 - 10;
1919
return (
20-
<div className="flex items-center justify-center min-h-screen w-full container">
20+
<div className="flex items-center justify-center h-full w-full">
2121
<style>{`
2222
@keyframes expandDown {
2323
from { transform: scaleY(0); }
@@ -35,14 +35,10 @@ 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-
}
38+
4339
`}</style>
4440
<div
45-
className={`${isClosing ? 'collapse-up' : 'expand-down'} w-4/5 h-screen flex gap-10 p-4 font-mono overflow-hidden`}
41+
className={`${isClosing ? 'collapse-up' : 'expand-down'} w-full h-full flex gap-10 p-4 font-mono overflow-hidden`}
4642
onAnimationEnd={handleAnimationEnd}
4743
>
4844
{/* X button */}
@@ -53,7 +49,7 @@ export default function LevelComponent({ onClose, lvl }: LevelProps) {
5349
5450
</button>
5551

56-
<InfoComponent seed={seed}/>
52+
<InfoComponent seed={seed} />
5753
<OutputComponent seed={seed} />
5854
</div>
5955
</div>

src/pages/home/Home.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ export default function Home() {
3737
<button className="ml-5 mt-5 absolute border-4 rounded-3xl p-5" onClick={handleOpen} disabled={isVisible}>
3838
Glorp
3939
</button>
40-
<section className="">
40+
<section className="relative w-full h-screen">
4141
{isVisible && (
42-
<LevelComponent
42+
43+
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[90vw] h-[90vh] z-50">
44+
<LevelComponent
4345
key={mountKey}
44-
onClose={handleClose}
46+
onClose={() => setIsVisible(false)}
4547
lvl={lvlNum}
46-
/>
48+
/>
49+
</div>
50+
4751
)}
4852
<canvas ref={canvasRef} className={styles.solarsystem}></canvas>
4953
</section>

0 commit comments

Comments
 (0)