ant-design/site/theme/template/Home/DesignPage/Certainty.tsx
二货机器人 abf215a982
docs: Update 4.0 site (#20290)
* init recommend block

* init design pages

* home frames

* add background banner

* hello, Hitu makes the animation

* add media query

* add images

* update types

* add declare

* preload support

* update ignore

* additional ignore site Home lint

* update ignore

* add hover effect

* adjust alt of bannber

* adjust lang & card shadow

* fix typo

* adjust desc

* hitu in english

* article add link

* Certainty is hitu

* Meaning Hitu

* Growth with Hitu

* Natural Hitu

* slow down of Natural

* adjust speed of icons

* New Meaning animation

* adjust animation duration

* update card link

* update link

* values doc

* replace images

* faster Growth

* update values

* fix lint

* all slow down

* adjust padding

* update icons

* adjust margin

* update images

* adjust montion

* adjust by designer

* update pages

* update design prod

* update articles

* update site style

* update doc

* update images

* update style

* lint fix

* adjust liner color

* github text color update

* adjust margin of title

* mobile design

* update design sub card

* update style

* less lint

* update images

* design card auto height

* update img

* update logo transition

* adjust card style

* adjust style to fix 184

* adjust nav style

* category it

* slow down of logo

* update style

* hide video link

* hitu article

* use img of hitu

* update docs

* style lint

* update Hitu layout doc

* update images

* speed up logo

* update link

* clean up

* clean up

* update doc

* adjust doc

* update images
2019-12-26 15:27:52 +08:00

62 lines
1.1 KiB
TypeScript

import * as React from 'react';
import Hitu from '@ant-design/hitu';
import { Shape, FrameInfo } from '@ant-design/hitu/lib/interface';
import InteractiveIcon from './InteractiveIcon';
function Rect() {
return <rect x="0" y="0" width="14" height="14" fill="#0170FE" />;
}
Rect.width = 14;
Rect.height = 14;
function getFrames(x: number, y: number): FrameInfo[] {
const delay = (x + y) * 5 + 1;
const position = {
x: x * (14 + 12) + 21,
y: y * (14 + 12) + 21,
};
return [
{
frame: 0,
rotate: 0,
...position,
},
{
frame: delay,
rotate: 0,
...position,
cubic: Hitu.CUBIC_EASE,
},
{
frame: 15 + delay,
scaleX: 1.3,
scaleY: 1.3,
cubic: Hitu.CUBIC_EASE,
},
{
frame: 30 + delay,
scaleX: 1,
scaleY: 1,
},
];
}
const shapes: Shape[] = [];
for (let x = 0; x < 4; x += 1) {
for (let y = 0; y < 4; y += 1) {
shapes.push({
type: 'shape',
source: Rect,
frames: getFrames(x, y),
});
}
}
export default function Certainty() {
return <InteractiveIcon shapes={shapes} />;
}