Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

check画面にアニメーションを追加 #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 17 additions & 2 deletions src/components/CreateMessageCheck.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css, cx } from "@hono/hono/css";
import { css, cx, keyframes } from "@hono/hono/css";
import { WithHTML } from "../layout/WithHTML.tsx";
import { CocktailGlass } from "./CocktailGlass.tsx";
import { getCocktail, getMessage } from "./utils.ts";
Expand Down Expand Up @@ -45,6 +45,18 @@ const messageContainerStyle = css`
}
`;

const float = keyframes`
0%{
transform: translateY(0.15rem);
}
50%{
transform: translateY(-0.15rem);
}
100%{
transform: translateY(0.15rem);
}
`;

const messageStyle = css`
min-width: 7rem;
min-height: 7rem;
Expand All @@ -54,6 +66,8 @@ const messageStyle = css`
justify-content: center;
align-items: center;

animation: 1.8s ease-in-out infinite ${float};

p {
color: var(--color-black);
margin: 0 1rem;
Expand Down Expand Up @@ -102,6 +116,7 @@ export const CreateMessageCheck = async (
props: PropsWithChildren<{ id: string }>,
) => {
const id: string = props.id;

const cocktails = (await getMessage(id)).cocktails.map(
async (cocktailName: CocktailName) => {
return await getCocktail(cocktailName.name);
Expand Down Expand Up @@ -139,7 +154,7 @@ export const CreateMessageCheck = async (
style={(await getCocktail(cocktail.name)).word
? `background-color: ${
(await getCocktail(cocktail.name)).color
};`
}; animation-delay: ${index * 0.15}s`
: "display: none"}
>
<p>{(await getCocktail(cocktail.name)).word}</p>
Expand Down