Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 6d74664

Browse files
committed
Bye bye gsap 🚀
1 parent c05bec8 commit 6d74664

17 files changed

+50
-48
lines changed

_css/profile-introduction.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
left: 0;
1616
background-color: #3F51B5;
1717
opacity: 0;
18+
19+
&.show {
20+
animation: show-rendering-surface 0.5s linear;
21+
animation-fill-mode: forwards;
22+
}
23+
24+
@keyframes show-rendering-surface {
25+
from {opacity: 0;}
26+
to {opacity: 1;}
27+
}
1828
}
1929

2030
.center-content {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<link rel="stylesheet" type="text/css" href="/assets/styles/style.home.css?rev=3b8973e93a74125dc6e26eb376c4b287">
1+
<link rel="stylesheet" type="text/css" href="/assets/styles/style.home.css?rev=0d10a6f2ee4faf34089fc8f22257e7f3">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
2-
<script type="text/javascript" src="/assets/js/index.home.min.js?rev=4e02995ccb1fee007aef57c09aa6f02e"></script>
2+
<script type="text/javascript" src="/assets/js/index.home.min.js?rev=9a9d8152939d79b7c979b764ce9c674b"></script>
33
{%include service-worker.html %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"/assets/styles/style.home.css?rev=3b8973e93a74125dc6e26eb376c4b287",
1+
"/assets/styles/style.home.css?rev=0d10a6f2ee4faf34089fc8f22257e7f3",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"/assets/js/index.home.min.js?rev=765d9647ef7d53499c5079ea5f9ad954",
1+
"/assets/js/index.home.min.js?rev=4e02995ccb1fee007aef57c09aa6f02e",

_js/common/animation.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* @flow */
2+
import { addCssClass } from '../common/css-class'
3+
4+
const animation = (elementId: string, animation: string): void => {
5+
const element = document.getElementById(elementId)
6+
if (element) {
7+
addCssClass(element, animation)
8+
}
9+
}
10+
11+
export { animation }

_js/home/home-header-animation.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
/* @flow */
2-
import { scene3D } from './scene-3D'
3-
import { addCssClass } from '../common/css-class'
2+
import { animation } from '../common/animation'
43

54
const homeHeaderAnimation = (): void => {
65
animation('loader', 'hide')
76
animation('center-content', 'show')
87
animation('center-content-buttons', 'show')
98
animation('down-arrow', 'show')
10-
scene3D()
11-
}
12-
13-
const animation = (elementId: string, animation: string): void => {
14-
const element = document.getElementById(elementId)
15-
if (element) {
16-
addCssClass(element, animation)
17-
}
189
}
1910

2011
export { homeHeaderAnimation }

_js/home/scene-3D.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as THREE from 'three'
22
import OrbitControls from 'orbit-controls-es6'
3-
import { TweenMax } from 'gsap'
43
import PLYLoader from 'three-ply-loader'
54
import isWebGLEnabled from 'detector-webgl'
65
import { isAMobileDevice } from '../common/mobile-device-detector'
6+
import { animation } from '../common/animation'
77

88
const scene3D = () => {
99
if (isWebGLEnabled && isAMobileDevice() === false) {
@@ -198,12 +198,7 @@ const floor = (textureLoader, completionFunction) => {
198198
})
199199
}
200200

201-
const showRenderingSurfaceAnimation = () => {
202-
TweenMax.to('#rendering-surface', 0.5, {
203-
opacity: 1,
204-
delay: 0.2
205-
})
206-
}
201+
const showRenderingSurfaceAnimation = () => animation('rendering-surface', 'show')
207202

208203
const setWindowResizeListener = (camera, renderer) => {
209204
window.addEventListener('resize', () => {

_js/index.home.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/* @flow */
22
import { cookieConsent } from './common/cookie-consent'
33
import { loadFont } from './common/load-font'
4+
import { lazyLoadImages } from './common/lazy-load-images'
45
import { tabs } from './home/tabs'
56
import { homeHeaderAnimation } from './home/home-header-animation'
6-
import { lazyLoadImages } from './common/lazy-load-images'
7+
import { scene3D } from './home/scene-3D'
78

89
document.addEventListener('DOMContentLoaded', () => {
910
loadFont()
1011
cookieConsent()
1112
tabs()
1213
lazyLoadImages('.profile-image, .who-am-i-icon, .project-image, .timeline-image')
1314
homeHeaderAnimation()
15+
scene3D()
1416
})

_jsbuild/common/animation.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* */
2+
import { addCssClass } from '../common/css-class'
3+
4+
const animation = (elementId, animation) => {
5+
const element = document.getElementById(elementId)
6+
if (element) {
7+
addCssClass(element, animation)
8+
}
9+
}
10+
11+
export { animation }

0 commit comments

Comments
 (0)