Skip to content

Commit 02d997c

Browse files
committed
fixed weird flashing glitch
1 parent f24b273 commit 02d997c

6 files changed

Lines changed: 71 additions & 22 deletions

File tree

.firebase/hosting.YnVpbGQ.cache

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ blog/0-6.jpg,1657300022773,9f8ecca3669c51c5db20357af35cd315874f5ca81adf69fe2ad16
103103
blog/0-banner.JPG,1656536019991,36a6c576760a2504170b419c84ea291ebd87f02e1e103ce07d23f7a3c721c70b
104104
blog/1-banner.png,1656537053921,afeb1e38d66daacdedfe2257dabb101dbdc6a1578fc3f4cf601c70f4b5b189ed
105105
blog/2-banner.jpg,1656536309914,3fd4071bd0cff346b50e83d70d9566dbe6a5131b98c779f67c76790efaafed7e
106-
icons/icon-back.svg,1661049059795,306cb652abfe31926b38847be584a0a69e75666ed2e5174e6524a9fad6be0e37
107106
navigation/nav-about-ch.svg,1682011641749,3455eb6e0d575fa98404a5cf54fa94016a2c8be0cf10a5cda8fe2285e305840c
108107
navigation/nav-about.svg,1661317177083,b170924da6cde457c17aeaea8df4c5cefbbe4b8b22af8bd4e4e122b12df75d18
109108
navigation/nav-blog-ch.svg,1682012107691,fd4dee879f5737e3819c89422164bfb9ef17066165fff141e351861335c6a957
@@ -146,19 +145,22 @@ portfolio/pm-3.png,1668067224977,ffe6fa38a1e54763a99043a21d2c330600a3b5e2105bef5
146145
portfolio/pm-banner.png,1668067501788,8c208e8691179b9ad43b4fbfa9e7674593189675198929ee9ee9cefd23c0e0fd
147146
portfolio/pm_case.pdf,1667802192923,3b63f9f9ab88612ee25f8ee0fa52df27d9cd2da42859e04c81a34b5e01d3070c
148147
portfolio/S__8134660.jpg,1668601073780,816652d2838b04da87f018a5ccb85da58c2a2cc0fbed275b64f6c5be4cdaddd2
149-
sidebar/icon-download-black.svg,1661049673701,34160589acae57e6379d3d71f69dd8291bb031311ea8068ee0fffbe5a363b4c3
150-
sidebar/icon-download-white.svg,1661060800796,bbda3888bc0a58f462ed38a7425616809d5b44c99f84d1b00f2269d48acfbd7f
151148
sidebar/icon-email.svg,1661049572371,c1a6cebb819d73d9d6b77dafae97f532d62518af46ef0b79de1c49156576edd5
152149
sidebar/icon-fiverr.svg,1666014831421,6f3ece5e8e7d0e577bbd63281c7ce5fcc2f55706885c16013778cce2adb751c6
153150
sidebar/icon-github.svg,1661049532620,e2922f94288f7fffb0aa4d6b47f38a991a983e2fab53250ce323d2619e20dddd
154151
sidebar/icon-linkedin.svg,1661049600193,8264bf409668d4e47ace09810d6c09da533ced8056b89694381a140340591919
155152
sidebar/Igor_Resume_Eng.pdf,1668568735422,61348f9bb5d962e4c229b97d3e690f4bff499699a9fde352a077b2660ba5cdf2
156-
asset-manifest.json,1682064156636,71a4fc0e1a9b5cc2f51b63272b648812f2a0c47a024dca5ea5aeba4ad5b8ed9f
157-
index.html,1682064156636,eabebf4809e8779e4c6b8e05f67d36a7caa42463ddd21575b5a149d3eb3f3667
158-
static/js/787.468f20b0.chunk.js,1682064156640,0b00cb067b57c48ff4968bdb5a2e70bc8c25477d0af64b1602b458786c9c71c0
159-
static/css/main.b183410e.css,1682064156641,d9d27f178c3742d230282dc2f7b9581867f494bf7af0280c9228b15bd604adfc
160-
static/js/main.f415bab7.js.LICENSE.txt,1682064156640,c47c3807c0744968abc5b558d7cf9dee8f9cc7a5f39c10f9655eab6d3bc96f46
161-
static/js/787.468f20b0.chunk.js.map,1682064156641,0d4f07246d8d5916b33cfc6349781465eb354ace4ce1cb990e3faa058d9ccec6
162-
static/css/main.b183410e.css.map,1682064156641,322af3d60c7fd1691e90435a0bd36f1f81acf566561cc3454e8401e3ecc3d459
163-
static/js/main.f415bab7.js,1682064156641,27478937e306118dfb37f182a06182c3b797020359b4346c670754cb2d563e11
164-
static/js/main.f415bab7.js.map,1682064156641,4fda6cfedda5668fc34be3062a32d82e298c004f564eecc9439db9bc1aab337f
153+
asset-manifest.json,1682223730698,0270b6f7275a0b4cadd4242a7ea60cadcb065887f6bc4782db66c45958ce39d6
154+
index.html,1682223730698,2ad3587e7c9365cf63c1b4efb97a711050ecdfc6b44ccda5c7d46e3a2da1eb9f
155+
logo-main-dark.svg,1682097474050,3310ceb2406ce7e52d990d7cf5fd9f6d2883fa975c1daa8cb96b39848c894d7f
156+
transition-sled-dark.svg,1682098196202,c4853f3e8f7907fb40e716fdd7745e81791f22f12383404007cf0b75095b9712
157+
static/css/main.b9a36114.css,1682223730708,4aad5f223feb3b650bf489ae674f70d9601c2d7c98f497882b7e567dc2448cda
158+
static/js/787.3f6603c5.chunk.js,1682223730708,44f90dbb2141d9880e27a86ee98d893d905344f5f3534cf2e7376d81b3c522ee
159+
static/js/787.3f6603c5.chunk.js.map,1682223730708,1218660ac15448b031d383608b2c18f04805cd2d16d1739f07d53ef2a256e6fb
160+
static/js/main.97b7ba7d.js.LICENSE.txt,1682223730708,c47c3807c0744968abc5b558d7cf9dee8f9cc7a5f39c10f9655eab6d3bc96f46
161+
static/css/main.b9a36114.css.map,1682223730708,fd1a1520487674627b6fbdf9717bd7b9efd97cec1a0592d2d521430abaff2d3c
162+
sidebar/icon-github-dark.svg,1682098563634,421dd8dfdba6d59f72725d50bbd81e72a1a1d5a4ff0a5ea79c3421b3f1a53bb1
163+
sidebar/icon-email-dark.svg,1682098569773,45cf2f37194fa05c97f7f463e83d25608df7f15bdb121cd9772f1933e48de58d
164+
sidebar/icon-linkedin-dark.svg,1682098555530,01bcab3528906389340904a463b4254cac43cbf8b462babdc194d7894173063f
165+
static/js/main.97b7ba7d.js,1682223730708,03b33f60cf9c2703865498cd33f6ab10c149e72b76ba1d7a9a709b0515f251e3
166+
static/js/main.97b7ba7d.js.map,1682223730710,7d5f147c6897935e013b8f0d509454ab72dc93819e356b8d323c7997941002fe

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "project-one-premium",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"private": true,
55
"dependencies": {
66
"@reduxjs/toolkit": "^1.9.5",

src/App.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import {
1818
selectLangEn,
1919
toggleDarkmode,
2020
toggleLanguage,
21+
selectLoad,
22+
finishLoad,
2123
} from "./store/utilSlice";
2224

2325
// Component Imports
@@ -31,6 +33,7 @@ import AnimationEndScreen from "./components/AnimationEndScreen";
3133
import Posts from "./pages/Posts";
3234
import PortPost from "./pages/Portpost";
3335
import Certificate from "./pages/Certificate";
36+
import Load from "./components/Load";
3437

3538
// Data Imports
3639
import { PortList } from "./static/portfolio/portfolioPosts";
@@ -54,6 +57,7 @@ function App() {
5457
const langEn = useSelector(selectLangEn);
5558
const darkmode = useSelector(selectDarkmode);
5659
const animation = useSelector(selectAnimation);
60+
const load = useSelector(selectLoad);
5761

5862
useEffect(() => {
5963
const lang = localStorage.getItem("lang");
@@ -71,6 +75,9 @@ function App() {
7175
} else {
7276
dispatch(defineDarkmode(false));
7377
}
78+
setTimeout(() => {
79+
dispatch(finishLoad());
80+
}, 1000);
7481
}, []);
7582

7683
const Blogpaths = BlogList.map((item, index) => (
@@ -132,16 +139,20 @@ function App() {
132139
)}
133140
</div>
134141
<Routes>
135-
<Route path="/" element={<Home />} />
136-
<Route path="/navigation" element={<Navigation />} />
137-
<Route path="/about" element={<About />} />
138-
<Route path="/portfolio" element={<Portfolio />} />
139-
<Route path="/blog" element={<Blog />} />
140-
<Route path="/certificate" element={<Certificate />} />
141-
{Blogpaths}
142-
{Portpaths}
142+
{!load && (
143+
<>
144+
<Route path="/" element={!animation.inProgress && <Home />} />
145+
<Route path="/navigation" element={<Navigation />} />
146+
<Route path="/about" element={<About />} />
147+
<Route path="/portfolio" element={<Portfolio />} />
148+
<Route path="/blog" element={<Blog />} />
149+
<Route path="/certificate" element={<Certificate />} />
150+
{Blogpaths}
151+
{Portpaths}
152+
</>
153+
)}
143154
</Routes>
144-
155+
<Load inProgress={load} />
145156
<Transition inProgress={animation.inProgress} />
146157
<AnimationEndScreen inProgress={animation.endAnimation} />
147158
</>

src/components/Load.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default function Load(props) {
2+
return (
3+
<div
4+
className={`tr-background load`}
5+
style={{ display: props.inProgress ? "block" : "none" }}
6+
>
7+
<div className="tr-cont">
8+
<img className="load-img" src="../logo-o-2d.svg" alt="load" />
9+
</div>
10+
</div>
11+
);
12+
}

src/static/css/Transition.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
opacity: 0;
3838
}
3939
}
40+
@keyframes spin {
41+
0% {
42+
transform: rotate(0deg);
43+
}
44+
100% {
45+
transform: rotate(360deg);
46+
}
47+
}
4048

4149
.tr-background {
4250
width: 100vw;
@@ -47,6 +55,7 @@
4755
animation-name: fade;
4856
animation-duration: 2s;
4957
animation-delay: 1.7s;
58+
animation-fill-mode: forwards;
5059
z-index: 1000;
5160
}
5261

@@ -83,6 +92,13 @@
8392
animation-name: extend;
8493
animation-duration: 1.8s;
8594
}
95+
.load {
96+
animation-delay: 0.8s;
97+
}
98+
.load-img {
99+
width: 4rem;
100+
animation: spin 0.3s linear 0s infinite;
101+
}
86102

