forked from google/santa-tracker-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsanta-tutorial.scss
More file actions
94 lines (81 loc) · 3.37 KB
/
santa-tutorial.scss
File metadata and controls
94 lines (81 loc) · 3.37 KB
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
/**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
$tutorial-width: 275px;
$tutorial-height: 270px;
$tutorial-step-time: 1s;
:host {
}
// This is invisible, but is circular so as to provide a friendly dismiss target.
button {
pointer-events: auto;
cursor: pointer;
padding: 0;
margin: 0;
position: absolute;
opacity: 0;
border-radius: 100000px;
}
svg {
pointer-events: none;
opacity: 0.95;
transition: opacity 0.125s;
filter: drop-shadow(4px 12px 0 rgba(0, 0, 0, 0.15));
}
button:focus {
outline: none;
}
button:focus + svg {
opacity: 0.7;
}
.size {
width: $tutorial-width;
height: $tutorial-height;
overflow: hidden;
}
img {
animation-iteration-count: infinite;
animation-timing-function: step-end;
height: $tutorial-height;
}
video {
object-fit: cover;
}
img,
video {
pointer-events: none;
// This is the encoded cloud image that's included in the element as a clip-path; Safari won't
// apply foreignObject clip-path to img/video (because they are animated GPU players).
-webkit-mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIH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QzLjY3OCAzLjU4IDIyLjc4IDI0LjYzIDM4LjQ3IDQ3LjM1MyAzNS41NzIuMDEgMi40NTIuMjA0IDQuOTM1LjU5NyA3LjQzMyA0LjE3MyAyNi41NTQgMjkuMDg0IDQ0LjY5NyA1NS42MzcgNDAuNTIzeiIvPjwvZGVmcz48dXNlIHhsaW5rOmhyZWY9IiNhIiBvdmVyZmxvdz0idmlzaWJsZSIvPjwvc3ZnPg==);
}
// generate tutorial-steps-N, where it moves -275px each time
@for $i from 2 through 6 {
@keyframes tutorial-steps-#{$i} {
$part: (100 / $i);
@for $j from 0 through ($i - 1) {
#{$j * $part}% {
transform: translateX(-($j * $tutorial-width));
}
}
100% {
transform: translateX(0);
}
}
img.steps-#{$i} {
animation-name: tutorial-steps-#{$i};
animation-duration: $i * $tutorial-step-time;
width: $tutorial-width * $i;
}
}