MatteoScript commited on
Commit
2c3eed5
·
verified ·
1 Parent(s): 3df2624

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +199 -173
index.html CHANGED
@@ -32,9 +32,8 @@
32
  --rose: #EDD3CD;
33
  --cream: #F3EFE9;
34
  --paper: #FFFDF8;
35
- --line: rgba(37, 75, 107, .13);
36
- --line-soft: rgba(147, 150, 117, .24);
37
- --shadow: 0 18px 46px rgba(37, 75, 107, .10);
38
  --font-main: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
39
  --font-script: "Amsterdam One", "Great Vibes", "Snell Roundhand", cursive;
40
  }
@@ -44,104 +43,87 @@
44
  html,
45
  body {
46
  width: 100%;
47
- min-height: 100%;
48
  margin: 0;
 
49
  font-family: var(--font-main);
50
  color: var(--blue);
51
  background: var(--cream);
52
- overflow-x: hidden;
53
  }
54
 
55
  body {
56
- height: 100svh;
57
- min-height: 100svh;
58
- overflow: hidden;
59
- background:
60
- linear-gradient(180deg, #fffdf8 0%, #f8f4ee 54%, #f3efe9 100%);
61
- }
62
-
63
- body.reveal-open {
64
- overflow: hidden;
65
  }
66
 
67
  .screen {
68
  position: relative;
69
- height: 100svh;
70
- min-height: 100svh;
 
71
  display: flex;
72
  justify-content: center;
73
  overflow: hidden;
74
  }
75
 
76
- .screen::before {
 
77
  content: "";
78
  position: fixed;
79
- inset: 18px;
80
- border: 1px solid rgba(147, 150, 117, .22);
81
  border-radius: 28px;
82
  pointer-events: none;
83
- }
84
-
85
- .screen::after {
86
- content: "";
87
- position: fixed;
88
- left: 50%;
89
- top: 52%;
90
- width: min(78vw, 420px);
91
- height: min(78vw, 420px);
92
- border-radius: 999px;
93
- transform: translate(-50%, -50%);
94
- background: rgba(237, 211, 205, .18);
95
- pointer-events: none;
96
- filter: blur(.2px);
97
  }
98
 
99
  .page {
100
  position: relative;
101
  z-index: 1;
102
  width: min(100%, 500px);
103
- height: 100svh;
104
- min-height: 100svh;
105
- padding: max(22px, env(safe-area-inset-top)) 28px max(20px, env(safe-area-inset-bottom));
106
  display: grid;
107
- grid-template-rows: auto 1fr auto;
 
108
  overflow: hidden;
109
  }
110
 
111
  .top-mark {
112
  display: flex;
113
- justify-content: center;
114
  align-items: center;
115
- min-height: 38px;
116
- background: transparent;
117
  }
118
 
119
  .logo {
120
- width: 50px;
121
- height: 50px;
122
  display: block;
123
  object-fit: contain;
124
  background: transparent;
125
- opacity: .86;
126
- mix-blend-mode: multiply;
127
- filter: contrast(1.08) saturate(.92);
128
  }
129
 
130
  .hero {
131
- align-self: center;
 
 
 
 
132
  text-align: center;
133
- padding: 4px 0 14px;
134
  }
135
 
136
  .script-title {
137
  margin: 0 auto;
138
- max-width: 390px;
139
  color: var(--blue);
140
  font-family: var(--font-script);
141
- font-size: clamp(54px, 15.5vw, 92px);
142
  font-weight: 400;
143
- line-height: .76;
144
- letter-spacing: -.035em;
145
  text-wrap: balance;
146
  }
147
 
@@ -150,37 +132,42 @@
150
  }
151
 
152
  .script-title span:first-child {
153
- transform: translateX(-.06em);
154
  }
155
 
156
  .script-title span:last-child {
 
157
  margin-top: -.02em;
158
- transform: translateX(.08em);
159
  }
160
 
161
  .island-line {
162
- width: min(48vw, 220px);
163
- max-height: 150px;
164
- margin: clamp(18px, 3.5svh, 30px) auto 0;
 
 
 
 
165
  overflow: hidden;
166
  }