87103
@media (orientation: landscape) {
88104
.tr-img {
@@ -162,6 +178,7 @@
162178
top: 0;
163179
background-color: black;
164180
animation-name: end;
181+
animation-fill-mode: forwards;
165182
animation-duration: 3s;
166183
opacity: 0;
167184
}
@@ -178,6 +195,7 @@
178195
rgb(91, 212, 255) 100%
179196
);
180197
animation-name: endfade;
198+
animation-fill-mode: forwards;
181199
animation-duration: 1s;
182200
animation-delay: 3s;
183201
}

src/store/utilSlice.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createSlice } from "@reduxjs/toolkit";
22

33
const initialState = {
4+
load: true,
45
animation: {
56
inProgress: false,
67
endAnimation: false,
@@ -35,6 +36,9 @@ export const utilSlice = createSlice({
3536
defineDarkmode: (state, action) => {
3637
state.darkmode = action.payload;
3738
},
39+
finishLoad: (state) => {
40+
state.load = false;
41+
},
3842
},
3943
});
4044

@@ -45,8 +49,10 @@ export const {
4549
defineLanguage,
4650
toggleDarkmode,
4751
defineDarkmode,
52+
finishLoad,
4853
} = utilSlice.actions;
4954

55+
export const selectLoad = (state) => state.util.load;
5056
export const selectAnimation = (state) => state.util.animation;
5157
export const selectDarkmode = (state) => state.util.darkmode;
5258
export const selectLangEn = (state) => state.util.langEn;

0 commit comments

Comments
 (0)