@@ -77,7 +77,9 @@ const Lighthouse = () => {
7777 const { data : assets , error : errorAssets } = apiSWR ( `/assets?t=all&future=true&c=collection: project_lighthouse` , {
7878 revalidateOnFocus : false ,
7979 } )
80- const assetGalleryRef = useRef ( null )
80+ const assetGalleryParentRef = useRef < HTMLDivElement > ( null )
81+ const assetGalleryRef = useRef < HTMLDivElement > ( null )
82+ const { height : assetGalleryParentHeight } = useDivSize ( assetGalleryParentRef , [ assets ] )
8183 const { height : assetGalleryHeight } = useDivSize ( assetGalleryRef , [ assets ] )
8284
8385 return (
@@ -106,20 +108,20 @@ const Lighthouse = () => {
106108 </ div >
107109
108110 < div className = { styles . sectionWrapper } >
109- < div className = { styles . section } >
111+ < div className = { ` ${ styles . section } ${ styles . sectionHalfMobile } ` } >
110112 < div className = { styles . subSection } >
111- < iframe
112- width = { 650 }
113- height = { 650 * ( 9 / 16 ) }
114- src = "https://www.youtube.com/embed/1sKLwMzcis0 "
115- title = "Project Lighthouse Announcement Trailer "
116- frameBorder = "0 "
117- allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
118- allowFullScreen
119- / >
113+ < div className = { styles . videoEmbed } >
114+ < iframe
115+ src = "https://www.youtube.com/embed/1sKLwMzcis0"
116+ title = "Project Lighthouse Announcement Trailer "
117+ frameBorder = "0 "
118+ allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture "
119+ allowFullScreen
120+ />
121+ </ div >
120122 </ div >
121123 < div className = { styles . subSection } >
122- < div className = { styles . text } style = { { textAlign : 'left' } } >
124+ < div className = { styles . textLeft } >
123125 < p >
124126 Poly Haven is developing its first-ever video game, < strong > Project Lighthouse</ strong > , designed with
125127 three goals in mind:
@@ -136,9 +138,9 @@ const Lighthouse = () => {
136138 </ div >
137139 </ div >
138140
139- < div className = { styles . sectionWrapper } >
140- < div className = { styles . section } style = { { maxWidth : '100%' } } >
141- < div className = { styles . subSection } >
141+ < div className = { styles . sectionWrapper } ref = { assetGalleryParentRef } >
142+ < div className = { ` ${ styles . section } ${ styles . sectionHalfMobile } ${ styles . sectionFullWidth } ` } >
143+ < div className = { ` ${ styles . subSection } ${ styles . gameplayConcepts } ` } >
142144 < div className = { styles . imgGrid } >
143145 { gameplayConceptImages . map ( ( imageUrl ) => (
144146 < img
@@ -172,8 +174,17 @@ const Lighthouse = () => {
172174 </ div >
173175 </ div >
174176 < div className = { styles . subSection } >
175- { assets && (
176- < div className = { styles . assetGallery } >
177+ { assets && Object . keys ( assets ) . length > 0 && (
178+ < div
179+ className = { styles . assetGallery }
180+ style = {
181+ ( assetGalleryParentHeight
182+ ? {
183+ '--asset-gallery-max-height' : `${ assetGalleryParentHeight } px` ,
184+ }
185+ : undefined ) as React . CSSProperties | undefined
186+ }
187+ >
177188 < div
178189 className = { styles . assetGalleryInner }
179190 style = {
@@ -214,7 +225,7 @@ const Lighthouse = () => {
214225
215226 { isBeforeDeadline && (
216227 < div className = { styles . sectionWrapper } >
217- < div className = { styles . section } style = { { maxWidth : '100%' } } >
228+ < div className = { ` ${ styles . section } ${ styles . sectionFullWidth } ` } >
218229 < div className = { styles . subSection } >
219230 < Countdown targetDate = { submissionDeadline } maxInterval = "weeks" />
220231 < div className = { styles . row } >
@@ -258,7 +269,7 @@ const Lighthouse = () => {
258269 ) }
259270
260271 < div className = { styles . sectionWrapper } >
261- < div className = { styles . section } style = { { maxWidth : '100%' } } >
272+ < div className = { ` ${ styles . section } ${ styles . sectionFullWidth } ` } >
262273 < div className = { styles . subSection } >
263274 < h2 > About the Game</ h2 >
264275 < p >
@@ -303,7 +314,7 @@ const Lighthouse = () => {
303314 </ div >
304315
305316 < div className = { styles . sectionWrapper } >
306- < div className = { styles . section } style = { { maxWidth : '100%' } } >
317+ < div className = { ` ${ styles . section } ${ styles . sectionFullWidth } ` } >
307318 < div className = { styles . subSection } >
308319 < h2 > Timeline</ h2 >
309320 < LighthouseTimeline />
0 commit comments