/
scroll-fab.html
47 lines (37 loc) · 1.11 KB
/
scroll-fab.html
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
<style>
.fab {
position: fixed;
right: 16px;
bottom: 16px;
background-color: var(--app-accent-color);
color: var(--app-accent-color-text);
opacity: 0;
transform: rotate(120deg) scale(0.5, 0.5);
transition: transform 0.3s var(--custom-ease, ease-out), opacity 0.15s ease-in 0.1s;
pointer-events: none;
}
.fab-entry {
opacity: 1;
transition: none;
transform: rotate(0deg) scale(1, 1);
animation: zoomInRight 0.5s;
pointer-events: auto;
}
@keyframes zoomInRight {
from {
opacity: 0;
transform: scale3d(0.1, 0.1, 0.1) translate3d(256px, 0, 0);
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}
60% {
opacity: 1;
transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
}
}
</style>
<paper-fab id="fab"
class="fab"
icon="app-icons:arrow-upward"
on-click="__scrollToTopFabClicked">
</paper-fab>