Skip to content

Commit

Permalink
chore: adjust dmeo app
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Jun 22, 2020
1 parent d02478f commit 02f3705
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 5 additions & 6 deletions demo/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import {
text,
heart,
btn,
progress,
} from "./styles";
import useWebAnimations from "../../src";

const App: FC = () => {
const { ref: blockRef, getAnimation: getBlockAnim } = useWebAnimations<
HTMLDivElement
>({
autoPlay: false,
keyframes: { width: ["0", "100%", "0"], left: ["0", "0", "100%"] },
timing: {
duration: 2000,
Expand All @@ -31,7 +31,6 @@ const App: FC = () => {
const { ref: textRef, getAnimation: getTextAnim } = useWebAnimations<
HTMLDivElement
>({
autoPlay: false,
keyframes: { opacity: ["0", "1"] },
timing: {
delay: 1600,
Expand All @@ -42,7 +41,6 @@ const App: FC = () => {
const { ref: heartRef, getAnimation: getHeartAnim } = useWebAnimations<
HTMLDivElement
>({
autoPlay: false,
keyframes: [
{ transform: "translate3d(0, 0, 0)", opacity: 1 },
{ transform: "translate3d(0, -130%, 0)", opacity: 0.5 },
Expand All @@ -57,9 +55,10 @@ const App: FC = () => {
});

const handlePlayback = (e: MouseEvent) => {
(getBlockAnim() as any)[(e.target as HTMLButtonElement).id]();
(getTextAnim() as any)[(e.target as HTMLButtonElement).id]();
(getHeartAnim() as any)[(e.target as HTMLButtonElement).id]();
const method = (e.target as HTMLButtonElement).id;
(getBlockAnim() as any)[method]();
(getTextAnim() as any)[method]();
(getHeartAnim() as any)[method]();
};

return (
Expand Down
7 changes: 4 additions & 3 deletions demo/App/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const container = css`
flex-direction: column;
align-items: center;
height: 100vh;
padding: 5rem 5%;
padding: 0 5%;
color: #fff;
background: #000;
${sm} {
Expand All @@ -33,7 +33,7 @@ export const container = css`
`;

export const title = css`
margin: 0 0 0.75rem;
margin: 5rem 0 0.75rem;
text-align: center;
`;

Expand All @@ -45,7 +45,8 @@ export const mask = css`
position: relative;
margin-bottom: 2.5rem;
width: 87vw;
overflow-x: hidden;
overflow: hidden;
user-select: none;
${md} {
width: 29rem;
}
Expand Down

0 comments on commit 02f3705

Please sign in to comment.