167
 
168
  .island-img {
169
- width: 100%;
170
- max-height: 150px;
 
171
  height: auto;
172
  display: block;
173
  object-fit: contain;
174
  opacity: 1;
 
 
175
  filter: none;
176
- animation: none;
177
  transform: none;
178
- mix-blend-mode: multiply;
179
  }
180
 
181
  .form-area {
182
- align-self: end;
183
- padding-bottom: clamp(6px, 2.4svh, 26px);
184
  }
185
 
186
  .field-label {
@@ -193,14 +180,10 @@
193
  text-transform: uppercase;
194
  }
195
 
196
- .input-panel {
197
- padding: 0;
198
- }
199
-
200
  input {
201
  width: 100%;
202
- min-height: 62px;
203
- border: 1px solid var(--line-soft);
204
  outline: 0;
205
  border-radius: 999px;
206
  padding: 0 22px;
@@ -209,7 +192,7 @@
209
  font-family: var(--font-main);
210
  font-size: 16px;
211
  font-weight: 600;
212
- box-shadow: 0 10px 28px rgba(37, 75, 107, .07);
213
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
214
  }
215
 
@@ -219,27 +202,27 @@
219
  }
220
 
221
  input:focus {
222
- border-color: rgba(208, 138, 122, .72);
223
- background: #fffdf8;
224
  box-shadow: 0 0 0 5px rgba(237, 211, 205, .28), 0 12px 30px rgba(37, 75, 107, .08);
225
  }
226
 
227
  .discover {
228
  position: relative;
229
  width: 100%;
230
- min-height: 62px;
231
  margin-top: 12px;
232
  border: 0;
233
  border-radius: 999px;
234
- overflow: hidden;
235
  cursor: pointer;
 
236
  color: var(--paper);
237
  background: var(--blue);
238
  font-family: var(--font-main);
239
  font-size: 15px;
240
  font-weight: 800;
241
  letter-spacing: .02em;
242
- box-shadow: 0 14px 32px rgba(37, 75, 107, .18);
243
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
244
  }
245
 
@@ -247,8 +230,8 @@
247
  content: "";
248
  position: absolute;
249
  left: 50%;
250
- bottom: 10px;
251
- width: 56px;
252
  height: 2px;
253
  border-radius: 999px;
254
  background: var(--coral);
@@ -258,15 +241,15 @@
258
  .discover:active {
259
  transform: translateY(2px);
260
  background: #1f405b;
261
- box-shadow: 0 8px 22px rgba(37, 75, 107, .16);
262
  }
263
 
264
  .message {
265
  min-height: 0;
266
- margin-top: 12px;
267
  opacity: 0;
268
  transform: translateY(8px);
269
- transition: opacity .24s ease, transform .24s ease;
270
  }
271
 
