Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

セットアップ画面にファンアートを表示する #754

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions src/browser/graphics/views/break.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {swipeEnter, swipeExit} from "../components/lib/blur-swipe";
import {newlineString} from "../components/lib/util";
import {useFitViewport} from "../components/lib/use-fit-viewport";
import {render} from "../../render.js";
import {FanArtTweet} from "../components/fan-art-tweet.js";

const Spacer = () => <img src={nextGameSpacer} width={50} height={60}></img>;

Expand Down Expand Up @@ -216,6 +217,7 @@ const TweetContainer = () => {
const tweetTag = useRef(null);
const fanartTag = useRef(null);
const tweetRef = useRef(null);
const fanArtRef = useRef(null);
const transitionTimeline = useCallback(() => {
const tl = gsap.timeline();
tl.to([tweetTag.current, tweetRef.current], {
Expand All @@ -226,7 +228,22 @@ const TweetContainer = () => {
tl.to(
[tweetTag.current, tweetRef.current],
{x: 0, duration: 1, ease: Power2.easeOut},
"+=10",
"+=15",
);
return tl;
}, []);

const transitionFanArtTimeline = useCallback((width: number) => {
const tl = gsap.timeline();
tl.to([fanartTag.current, fanArtRef.current], {
x: (width + 490) * -1,
duration: 1,
ease: Power2.easeOut,
});
tl.to(
[fanartTag.current, fanArtRef.current],
{x: 0, duration: 1, ease: Power2.easeOut},
"+=20",
);
return tl;
}, []);
Expand Down Expand Up @@ -261,7 +278,6 @@ const TweetContainer = () => {
width={30}
height={98}
style={{
display: "none", // TODO: remove after adding fanart
gridRow: "2 / 3",
gridColumn: "1 / 2",
alignSelf: "start",
Expand All @@ -286,6 +302,24 @@ const TweetContainer = () => {
>
<Tweet onShow={transitionTimeline}></Tweet>
</div>
<div
ref={fanArtRef}
style={{
gridRow: "1 / 3",
gridColumn: "2 / 4",
alignSelf: "start",
justifySelf: "stretch",
padding: "50px",
borderColor: setup.frameBorder,
borderStyle: "solid",
borderWidth: "2px 0 2px 2px",
borderRadius: "7px 0 0 7px",
background: setup.frameBg,
willChange: "transform",
}}
>
<FanArtTweet onShow={transitionFanArtTimeline} />
</div>
</div>
);
};
Expand Down
Loading