-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
291 lines (260 loc) · 12.2 KB
/
index.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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Webcomponent - tooltip</title>
<link rel="stylesheet" href="normalize.css">
<style>
:root {
--blue-50: #8DCDFF;
--blue-100: #78C5FF;
--blue-200: #4FB3FF;
--blue-300: #27A1FF;
--blue-400: #008FFD;
--blue-500: #0078D4;
--blue-600: #00589C;
--blue-700: #003864;
--blue-800: #00192C;
--blue-900: #000000;
--blue-950: #000000;
--orange-50: #FFD4B8;
--orange-100: #FFC7A3;
--orange-200: #FFAE7A;
--orange-300: #FF9652;
--orange-400: #FF7D29;
--orange-500: #FF6400;
--orange-600: #C74E00;
--orange-700: #8F3800;
--orange-800: #572200;
--orange-900: #1F0C00;
--orange-950: #030100;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: #1d1d1f;
background-color: #1d1d1f;
}
.container {
max-width: 1536px;
margin: 0 auto;
padding: 1rem;
background-color: white;
}
.inline {
display: flex;
align-items: baseline;
gap: 0.5rem;
& h2 {
font-weight: normal;
}
}
.carousel {
display: flex;
gap: 1rem;
& .box {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
padding: 1rem;
& .image {
width: 200px;
height: 300px;
}
& img {
width: 100%;
height: auto;
}
}
}
.showcase {
display: flex;
align-items: flex-start;
gap: 0.5rem;
flex-direction: column;
}
</style>
</head>
<body>
<div class="container">
<h2>Product carousel example</h2>
<div class="carousel">
<div class="box">
<div class="image"><img src="https://picsum.photos/200/300" alt=""></div>
<div>Product name 1
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
</div>
<div class="box">
<div class="image"><img src="https://picsum.photos/200/300" alt=""></div>
<div>Product name 1
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
</div>
<div class="box">
<div class="image"><img src="https://picsum.photos/200/300" alt=""></div>
<div>Product name 1
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
</div>
<div class="box">
<div class="image"><img src="https://picsum.photos/200/300" alt=""></div>
<div>Product name 1
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
</div>
<div class="box">
<div class="image"><img src="https://picsum.photos/200/300" alt=""></div>
<div>Product name 1
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
</div>
<div class="box">
<div class="image"><img src="https://picsum.photos/200/300" alt=""></div>
<div>Product name 1
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
</div>
</div>
<h2>Content wrapped inside will get a tooltip</h2>
<div style="width: 100%; text-align: left;">
<popup-info data-html="true" theme="dark"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
<h2>Content wrapped inside will get a tooltip -- on right</h2>
<div style="width: 100%; text-align: right;">
<popup-info data-html="true"
data-text="First, we'll look at an autonomous custom element. The <code><span style="background:red;color:white">foto</span></code>
custom element takes an image icon and a text string as attributes, and embeds the icon into the page. When the icon is focused, it displays the text in a pop up information box to provide further in-context information."
size="100">
<img src="settings-icon.svg">
</popup-info>
</div>
<h2>Buttons</h2>
<div class="showcase">
<c-button>
<template shadowrootmode="open">
<link rel="stylesheet" href="c-button.css" />
<button variant="primary" size="small">
<slot></slot>
</button>
</template>
Lorem
</c-button>
<c-button>
<template shadowrootmode="open">
<link rel="stylesheet" href="c-button.css" />
<button variant="primary" size="default">
<slot></slot>
</button>
</template>
Add to cart
</c-button>
<c-button>
<template shadowrootmode="open">
<link rel="stylesheet" href="c-button.css" />
<button variant="accent" size="default">
<slot></slot>
</button>
</template>
Add to cart
</c-button>
</div>
<h2>
Stars - rating
</h2>
<div class="showcase">
<c-stars stars=" 1" style="--size:1.5rem">
<template shadowrootmode="open">
<link rel="stylesheet" href="src/stars/stars.css" />
<div class="stars-wrapper">
<span class="stars"></span>
</div>
</template>
</c-stars>
<c-stars stars="2" style="--size:1.5rem">
<template shadowrootmode="open">
<link rel="stylesheet" href="src/stars/stars.css" />
<div class="stars-wrapper">
<span class="stars"></span>
</div>
</template>
</c-stars>
<c-stars stars="4" style="--size:1.5rem">
<template shadowrootmode="open">
<link rel="stylesheet" href="src/stars/stars.css" />
<div class="stars-wrapper">
<span class="stars"></span>
</div>
</template>
</c-stars>
<h4>With size</h4>
<c-stars stars="3" style="--size:1rem">
<template shadowrootmode="open">
<link rel="stylesheet" href="src/stars/stars.css" />
<div class="stars-wrapper">
<span class="stars"></span>
</div>
</template>
</c-stars>
<h4>With legend</h4>
<c-stars stars="5" style="--size:1.5rem">
<legend slot="stars-slot">5,0</legend>
<template shadowrootmode="open">
<link rel="stylesheet" href="src/stars/stars.css" />
<div class="stars-wrapper">
<slot name="stars-slot" class="stars-slot"></slot>
<span class="stars"></span>
</div>
</template>
</c-stars>
</div>
<h2>Example 2 - render icon (?) with tooltip</h2>
<div class="inline">
<tooltip-info data-html="true"
data-text="This property is part of our Preferred Plus Program. It's committed to providing outstanding service and excellent value. It'll pay us a higher commission if you make a booking."
size="24">
</tooltip-info>
<h2>Hotel reviews</h2>
</div>
<script src="popup.js" defer></script>
<script src="tooltip.js" defer></script>
<script src="c-button.js" defer></script>
<script src="src/stars/stars.js" defer></script>
</body>
</html>