-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
50 lines (46 loc) · 1.3 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { RippleEffect } from '@rippleeffect/react-dom'
import { Theme, DefaultTheme, Options, DefaultOptions } from '@rippleeffect/dom'
import { DefaultColor } from '@rippleeffect/canvas'
import { NextPageContext } from "next";
import { useMemo, useState } from 'react';
const myTheme: Theme = {
...DefaultTheme,
rippleColor: {
...DefaultColor,
}
}
export default function IndexPage(context: NextPageContext) {
const [releases, setReleases] = useState<boolean[]>([])
const myOptions: Options = useMemo(() => {
return {
...DefaultOptions,
theme: myTheme,
onReleased: (isInterrupted) => {
setReleases([...releases, isInterrupted])
}
}
}, [myTheme, releases, setReleases])
return <div>
<p>
<a href="https://github.com/kiganix/rippleeffect">kiganix/rippleeffect</a>
</p>
<RippleEffect
as="div"
options={myOptions}
style={{
backgroundColor: '#eee',
borderRadius: '4px',
boxShadow: '0 2px 4px rgba(0, 0, 0, .25)',
paddingLeft: '24px',
paddingRight: '24px',
paddingTop: '8px',
paddingBottom: '8px',
userSelect: 'none',
}}>
<span>Hello World!</span>
</RippleEffect>
<pre>
{releases.map(itr => `isInterrupted: ${itr}`).join("\n")}
</pre>
</div>
}