-
Notifications
You must be signed in to change notification settings - Fork 3
/
usage.py
46 lines (40 loc) · 1.06 KB
/
usage.py
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
import dash
from dash import html
import feffery_utils_components as fuc
from dash.dependencies import Input, Output
app = dash.Dash(__name__)
app.layout = html.Div(
[
fuc.FefferyMotion(
'示例',
id='motion-demo',
style={
'border': '1px dashed #71afe5',
'width': '100px',
'height': '100px',
'display': 'flex',
'justifyContent': 'center',
'alignItems': 'center',
},
animate={
'transform': 'translateX(300px) rotate(180deg)',
'borderRadius': '100%',
},
transition={
'duration': 2,
},
destroyWhenAnimated=True,
),
html.Pre(id='animated'),
],
style={'padding': 50},
)
@app.callback(
Output('animated', 'children'),
Input('motion-demo', 'animated'),
prevent_initial_call=True,
)
def demo(animated):
return f'animated: {animated}'
if __name__ == '__main__':
app.run(debug=False)