-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathRipplePage.tsx
206 lines (174 loc) · 7.11 KB
/
RipplePage.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import { tag, Component, bind } from 'omi'
import { Collapse, Ripple, Modal, Input } from 'omi-elements'
import { tailwind } from '@/tailwind'
import '@/components/code-showcase'
import RippleBasicExample from './examples/RippleBasicExample'
import RippleImage from './examples/RippleImage'
import RippleColors1 from './examples/RippleColors1'
import RippleColors2 from './examples/RippleColors2'
import RippleColors3 from './examples/RippleColors3'
import RippleDuration from './examples/RippleDuration'
import RippleCentered from './examples/RippleCentered'
import RippleUnbound from './examples/RippleUnbound'
import RippleRadius from './examples/RippleRadius'
import RippleBasicExampleCode from './examples/RippleBasicExample?raw'
import RippleImageCode from './examples/RippleImage?raw'
import RippleColors1Code from './examples/RippleColors1?raw'
import RippleColors2Code from './examples/RippleColors2?raw'
import RippleColors3Code from './examples/RippleColors3?raw'
import RippleDurationCode from './examples/RippleDuration?raw'
import RippleCenteredCode from './examples/RippleCentered?raw'
import RippleUnboundCode from './examples/RippleUnbound?raw'
import RippleRadiusCode from './examples/RippleRadius?raw'
@tag('ripple-page')
export default class RipplePage extends Component {
static css = [tailwind]
render() {
return (
<div className="container my-12 !max-w-full">
{/* <!-- Section: Basic example --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="basic-example" data-te-spy-item>
Basic example
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
The ripple effect is a way to let the user know that there has been a click interaction. You can easily add
a ripple effect to the buttons.
</p>
<code-showcase code={RippleBasicExampleCode}>
<RippleBasicExample.tagName />
</code-showcase>
</section>
{/* <!-- Section: Basic example --> */}
<hr className="my-12" />
{/* <!-- Section: Image --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="image" data-te-spy-item>
Image
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
You can also easily add the ripple effect to images, by wrapping them between <code>TERipple</code> tags.
</p>
<code-showcase code={RippleImageCode}>
<RippleImage.tagName />
</code-showcase>
</section>
{/* <!-- Section: Image --> */}
<hr className="my-12" />
{/* <!-- Section: Colors --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="colors" data-te-spy-item>
Colors
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
You can easily manipulate the color of the ripple effect to suit your needs. By using
<code>rippleColor</code> prop you can change its color. You can also change the color in darkmode by using{' '}
<code>rippleColorDark</code> prop.
</p>
<code-showcase code={RippleColors1Code}>
<RippleColors1.tagName />
</code-showcase>
</section>
{/* <!-- Section: Colors --> */}
{/* <!-- Section: Colors 2 --> */}
<section>
{/* <!-- Title --> */}
<h3 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="colors2"></h3>
{/* <!-- Description --> */}
<p className="mb-3"></p>
<code-showcase code={RippleColors2Code}>
<RippleColors2.tagName />
</code-showcase>
</section>
{/* <!-- Section: Colors 2 --> */}
{/* <!-- Section: Colors 3 --> */}
<section>
{/* <!-- Title --> */}
<h3 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="colors3"></h3>
{/* <!-- Description --> */}
<p className="mb-3"></p>
<code-showcase code={RippleColors3Code}>
<RippleColors3.tagName />
</code-showcase>
</section>
{/* <!-- Section: Colors 3 --> */}
<hr className="my-12" />
{/* <!-- Section: Duration --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="duration" data-te-spy-item>
Duration
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
If you don't want the ripple effect to move on the button too quickly, use
<code>rippleDuration</code> prop and modify the duration of the ripple.
</p>
<code-showcase code={RippleDurationCode}>
<RippleDuration.tagName />
</code-showcase>
</section>
{/* <!-- Section: Duration --> */}
<hr className="my-12" />
{/* <!-- Section: Centered --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="centered" data-te-spy-item>
Centered
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
If you add the prop <code>rippleCentered</code>, the ripple will always start at the center of the element,
not at the affected location.
</p>
<code-showcase code={RippleCenteredCode}>
<RippleCentered.tagName />
</code-showcase>
</section>
{/* <!-- Section: Centered --> */}
<hr className="my-12" />
{/* <!-- Section: Unbound --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="unbound" data-te-spy-item>
Unbound
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
If you use the <code>rippleUnbound</code> prop, the ripple will not be bound to the element and will extend
beyond its boundaries.
</p>
<code-showcase code={RippleUnboundCode}>
{' '}
<RippleUnbound.tagName />
</code-showcase>
</section>
{/* <!-- Section: Unbound --> */}
<hr className="my-12" />
{/* <!-- Section: Radius --> */}
<section>
{/* <!-- Title --> */}
<h2 className="mb-5 mt-0 text-3xl font-semibold leading-normal" id="radius" data-te-spy-item>
Radius
</h2>
{/* <!-- Description --> */}
<p className="mb-3">
The <code>rippleRadius</code> prop can be used to modify the ripple radius. The numeric value is expressed
in pixels, for example:
<code>rippleRadius={10}</code>
</p>
<code-showcase code={RippleRadiusCode}>
<RippleRadius.tagName />
</code-showcase>
</section>
{/* <!-- Section: Radius --> */}
</div>
)
}
}