File tree Expand file tree Collapse file tree 4 files changed +204
-81
lines changed
Expand file tree Collapse file tree 4 files changed +204
-81
lines changed Original file line number Diff line number Diff line change 1414 < title > Yuting Zhou</ title >
1515 < meta name ="description " content ="Self Developed personal website build with React.js ">
1616
17+ <!-- Match App.js theme init before paint to avoid navbar / preloader color flash -->
18+ < script >
19+ ( function ( ) {
20+ try {
21+ var t = localStorage . getItem ( "theme" ) ;
22+ if ( t === "light" || t === "dark" ) {
23+ document . documentElement . setAttribute ( "data-theme" , t ) ;
24+ } else if ( window . matchMedia && window . matchMedia ( "(prefers-color-scheme: light)" ) . matches ) {
25+ document . documentElement . setAttribute ( "data-theme" , "light" ) ;
26+ } else {
27+ document . documentElement . setAttribute ( "data-theme" , "dark" ) ;
28+ }
29+ } catch ( e ) {
30+ document . documentElement . setAttribute ( "data-theme" , "dark" ) ;
31+ }
32+ } ) ( ) ;
33+ </ script >
34+
1735 <!-- Google / Search Engine Tags -->
1836 < meta itemprop ="name " content ="Yuting Zhou ">
1937 < meta itemprop ="description " content ="Self Developed personal website build with React.js ">
3654 content ="https://raw.githubusercontent.com/soumyajit4419/Portfolio/master/Images/readme-img.png?token=AK7VCIF5RYEUZZAURELPTAC76U6AK ">
3755</ head >
3856
39- < body >
57+ < body class =" preloader-active " >
4058 < noscript > You need to enable JavaScript to run this app.</ noscript >
4159 < div id ="root "> </ div >
4260</ body >
Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ function App() {
3434 }
3535 } , [ theme ] ) ;
3636
37+ useEffect ( ( ) => {
38+ if ( typeof document === "undefined" ) return ;
39+ if ( load ) {
40+ document . body . classList . add ( "preloader-active" ) ;
41+ } else {
42+ document . body . classList . remove ( "preloader-active" ) ;
43+ }
44+ } , [ load ] ) ;
45+
3746 useEffect ( ( ) => {
3847 const mediaQuery = window . matchMedia ( '(prefers-color-scheme: light)' ) ;
3948 const handleChange = ( e ) => {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ function Home2() {
108108 href = { link . href }
109109 target = { link . onClick ? "_self" : "_blank" }
110110 rel = "noopener noreferrer"
111- className = "social-icon-color home-social-icons"
111+ className = "home-social-icons"
112112 aria-label = { link . ariaLabel }
113113 onClick = { link . onClick }
114114 >
You can’t perform that action at this time.
0 commit comments