summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/welcome/shared/onboarding_background.html
blob: 643c8eff8eecca4a531cc42cfed9d05764f29692 (plain)
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
<link rel="import" href="chrome://resources/html/polymer.html">

<dom-module id="onboarding-background">
  <template>
    <style>
      @keyframes blue-circle-anim-x {
        50% {
          animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
          transform: translateX(44px);
        }
      }

      @keyframes blue-circle-anim-y {
        50% {
          animation-timing-function: cubic-bezier(0.55, 0, 0.2, 1);
          transform: translateY(17px);
        }
      }

      @keyframes green-rectangle-anim {
        100% {
          transform: rotate(360deg);
        }
      }

      @keyframes red-triangle-anim {
        50% {
          animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
          transform: translateY(25px) rotate(-53deg);
        }
      }

      @keyframes yellow-semicircle-anim {
        40% {
          animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
          transform: translateY(40px) rotate(-1deg);
        }
      }

      @keyframes grey-rounded-rectangle-anim {
        65% {
          animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
          transform: translateY(-48px) rotate(-75deg);
        }
      }

      :host {
        bottom: 0;
        left: 0;
        margin: auto;
        overflow: hidden;
        position: absolute;
        right: 0;
        top: 0;
        z-index: -1;
      }

      /* The container is necessary in order for :host to hide overflowing SVGs
         correctly without disturbing their positions. */
      #container {
        height: 100%;
        left: 50%;
        min-height: 700px;
        min-width: 1024px;
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
      }

      img,
      span {
        position: absolute;
      }

      #blue-circle-container {
        animation: blue-circle-anim-x 9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        left: calc(13% - 50px);  /* Relative to #yellow-dots. */
        top: calc(18% - 26px);  /* Relative to #yellow-dots. */
      }

      #blue-circle-container::after {
        -webkit-mask: url(../images/background_svgs/blue_circle.svg) no-repeat
            top left;
        animation: blue-circle-anim-y 9s cubic-bezier(0.25, 0, 0.2, 1) infinite;
        background-color: var(--navi-shape-blue-color);
        content: ' '; /* Content needs to be non-empty */
        height: 43px;
        position: absolute;
        width: 43px;
      }

      #yellow-dots {
        -webkit-mask: url(../images/background_svgs/yellow_dots.svg) no-repeat
            top left;
        background-color: var(--navi-shape-yellow-dots-color);
        content: ' '; /* Content needs to be non-empty */
        height: 57px;
        left: 13%;
        top: 18%;
        width: 76px;
      }

      #grey-rounded-rectangle {
        -webkit-mask: url(../images/background_svgs/grey_rounded_rectangle.svg)
            no-repeat top left;
        animation: grey-rounded-rectangle-anim 10s cubic-bezier(0.4, 0, 0.2, 1)
            infinite;
        background-color: var(--navi-shape-grey-color);
        content: ' '; /* Content needs to be non-empty */
        height: 132px;
        left: -42px;
        top: 45%;
        width: 132px;
      }

      #red-triangle {
        -webkit-mask: url(../images/background_svgs/red_triangle.svg) no-repeat
            bottom left;
        animation: red-triangle-anim 9.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        background-color: var(--navi-shape-red-color);
        bottom: 15%;
        content: ' '; /* Content needs to be non-empty */
        height: 74px;
        left: 12%;
        width: 65px;
      }

      #yellow-semicircle {
        -webkit-mask: url(../images/background_svgs/yellow_semicircle.svg)
            no-repeat top right;
        animation: yellow-semicircle-anim 10s cubic-bezier(0.4, 0, 0.2, 1)
            infinite;
        background-color: var(--navi-shape-yellow-semicircle-color);
        content: ' '; /* Content needs to be non-empty */
        height: 171px;
        right: 28.5%;
        top: -50px;
        transform: rotate(-7deg);
        width: 211px;
      }

      #green-rectangle {
        -webkit-mask: url(../images/background_svgs/green_rectangle.svg)
            no-repeat bottom right;
        animation: green-rectangle-anim 40s infinite linear;
        background-color: var(--navi-shape-green-color);
        bottom: 8%;
        content: ' '; /* Content needs to be non-empty */
        height: 371px;
        right: -255px;
        width: 371px;
      }

      #grey-oval {
        -webkit-mask: url(../images/background_svgs/grey_oval.svg) no-repeat
            bottom right;
        background-color: var(--navi-shape-grey-color);
        bottom: calc(8% + 24px);  /* Relative to green-rectangle. */
        content: ' '; /* Content needs to be non-empty */
        height: 100px;
        mix-blend-mode: multiply;
        right: 48px;
        width: 100px;
      }

      @media (prefers-color-scheme: dark) {
        #grey-oval {
          mix-blend-mode: screen;
        }
      }
    </style>
    <div id="container">
      <!-- Using span as container for an :after element that actually contains
           the blue-circle svg, because the animation needs to curve so x and y
           needs to be animated separately. -->
      <span id="blue-circle-container"></span>
      <span id="green-rectangle"></span>
      <span id="grey-oval"></span>
      <span id="grey-rounded-rectangle"></span>
      <span id="red-triangle"></span>
      <span id="yellow-dots"></span>
      <span id="yellow-semicircle"></span>
    </div>
  </template>
  <script src="onboarding_background.js"></script>
</dom-module>