File tree Expand file tree Collapse file tree 5 files changed +29
-12
lines changed
Assets/WebGLTemplates/SequenceReact
Packages/Sequence-Unity/WebGLTemplates/SequenceReact/src Expand file tree Collapse file tree 5 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 44 < meta charset ="UTF-8 " />
55 < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7- < title > Sequence Unity</ title >
7+ < title > Sequence Unity Demo </ title >
88 </ head >
99 < body >
1010 < div id ="root "> </ div >
Original file line number Diff line number Diff line change 1717 left : 0 ;
1818 width : 100% ;
1919 height : 100% ;
20- background : grey ;
20+ background : # 1a1a1a ;
2121 /* We'll set the following Flex properties in order to center the text. */
2222 display : flex;
2323 justify-content : center;
Original file line number Diff line number Diff line change 55
66 color-scheme : light dark;
77 color : rgba (255 , 255 , 255 , 0.87 );
8- background-color : # 242424 ;
8+ background-color : # 1a1a1a ;
99
1010 font-synthesis : none;
1111 text-rendering : optimizeLegibility;
Original file line number Diff line number Diff line change 88
99.container {
1010 position : relative;
11- /* The container determains the size. */
12- width : 800px ;
13- height : 600px ;
1411}
1512
1613.container > .loading-overlay {
Original file line number Diff line number Diff line change @@ -50,12 +50,15 @@ import "./App.css";
5050 }
5151 } , [ messageToSend ] ) ;
5252
53- useEffect ( ( ) => {
54- addEventListener ( "GoogleSignIn" , handleGoogleSignIn ) ;
55- return ( ) => {
56- removeEventListener ( "GoogleSignIn" , handleGoogleSignIn ) ;
57- } ;
58- } , [ ] ) ;
53+ useEffect ( ( ) => {
54+ addEventListener ( "GoogleSignIn" , handleGoogleSignIn ) ;
55+ window . addEventListener ( "resize" , handleResize ) ;
56+ handleResize ( )
57+ return ( ) => {
58+ removeEventListener ( "GoogleSignIn" , handleGoogleSignIn ) ;
59+ window . removeEventListener ( "resize" , handleResize ) ;
60+ } ;
61+ } , [ ] ) ;
5962
6063 const [ showLogin , setShowLogin ] = useState ( false ) ;
6164
@@ -68,6 +71,23 @@ import "./App.css";
6871 setShowLogin ( false ) ;
6972 } ;
7073
74+ const handleResize = ( ) => {
75+ const container = document . querySelector ( '.container' ) as any ;
76+
77+ let w = window . innerWidth * 0.98 ;
78+ let h = window . innerHeight * 0.98 ;
79+
80+ const r = 600 / 960 ;
81+ if ( w * r > window . innerHeight ) {
82+ w = Math . min ( w , Math . ceil ( h / r ) ) ;
83+ }
84+
85+ h = Math . floor ( w * r ) ;
86+
87+ container . style . width = w + "px" ;
88+ container . style . height = h + "px" ;
89+ }
90+
7191 return (
7292 < div className = "outer-container" >
7393 < div className = "container" >
You can’t perform that action at this time.
0 commit comments