@@ -5,6 +5,7 @@ import { button, useControls } from "leva";
55import * as THREE from "three" ;
66import type { Planet } from "@/types/planet" ;
77import { earth } from "@/data/planets" ;
8+ import "./index.css" ;
89
910interface PlanetMeshProps {
1011 planet : Planet ;
@@ -144,7 +145,7 @@ export default function Page() {
144145 } ;
145146
146147 return (
147- < div style = { { position : "relative" , width : "100vw" , height : "100vh" } } >
148+ < div className = "simulation-page" >
148149 < Canvas
149150 camera = { { position : [ 0 , 0 , 220 ] , fov : 60 } }
150151 onCreated = { ( { gl } ) => {
@@ -175,26 +176,11 @@ export default function Page() {
175176 < OrbitControls enableZoom = { true } />
176177 </ Canvas >
177178
178- < div
179- style = { {
180- position : "absolute" ,
181- top : 16 ,
182- left : 16 ,
183- width : 320 ,
184- maxHeight : "75vh" ,
185- overflowY : "auto" ,
186- background : "rgba(0, 0, 0, 0.7)" ,
187- color : "#ffffff" ,
188- borderRadius : 8 ,
189- padding : 12 ,
190- backdropFilter : "blur(4px)" ,
191- fontSize : 14 ,
192- } }
193- >
194- < div style = { { display : "flex" , alignItems : "center" , justifyContent : "space-between" } } >
179+ < div className = "simulation-panel" >
180+ < div className = "simulation-panel__header" >
195181 < strong > クリック配置</ strong >
196- < div style = { { display : "flex" , alignItems : "center" , gap : 8 } } >
197- < label style = { { display : "flex" , alignItems : "center" , gap : 6 } } >
182+ < div className = "simulation-panel__actions" >
183+ < label className = "simulation-panel__toggle" >
198184 < input
199185 type = "checkbox"
200186 checked = { placementMode }
@@ -205,44 +191,28 @@ export default function Page() {
205191 < button
206192 type = "button"
207193 onClick = { ( ) => setPlacementPanelOpen ( ( prev ) => ! prev ) }
208- style = { {
209- border : "1px solid rgba(255, 255, 255, 0.35)" ,
210- borderRadius : 6 ,
211- background : "transparent" ,
212- color : "#ffffff" ,
213- padding : "2px 8px" ,
214- cursor : "pointer" ,
215- fontSize : 12 ,
216- } }
194+ className = "simulation-panel__button"
217195 >
218196 { placementPanelOpen ? "たたむ" : "ひらく" }
219197 </ button >
220198 </ div >
221199 </ div >
222200 { placementPanelOpen && (
223201 < >
224- < p style = { { marginTop : 8 , marginBottom : 12 , opacity : 0.85 } } >
202+ < p className = "simulation-panel__hint" >
225203 ONの間は水色の面をクリックすると、座標が自動入力されます。
226204 </ p >
227205
228206 < strong > 追加済み惑星 ({ planets . length } )</ strong >
229- < ul style = { { listStyle : "none" , padding : 0 , marginTop : 10 , marginBottom : 0 } } >
207+ < ul className = "simulation-panel__list" >
230208 { planets . map ( ( planet , index ) => (
231209 < li
232210 key = { `planet-item-${ index } ` }
233- style = { {
234- display : "flex" ,
235- alignItems : "center" ,
236- justifyContent : "space-between" ,
237- gap : 8 ,
238- marginBottom : 8 ,
239- paddingBottom : 8 ,
240- borderBottom : "1px solid rgba(255, 255, 255, 0.15)" ,
241- } }
211+ className = "simulation-panel__item"
242212 >
243213 < div >
244214 < div > #{ index + 1 } </ div >
245- < div style = { { fontSize : 12 , opacity : 0.85 } } >
215+ < div className = "simulation-panel__meta" >
246216 r={ planet . radius . toFixed ( 1 ) } / (
247217 { planet . position . x . toFixed ( 1 ) } , { planet . position . y . toFixed ( 1 ) } ,
248218 { planet . position . z . toFixed ( 1 ) } )
@@ -251,14 +221,7 @@ export default function Page() {
251221 < button
252222 type = "button"
253223 onClick = { ( ) => removePlanet ( index ) }
254- style = { {
255- border : "1px solid rgba(255, 255, 255, 0.35)" ,
256- borderRadius : 6 ,
257- background : "transparent" ,
258- color : "#ffffff" ,
259- padding : "4px 8px" ,
260- cursor : "pointer" ,
261- } }
224+ className = "simulation-panel__delete"
262225 >
263226 削除
264227 </ button >
0 commit comments