|
@@ -1,7 +1,11 @@
|
|
|
import { useRef, useEffect } from "react";
|
|
|
import { gsap, ScrollTrigger } from "gsap/all";
|
|
|
+import { Action } from "./action";
|
|
|
import Opening from "./components/Opening";
|
|
|
import Viewer from "./components/Viewer";
|
|
|
+import TimeLineText from "./components/TimeLineText";
|
|
|
+import { css } from "@emotion/react";
|
|
|
+
|
|
|
import { useControls } from "leva";
|
|
|
// import "./App.css";
|
|
|
// gsap.registerPlugin(useGSAP);
|
|
@@ -20,20 +24,27 @@ function App() {
|
|
|
const handlerResize = () => {
|
|
|
clearTimeout(resizeTimer);
|
|
|
resizeTimer = setTimeout(function () {
|
|
|
- var height = 0.01 * window.innerHeight;
|
|
|
- var width = ((16 * window.innerHeight) / 9) * 0.01;
|
|
|
- var n = 0;
|
|
|
- 100 * height < window.innerWidth &&
|
|
|
- (n = 0.5 * (window.innerWidth - 100 * height));
|
|
|
+ let height = 0.01 * window.innerHeight;
|
|
|
+ let sHeight = ((16 * window.innerHeight) / 9) * 0.01;
|
|
|
+ let cHeight = 0;
|
|
|
+
|
|
|
+ if (100 * sHeight < window.innerWidth) {
|
|
|
+ cHeight = 0.5 * (window.innerWidth - 100 * sHeight);
|
|
|
+ }
|
|
|
+
|
|
|
document.documentElement.style.setProperty(
|
|
|
"--vh",
|
|
|
"".concat(height, "px")
|
|
|
),
|
|
|
document.documentElement.style.setProperty(
|
|
|
"--cw",
|
|
|
- "".concat(width, "px")
|
|
|
+ "".concat(sHeight, "px")
|
|
|
),
|
|
|
- document.documentElement.style.setProperty("--cl", "".concat(n, "px"));
|
|
|
+ document.documentElement.style.setProperty(
|
|
|
+ "--cl",
|
|
|
+ "".concat(cHeight, "px")
|
|
|
+ );
|
|
|
+ debugger
|
|
|
console.log("fresh");
|
|
|
ScrollTrigger.refresh();
|
|
|
// ScrollTrigger.getAll().forEach((ST) => ST.refresh(true));
|
|
@@ -45,27 +56,6 @@ function App() {
|
|
|
document.documentElement.style.overflow = "auto";
|
|
|
});
|
|
|
|
|
|
- const pinForExit = {
|
|
|
- onLeave: function (e) {
|
|
|
- // console.error("pinForExit-onLeave", e.trigger);
|
|
|
- gsap.set(e.trigger, {
|
|
|
- autoAlpha: 0,
|
|
|
- });
|
|
|
- },
|
|
|
- onEnterBack: function (e) {
|
|
|
- // console.error("pinForExit-onEnterBack", e.trigger);
|
|
|
- gsap.set(e.trigger, {
|
|
|
- autoAlpha: 1,
|
|
|
- });
|
|
|
- },
|
|
|
- };
|
|
|
- const crossFadeIn = {
|
|
|
- duration: 0.5,
|
|
|
- from: {
|
|
|
- autoAlpha: 0,
|
|
|
- },
|
|
|
- };
|
|
|
-
|
|
|
return (
|
|
|
<div ref={container}>
|
|
|
<Opening></Opening>
|
|
@@ -78,7 +68,40 @@ function App() {
|
|
|
pause={{
|
|
|
298: 40,
|
|
|
}}
|
|
|
- />
|
|
|
+ >
|
|
|
+ <TimeLineText
|
|
|
+ trigger={Action.scrubPin}
|
|
|
+ parentHeight={"1300vh"}
|
|
|
+ verticalOffset={"33vh"}
|
|
|
+ keyframes={[
|
|
|
+ {
|
|
|
+ ...Action.visible,
|
|
|
+ ...{
|
|
|
+ start: 0,
|
|
|
+ end: 0,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ ...Action.fadeDown,
|
|
|
+ ...{
|
|
|
+ start: 0.02,
|
|
|
+ end: 0.03,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ css={css`
|
|
|
+ font-weight: 300;
|
|
|
+ font-size: 2.75vw;
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ `}
|
|
|
+ >
|
|
|
+ 对古代美索不达米亚人来说,礼拜是日常生活的一部分。
|
|
|
+ </div>
|
|
|
+ </TimeLineText>
|
|
|
+ </Viewer>
|
|
|
|
|
|
<Viewer
|
|
|
height={"400vh"}
|
|
@@ -86,8 +109,8 @@ function App() {
|
|
|
path="vessel-steadi-10fps-873-rev1"
|
|
|
frameCount={64}
|
|
|
debug={debug}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -96,8 +119,8 @@ function App() {
|
|
|
path="vessel-render-10fps-873-rev1"
|
|
|
frameCount={125}
|
|
|
debug={debug}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -106,8 +129,8 @@ function App() {
|
|
|
path="michaux-steadi-10fps-873-rev1"
|
|
|
frameCount={98}
|
|
|
debug={debug}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -115,8 +138,8 @@ function App() {
|
|
|
name="Michaux Render"
|
|
|
path="michaux-render-10fps-873-rev1"
|
|
|
frameCount={158}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -124,16 +147,16 @@ function App() {
|
|
|
name="Gudea Architect Steadi"
|
|
|
path="gudea-architect-steadi-10fps-873-rev1"
|
|
|
frameCount={84}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
<Viewer
|
|
|
height={"800vh"}
|
|
|
name="Gudea Architect Render"
|
|
|
path="gudea-architect-render-10fps-873-rev1"
|
|
|
frameCount={201}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -141,8 +164,8 @@ function App() {
|
|
|
name="Dictionary Steadi"
|
|
|
path="dictionary-steadi-10fps-873-rev1"
|
|
|
frameCount={258}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -150,8 +173,8 @@ function App() {
|
|
|
name="Dictionary Render"
|
|
|
path="dictionary-steadi-10fps-873-rev1"
|
|
|
frameCount={45}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -168,7 +191,7 @@ function App() {
|
|
|
y: 500,
|
|
|
},
|
|
|
}}
|
|
|
- exitTween={pinForExit}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -176,8 +199,8 @@ function App() {
|
|
|
name="Cone Steadi"
|
|
|
path="cone-steadi-10fps-873-rev1"
|
|
|
frameCount={256}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -185,8 +208,8 @@ function App() {
|
|
|
name="Cone Render"
|
|
|
path="cone-render-10fps-873-rev1"
|
|
|
frameCount={50}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -194,8 +217,8 @@ function App() {
|
|
|
name="Gudea Steadi"
|
|
|
path="gudea-steadi-10fps-873-rev1"
|
|
|
frameCount={50}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
|
|
|
<Viewer
|
|
@@ -203,8 +226,8 @@ function App() {
|
|
|
name="Gudea Render"
|
|
|
path="gudea-render-10fps-873-rev1"
|
|
|
frameCount={184}
|
|
|
- enterTween={crossFadeIn}
|
|
|
- exitTween={pinForExit}
|
|
|
+ enterTween={Action.crossFadeIn}
|
|
|
+ exitTween={Action.pinForExit}
|
|
|
/>
|
|
|
</div>
|
|
|
);
|