272
  .message.show {
@@ -276,9 +259,9 @@
276
 
277
  .message-card {
278
  border-radius: 18px;
279
- padding: 14px 16px;
280
  color: rgba(37, 75, 107, .78);
281
- background: rgba(255, 253, 248, .86);
282
  border: 1px solid rgba(147, 150, 117, .22);
283
  text-align: center;
284
  font-size: 13px;
@@ -293,71 +276,39 @@
293
  z-index: 20;
294
  display: grid;
295
  place-items: center;
296
- padding: max(28px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
297
  color: var(--blue);
298
- background:
299
- linear-gradient(180deg, #fffdf8 0%, #f8f4ee 54%, #f3efe9 100%);
300
  opacity: 0;
301
  visibility: hidden;
302
  pointer-events: none;
303
- transform: scale(1.012);
304
- transition: opacity .34s ease, transform .34s ease, visibility 0s linear .34s;
305
  overflow: hidden;
306
  }
307
 
308
- .reveal::before {
309
- content: "";
310
- position: fixed;
311
- inset: 18px;
312
- border: 1px solid rgba(147, 150, 117, .22);
313
- border-radius: 28px;
314
- pointer-events: none;
315
- }
316
-
317
- .reveal::after {
318
- content: "";
319
- position: absolute;
320
- left: 50%;
321
- top: 45%;
322
- width: min(82vw, 430px);
323
- height: min(82vw, 430px);
324
- border-radius: 999px;
325
- transform: translate(-50%, -50%);
326
- background: rgba(237, 211, 205, .18);
327
- pointer-events: none;
328
- }
329
-
330
  .reveal.show {
331
  opacity: 1;
332
  visibility: visible;
333
  pointer-events: auto;
334
  transform: scale(1);
335
- transition: opacity .34s ease, transform .34s ease, visibility 0s;
336
  }
337
 
338
  .reveal-page {
339
  position: relative;
340
- z-index: 2;
341
  width: min(100%, 560px);
342
- min-height: min(86svh, 780px);
343
  display: flex;
344
  flex-direction: column;
345
  justify-content: center;
346
  text-align: center;
347
- animation: revealIn .56s cubic-bezier(.2,.9,.18,1.08) both;
348
- }
349
-
350
- .reveal.show .reveal-page {
351
- animation: revealIn .56s cubic-bezier(.2,.9,.18,1.08) both;
352
- }
353
-
354
- @keyframes revealIn {
355
- from { opacity: 0; transform: translateY(18px); }
356
- to { opacity: 1; transform: translateY(0); }
357
  }
358
 
359
  .hello {
360
- margin: 0 0 clamp(22px, 5svh, 38px);
361
  color: rgba(37, 75, 107, .66);
362
  font-size: clamp(15px, 4vw, 19px);
363
  font-weight: 500;
@@ -378,41 +329,36 @@
378
  max-width: 11ch;
379
  color: var(--blue);
380
  font-family: var(--font-script);
381
- font-size: clamp(76px, 23vw, 146px);
382
  font-weight: 400;
383
- line-height: .74;
384
  letter-spacing: -.035em;
385
  text-wrap: balance;
386
  }
387
 
388
  .table-name[data-long="true"] {
389
  max-width: 12ch;
390
- font-size: clamp(58px, 18vw, 112px);
391
  }
392
 
393
  .reveal-island {
394
- width: min(42vw, 180px);
395
- max-height: 120px;
396
- margin: clamp(18px, 3.5svh, 28px) auto 0;
 
 
 
397
  overflow: hidden;
398
- }
399
-
400
- .reveal-island .island-img {
401
- max-height: 120px;
402
- opacity: .22;
403
- filter: none;
404
- animation: none;
405
- transform: none;
406
- mix-blend-mode: multiply;
407
  }
408
 
409
  .reveal-line {
410
- width: 88px;
411
  height: 2px;
412
- margin: clamp(18px, 3.5svh, 28px) auto 0;
413
  border-radius: 999px;
414
  background: var(--olive);
415
- opacity: .68;
416
  }
417
 
418
  .reveal-note {
@@ -426,14 +372,14 @@
426
 
427
  .again {
428
  align-self: center;
429
- min-height: 52px;
430
- margin-top: clamp(20px, 4svh, 30px);
431
  border: 1px solid rgba(37, 75, 107, .14);
432
  border-radius: 999px;
433
  padding: 0 24px;
434
  color: var(--blue);
435
- background: rgba(255, 253, 248, .88);
436
- box-shadow: 0 14px 32px rgba(37, 75, 107, .09);
437
  font-family: var(--font-main);
438
  font-size: 13px;
439
  font-weight: 800;
@@ -461,23 +407,14 @@
461
 
462
  @media (max-width: 380px) {
463
  .screen::before, .reveal::before { inset: 12px; border-radius: 24px; }
464
- .page { padding-left: 22px; padding-right: 22px; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
465
- .logo { width: 44px; height: 44px; }
466
- .script-title { font-size: clamp(50px, 15vw, 78px); }
467
- .island-line { width: min(44vw, 180px); max-height: 120px; margin-top: 18px; }
468
- .island-img { max-height: 120px; }
469
- input, .discover { min-height: 56px; }
470
- .table-name { font-size: clamp(62px, 20vw, 104px); }
471
- .table-name[data-long="true"] { font-size: clamp(52px, 17vw, 94px); }
472
- }
473
-
474
- @media (prefers-reduced-motion: reduce) {
475
- *, *::before, *::after {
476
- animation-duration: .001ms !important;
477
- animation-iteration-count: 1 !important;
478
- transition-duration: .001ms !important;
479
- scroll-behavior: auto !important;
480
- }
481
  }
482
  </style>
483
  </head>
@@ -487,7 +424,7 @@
487
  <main class="screen">
488
  <div class="page">
489
  <div class="top-mark">
490
- <img class="logo" src="logo.png" alt="Logo matrimonio" />
491
  </div>
492
 
493
  <section class="hero" aria-label="Trova la tua cala">
@@ -497,16 +434,14 @@
497
  </h1>
498
 
499
  <div class="island-line" aria-hidden="true">
500
- <img class="island-img" src="isola_.png" alt="" />
501
  </div>
502
  </section>
503
 
504
  <section class="form-area" aria-label="Ricerca invitato">
505
  <label class="field-label" for="guestName">Nome e cognome</label>
506
- <div class="input-panel">
507
- <input id="guestName" autocomplete="name" inputmode="text" placeholder="Es. Gaia Pollastrini" />
508
- <button class="discover" id="discover" type="button">Scopri il Tavolo</button>
509
- </div>
510
  <div id="message" class="message" aria-live="polite"></div>
511
  <div id="status" class="status" aria-live="polite"></div>
512
  </section>
@@ -519,7 +454,7 @@
519
  <p class="table-kicker">Il tuo tavolo è</p>
520
  <h2 class="table-name" id="tableName"></h2>
521
  <div class="reveal-island" aria-hidden="true">
522
- <img class="island-img" src="isola.png" alt="" />
523
  </div>
524
  <div class="reveal-line" aria-hidden="true"></div>
525
  <p class="reveal-note">In che cala cenerai? L’hai appena scoperto.</p>
@@ -528,10 +463,20 @@
528
  </section>
529
 
530
  <script>
531
- const DATA_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSlb-0cSIFaGN_BWrn_S9tQoQsdqGH7qYRYQGC3_3wRB-rGzwZoPoxIBNr9l6NmxW9Ont82YKIdGKIR/pub?output=csv";
532
 
533
  const SAMPLE_CSV = `
534
-
 
 
 
 
 
 
 
 
 
 
535
  `;
536
 
537
  const els = {
@@ -674,7 +619,7 @@
674
  hideTimer = window.setTimeout(() => {
675
  els.input.value = "";
676
  els.message.classList.remove("show");
677
- }, 360);
678
  }
679
 
680
  function discoverTable() {
@@ -704,6 +649,86 @@
704
  .replaceAll("'", "&#039;");
705
  }
706
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  els.discover.addEventListener("click", discoverTable);
708
  els.again.addEventListener("click", hideReveal);
709
  els.input.addEventListener("keydown", event => {
@@ -730,7 +755,7 @@
730
  const centerX = window.innerWidth / 2;
731
  const centerY = window.innerHeight * .36;
732
 
733
- confetti = Array.from({ length: 90 }, () => {
734
  const angle = Math.random() * Math.PI * 2;
735
  const speed = 3 + Math.random() * 6;
736
  return {
@@ -743,7 +768,7 @@
743
  rotation: Math.random() * Math.PI,
744
  spin: (Math.random() - .5) * .24,
745
  color: colors[Math.floor(Math.random() * colors.length)],
746
- life: 86 + Math.random() * 36
747
  };
748
  });
749
 
@@ -789,6 +814,7 @@
789
  }
790
 
791
  window.addEventListener("resize", resizeCanvas);
 
792
  loadGuests();
793
  </script>
794
  </body>
 
32
  --rose: #EDD3CD;
33
  --cream: #F3EFE9;
34
  --paper: #FFFDF8;
35
+ --border: rgba(147, 150, 117, .22);
36
+ --shadow: 0 16px 38px rgba(37, 75, 107, .10);
 
37
  --font-main: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
38
  --font-script: "Amsterdam One", "Great Vibes", "Snell Roundhand", cursive;
39
  }
 
43
  html,
44
  body {
45
  width: 100%;
46
+ height: 100%;
47
  margin: 0;
48
+ overflow: hidden;
49
  font-family: var(--font-main);
50
  color: var(--blue);
51
  background: var(--cream);
 
52
  }
53
 
54
  body {
55
+ min-height: 100dvh;
56
+ background: linear-gradient(180deg, #fffdf8 0%, #f7f2ec 100%);
 
 
 
 
 
 
 
57
  }
58
 
59
  .screen {
60
  position: relative;
61
+ width: 100%;
62
+ height: 100dvh;
63
+ min-height: 100dvh;
64
  display: flex;
65
  justify-content: center;
66
  overflow: hidden;
67
  }
68
 
69
+ .screen::before,
70
+ .reveal::before {
71
  content: "";
72
  position: fixed;
73
+ inset: 16px;
74
+ border: 1px solid var(--border);
75
  border-radius: 28px;
76
  pointer-events: none;
77
+ z-index: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  }
79
 
80
  .page {
81
  position: relative;
82
  z-index: 1;
83
  width: min(100%, 500px);
84
+ height: 100dvh;
85
+ padding: max(20px, env(safe-area-inset-top)) 28px max(18px, env(safe-area-inset-bottom));
 
86
  display: grid;
87
+ grid-template-rows: 58px minmax(0, 1fr) auto;
88
+ gap: 10px;
89
  overflow: hidden;
90
  }
91
 
92
  .top-mark {
93
  display: flex;
 
94
  align-items: center;
95
+ justify-content: center;
 
96
  }
97
 
98
  .logo {
99
+ width: 54px;
100
+ height: 54px;
101
  display: block;
102
  object-fit: contain;
103
  background: transparent;
104
+ opacity: .96;
105
+ mix-blend-mode: normal;
106
+ filter: none;
107
  }
108
 
109
  .hero {
110
+ min-height: 0;
111
+ display: flex;
112
+ flex-direction: column;
113
+ align-items: center;
114
+ justify-content: center;
115
  text-align: center;
116
+ padding: 2px 0 8px;
117
  }
118
 
119
  .script-title {
120
  margin: 0 auto;
 
121
  color: var(--blue);
122
  font-family: var(--font-script);
123
+ font-size: clamp(50px, 13vw, 78px);
124
  font-weight: 400;
125
+ line-height: .82;
126
+ letter-spacing: -.025em;
127
  text-wrap: balance;
128
  }
129
 
 
132
  }
133
 
134
  .script-title span:first-child {
135
+ transform: translateX(-.04em);
136
  }
137
 
138
  .script-title span:last-child {
139
+ transform: translateX(.05em);
140
  margin-top: -.02em;
 
141
  }
142
 
143
  .island-line {
144
+ width: min(34vw, 150px);
145
+ max-width: 150px;
146
+ height: 118px;
147
+ margin: clamp(16px, 3dvh, 26px) auto 0;
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: center;
151
  overflow: hidden;
152
  }
153
 
154
  .island-img {
155
+ max-width: 100%;
156
+ max-height: 100%;
157
+ width: auto;
158
  height: auto;
159
  display: block;
160
  object-fit: contain;
161
  opacity: 1;
162
+ background: transparent;
163
+ mix-blend-mode: normal;
164
  filter: none;
 
165
  transform: none;
166
+ animation: none;
167
  }
168
 
169
  .form-area {
170
+ padding-bottom: clamp(2px, 1.6dvh, 16px);
 
171
  }
172
 
173
  .field-label {
 
180
  text-transform: uppercase;
181
  }
182
 
 
 
 
 
183
  input {
184
  width: 100%;
185
+ height: 60px;
186
+ border: 1px solid rgba(147, 150, 117, .30);
187
  outline: 0;
188
  border-radius: 999px;
189
  padding: 0 22px;
 
192
  font-family: var(--font-main);
193
  font-size: 16px;
194
  font-weight: 600;
195
+ box-shadow: 0 10px 26px rgba(37, 75, 107, .07);
196
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
197
  }
198
 
 
202
  }
203
 
204
  input:focus {
205
+ border-color: rgba(208, 138, 122, .70);
206
+ background: var(--paper);
207
  box-shadow: 0 0 0 5px rgba(237, 211, 205, .28), 0 12px 30px rgba(37, 75, 107, .08);
208
  }
209
 
210
  .discover {
211
  position: relative;
212
  width: 100%;
213
+ height: 60px;
214
  margin-top: 12px;
215
  border: 0;
216
  border-radius: 999px;
 
217
  cursor: pointer;
218
+ overflow: hidden;
219
  color: var(--paper);
220
  background: var(--blue);
221
  font-family: var(--font-main);
222
  font-size: 15px;
223
  font-weight: 800;
224
  letter-spacing: .02em;
225
+ box-shadow: 0 14px 32px rgba(37, 75, 107, .17);
226
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
227
  }
228
 
 
230
  content: "";
231
  position: absolute;
232
  left: 50%;
233
+ bottom: 9px;
234
+ width: 54px;
235
  height: 2px;
236
  border-radius: 999px;
237
  background: var(--coral);
 
241
  .discover:active {
242
  transform: translateY(2px);
243
  background: #1f405b;
244
+ box-shadow: 0 8px 22px rgba(37, 75, 107, .14);
245
  }
246
 
247
  .message {
248
  min-height: 0;
249
+ margin-top: 10px;
250
  opacity: 0;
251
  transform: translateY(8px);
252
+ transition: opacity .22s ease, transform .22s ease;
253
  }
254
 
255
  .message.show {
 
259
 
260
  .message-card {
261
  border-radius: 18px;
262
+ padding: 13px 15px;
263
  color: rgba(37, 75, 107, .78);
264
+ background: rgba(255, 253, 248, .90);
265
  border: 1px solid rgba(147, 150, 117, .22);
266
  text-align: center;
267
  font-size: 13px;
 
276
  z-index: 20;
277
  display: grid;
278
  place-items: center;
279
+ padding: max(24px, env(safe-area-inset-top)) 24px max(22px, env(safe-area-inset-bottom));
280
  color: var(--blue);
281
+ background: linear-gradient(180deg, #fffdf8 0%, #f7f2ec 100%);
 
282
  opacity: 0;
283
  visibility: hidden;
284
  pointer-events: none;
285
+ transform: scale(1.01);
286
+ transition: opacity .30s ease, transform .30s ease, visibility 0s linear .30s;
287
  overflow: hidden;
288
  }
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  .reveal.show {
291
  opacity: 1;
292
  visibility: visible;
293
  pointer-events: auto;
294
  transform: scale(1);
295
+ transition: opacity .30s ease, transform .30s ease, visibility 0s;
296
  }
297
 
298
  .reveal-page {
299
  position: relative;
300
+ z-index: 1;
301
  width: min(100%, 560px);
302
+ height: 100%;
303
  display: flex;
304
  flex-direction: column;
305
  justify-content: center;
306
  text-align: center;
307
+ overflow: hidden;
 
 
 
 
 
 
 
 
 
308
  }
309
 
310
  .hello {
311
+ margin: 0 0 clamp(20px, 4dvh, 34px);
312
  color: rgba(37, 75, 107, .66);
313
  font-size: clamp(15px, 4vw, 19px);
314
  font-weight: 500;
 
329
  max-width: 11ch;
330
  color: var(--blue);
331
  font-family: var(--font-script);
332
+ font-size: clamp(72px, 22vw, 138px);
333
  font-weight: 400;
334
+ line-height: .76;
335
  letter-spacing: -.035em;
336
  text-wrap: balance;
337
  }
338
 
339
  .table-name[data-long="true"] {
340
  max-width: 12ch;
341
+ font-size: clamp(54px, 17vw, 104px);
342
  }
343
 
344
  .reveal-island {
345
+ width: min(30vw, 132px);
346
+ height: 100px;
347
+ margin: clamp(18px, 3.2dvh, 26px) auto 0;
348
+ display: flex;
349
+ align-items: center;
350
+ justify-content: center;
351
  overflow: hidden;
352
+ opacity: .34;
 
 
 
 
 
 
 
 
353
  }
354
 
355
  .reveal-line {
356
+ width: 82px;
357
  height: 2px;
358
+ margin: clamp(14px, 2.8dvh, 24px) auto 0;
359
  border-radius: 999px;
360
  background: var(--olive);
361
+ opacity: .58;
362
  }
363
 
364
  .reveal-note {
 
372
 
373
  .again {
374
  align-self: center;
375
+ height: 52px;
376
+ margin-top: clamp(20px, 4dvh, 30px);
377
  border: 1px solid rgba(37, 75, 107, .14);
378
  border-radius: 999px;
379
  padding: 0 24px;
380
  color: var(--blue);
381
+ background: rgba(255, 253, 248, .90);
382
+ box-shadow: 0 14px 32px rgba(37, 75, 107, .08);
383
  font-family: var(--font-main);
384
  font-size: 13px;
385
  font-weight: 800;
 
407
 
408
  @media (max-width: 380px) {
409
  .screen::before, .reveal::before { inset: 12px; border-radius: 24px; }
410
+ .page { padding-left: 22px; padding-right: 22px; grid-template-rows: 52px minmax(0, 1fr) auto; }
411
+ .logo { width: 48px; height: 48px; }
412
+ .script-title { font-size: clamp(48px, 14vw, 70px); }
413
+ .island-line { width: min(32vw, 125px); height: 96px; margin-top: 14px; }
414
+ input, .discover { height: 56px; }
415
+ .table-name { font-size: clamp(62px, 20vw, 106px); }
416
+ .table-name[data-long="true"] { font-size: clamp(50px, 16vw, 88px); }
417
+ .reveal-island { width: min(28vw, 112px); height: 84px; }
 
 
 
 
 
 
 
 
 
418
  }
419
  </style>
420
  </head>
 
424
  <main class="screen">
425
  <div class="page">
426
  <div class="top-mark">
427
+ <img class="logo clean-bg" src="logo.png" alt="Logo matrimonio" />
428
  </div>
429
 
430
  <section class="hero" aria-label="Trova la tua cala">
 
434
  </h1>
435
 
436
  <div class="island-line" aria-hidden="true">
437
+ <img class="island-img clean-bg" src="isola.png" alt="" />
438
  </div>
439
  </section>
440
 
441
  <section class="form-area" aria-label="Ricerca invitato">
442
  <label class="field-label" for="guestName">Nome e cognome</label>
443
+ <input id="guestName" autocomplete="name" inputmode="text" placeholder="Es. Gaia Pollastrini" />
444
+ <button class="discover" id="discover" type="button">Scopri il Tavolo</button>
 
 
445
  <div id="message" class="message" aria-live="polite"></div>
446
  <div id="status" class="status" aria-live="polite"></div>
447
  </section>
 
454
  <p class="table-kicker">Il tuo tavolo è</p>
455
  <h2 class="table-name" id="tableName"></h2>
456
  <div class="reveal-island" aria-hidden="true">
457
+ <img class="island-img clean-bg" src="isola.png" alt="" />
458
  </div>
459
  <div class="reveal-line" aria-hidden="true"></div>
460
  <p class="reveal-note">In che cala cenerai? L’hai appena scoperto.</p>
 
463
  </section>
464
 
465
  <script>
466
+ const DATA_URL = "";
467
 
468
  const SAMPLE_CSV = `
469
+ Nome Cognome,Nome del tavolo
470
+ Gaia Pollastrini,Cala Matano
471
+ Matteo Bergamelli,Cala delle Arene
472
+ Luca Bianchi,Cala Tramontana
473
+ Sara Conti,Cala Spido
474
+ Marco De Santis,Cala Zio Cesare
475
+ Elena Ferri,Cala degli Inglesi
476
+ Davide Greco,Cala Tonda
477
+ Chiara Romano,Cala dei Benedettini
478
+ Alessandro Rinaldi,Cala Pietre di Fucile
479
+ Martina Esposito,Cala Sorrentino
480
  `;
481
 
482
  const els = {
 
619
  hideTimer = window.setTimeout(() => {
620
  els.input.value = "";
621
  els.message.classList.remove("show");
622
+ }, 330);
623
  }
624
 
625
  function discoverTable() {
 
649
  .replaceAll("'", "&#039;");
650
  }
651
 
652
+ // Rimuove fondi bianchi/grigi/quadrettati collegati ai bordi del PNG.
653
+ // Serve quando un file sembra trasparente ma nel browser mostra ancora il checkerboard.
654
+ function cleanTransparentImage(img) {
655
+ if (img.dataset.cleaned === "true" || !img.complete || !img.naturalWidth) return;
656
+ img.dataset.cleaned = "true";
657
+
658
+ const width = img.naturalWidth;
659
+ const height = img.naturalHeight;
660
+ const canvas = document.createElement("canvas");
661
+ const context = canvas.getContext("2d");
662
+ canvas.width = width;
663
+ canvas.height = height;
664
+
665
+ try {
666
+ context.drawImage(img, 0, 0);
667
+ const imageData = context.getImageData(0, 0, width, height);
668
+ const data = imageData.data;
669
+ const visited = new Uint8Array(width * height);
670
+ const queue = [];
671
+
672
+ function indexOf(x, y) { return y * width + x; }
673
+
674
+ function isBackgroundPixel(i) {
675
+ const p = i * 4;
676
+ const r = data[p];
677
+ const g = data[p + 1];
678
+ const b = data[p + 2];
679
+ const a = data[p + 3];
680
+ if (a < 20) return true;
681
+
682
+ const max = Math.max(r, g, b);
683
+ const min = Math.min(r, g, b);
684
+ const avg = (r + g + b) / 3;
685
+ const lowColor = (max - min) < 34;
686
+
687
+ return lowColor && avg > 202;
688
+ }
689
+
690
+ function addIfBackground(x, y) {
691
+ if (x < 0 || y < 0 || x >= width || y >= height) return;
692
+ const i = indexOf(x, y);
693
+ if (visited[i] || !isBackgroundPixel(i)) return;
694
+ visited[i] = 1;
695
+ queue.push(i);
696
+ }
697
+
698
+ for (let x = 0; x < width; x++) {
699
+ addIfBackground(x, 0);
700
+ addIfBackground(x, height - 1);
701
+ }
702
+ for (let y = 0; y < height; y++) {
703
+ addIfBackground(0, y);
704
+ addIfBackground(width - 1, y);
705
+ }
706
+
707
+ for (let q = 0; q < queue.length; q++) {
708
+ const i = queue[q];
709
+ const x = i % width;
710
+ const y = Math.floor(i / width);
711
+ data[i * 4 + 3] = 0;
712
+ addIfBackground(x + 1, y);
713
+ addIfBackground(x - 1, y);
714
+ addIfBackground(x, y + 1);
715
+ addIfBackground(x, y - 1);
716
+ }
717
+
718
+ context.putImageData(imageData, 0, 0);
719
+ img.src = canvas.toDataURL("image/png");
720
+ } catch (error) {
721
+ // Se il browser blocca il canvas per sicurezza, lasciamo l'immagine originale.
722
+ }
723
+ }
724
+
725
+ function cleanAllImages() {
726
+ document.querySelectorAll("img.clean-bg").forEach(img => {
727
+ if (img.complete) cleanTransparentImage(img);
728
+ else img.addEventListener("load", () => cleanTransparentImage(img), { once: true });
729
+ });
730
+ }
731
+
732
  els.discover.addEventListener("click", discoverTable);
733
  els.again.addEventListener("click", hideReveal);
734
  els.input.addEventListener("keydown", event => {
 
755
  const centerX = window.innerWidth / 2;
756
  const centerY = window.innerHeight * .36;
757
 
758
+ confetti = Array.from({ length: 80 }, () => {
759
  const angle = Math.random() * Math.PI * 2;
760
  const speed = 3 + Math.random() * 6;
761
  return {
 
768
  rotation: Math.random() * Math.PI,
769
  spin: (Math.random() - .5) * .24,
770
  color: colors[Math.floor(Math.random() * colors.length)],
771
+ life: 82 + Math.random() * 34
772
  };
773
  });
774
 
 
814
  }
815
 
816
  window.addEventListener("resize", resizeCanvas);
817
+ cleanAllImages();
818
  loadGuests();
819
  </script>
820
  </body>