Fraser commited on
Commit
5761465
·
1 Parent(s): b097ab2

try new fmt

Browse files
src/lib/components/Piclets/PicletDetail.svelte CHANGED
@@ -83,60 +83,53 @@
83
  <div class="content-scroll">
84
  <!-- Header Card -->
85
  <div class="header-card">
86
- <button
87
- class="share-button"
88
- onclick={handleShare}
89
- disabled={isSharing}
90
- aria-label="Share Piclet"
91
- >
92
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
93
- <path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8"></path>
94
- <polyline points="16 6 12 2 8 6"></polyline>
95
- <line x1="12" y1="2" x2="12" y2="15"></line>
96
- </svg>
97
- </button>
98
-
99
- <div class="header-layout">
100
- <div class="image-column">
101
- <div class="image-container">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  <img
103
  src={instance.imageData || instance.imageUrl}
104
  alt={instance.nickname || instance.typeId}
105
- class="piclet-image"
106
  />
107
  </div>
108
  </div>
109
-
110
- <div class="info-column">
111
- <h1 class="piclet-name">{instance.nickname || instance.typeId}</h1>
112
-
113
- <!-- Compact stats for caught piclet -->
114
- <div class="compact-info">
115
- <div class="level-badge">{instance.tier.toUpperCase()}</div>
116
-
117
- <div class="compact-stat-bar">
118
- <div class="stat-bar-label">
119
- <span>HP</span>
120
- <span>{instance.currentHp}/{instance.maxHp}</span>
121
- </div>
122
- <div class="hp-bar-track">
123
- <div
124
- class="hp-bar-fill"
125
- style="width: {getStatPercentage(instance.currentHp, instance.maxHp)}%; background-color: {getHpColor(instance.currentHp, instance.maxHp)};"
126
- ></div>
127
- </div>
128
- </div>
129
-
130
- <div class="compact-stat-bar">
131
- <div class="stat-bar-label">
132
- <span>XP</span>
133
- <span>{instance.xp} pts</span>
134
- </div>
135
- <div class="xp-bar-track">
136
- <div class="xp-bar-fill" style="width: 45%;"></div>
137
- </div>
138
- </div>
139
- </div>
140
  </div>
141
  </div>
142
  </div>
@@ -316,28 +309,69 @@
316
  /* Header Card */
317
  .header-card {
318
  margin: 16px;
319
- padding: 20px;
320
- border-radius: 16px;
321
- background: linear-gradient(135deg, #636366, #48484a);
322
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
323
  position: relative;
324
  }
325
 
326
- .share-button {
 
 
 
 
 
 
 
327
  position: absolute;
328
- top: 16px;
329
- right: 16px;
330
- width: 40px;
331
- height: 40px;
332
- border-radius: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  background: rgba(255, 255, 255, 0.2);
334
  border: none;
 
335
  cursor: pointer;
 
 
336
  display: flex;
337
  align-items: center;
338
  justify-content: center;
339
  transition: all 0.2s;
 
 
 
 
 
 
 
 
 
340
  color: white;
 
 
 
 
 
 
 
341
  }
342
 
343
  .share-button:hover {
@@ -359,102 +393,75 @@
359
  height: 20px;
360
  }
361
 
362
- .header-layout {
363
- display: flex;
364
- gap: 16px;
365
- }
366
-
367
- .image-column {
368
  display: flex;
369
  flex-direction: column;
370
  align-items: center;
371
- gap: 8px;
372
- }
373
-
374
- .image-container {
375
- background: #f8f9fa;
376
- background-image: repeating-linear-gradient(
377
- to bottom,
378
- rgba(76, 175, 80, 0.2) 0px,
379
- rgba(76, 175, 80, 0.2) 10px,
380
- rgba(76, 175, 80, 0.1) 10px,
381
- rgba(76, 175, 80, 0.1) 20px
382
- );
383
- padding: 8px;
384
- border-radius: 12px;
385
- }
386
-
387
- .piclet-image {
388
- width: 120px;
389
- height: 120px;
390
- object-fit: contain;
391
  }
392
 
393
- .info-column {
394
- flex: 1;
395
- display: flex;
396
- flex-direction: column;
397
  color: white;
 
 
 
 
398
  }
399
 
400
- .piclet-name {
401
- margin: 0 0 12px;
402
- font-size: 24px;
403
- font-weight: bold;
404
- }
405
-
406
- .compact-info {
407
  display: flex;
408
- flex-direction: column;
409
- gap: 8px;
410
- }
411
-
412
- .level-badge {
413
- background: rgba(142, 142, 147, 0.8);
414
- padding: 3px 10px;
415
- border-radius: 12px;
416
- font-size: 13px;
417
- font-weight: bold;
418
- width: fit-content;
419
  }
420
 
421
- .compact-stat-bar {
422
- display: flex;
423
- flex-direction: column;
424
- gap: 4px;
 
425
  }
426
 
427
- .stat-bar-label {
428
  display: flex;
429
  justify-content: space-between;
430
- font-size: 12px;
431
- font-weight: 500;
432
- }
433
-
434
- .hp-bar-track,
435
- .xp-bar-track {
436
- height: 6px;
437
- background: rgba(255, 255, 255, 0.3);
438
- border-radius: 3px;
439
- overflow: hidden;
440
  }
441
 
442
- .hp-bar-fill,
443
- .xp-bar-fill {
444
- height: 100%;
445
- transition: width 0.3s;
 
 
446
  }
447
 
448
- .xp-bar-fill {
449
- background: #af52de;
 
 
 
 
 
 
450
  }
451
 
452
  /* Tab Bar */
453
  .tab-bar {
454
  margin: 0 16px 16px;
455
- height: 32px;
456
  background: #e5e5ea;
457
- border-radius: 8px;
458
  display: flex;
459
  padding: 2px;
460
  }
@@ -463,8 +470,8 @@
463
  flex: 1;
464
  background: none;
465
  border: none;
466
- border-radius: 6px;
467
- font-size: 13px;
468
  font-weight: 500;
469
  color: #8e8e93;
470
  cursor: pointer;
@@ -472,8 +479,9 @@
472
  }
473
 
474
  .tab-button.active {
475
- background: #636366;
476
  color: white;
 
477
  }
478
 
479
  /* Tab Content */
 
83
  <div class="content-scroll">
84
  <!-- Header Card -->
85
  <div class="header-card">
86
+ <div class="card-background">
87
+ <!-- Faded Logo Background -->
88
+ <div class="logo-background">PICLETS</div>
89
+
90
+ <!-- Card Header -->
91
+ <div class="card-header">
92
+ <button
93
+ class="back-btn-card"
94
+ onclick={onClose}
95
+ aria-label="Go back"
96
+ >
97
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
98
+ <path d="M19 12H5m0 0l7 7m-7-7l7-7"></path>
99
+ </svg>
100
+ </button>
101
+ <button
102
+ class="share-button"
103
+ onclick={handleShare}
104
+ disabled={isSharing}
105
+ aria-label="Share Piclet"
106
+ >
107
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
108
+ <circle cx="18" cy="5" r="3"></circle>
109
+ <circle cx="6" cy="12" r="3"></circle>
110
+ <circle cx="18" cy="19" r="3"></circle>
111
+ <line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line>
112
+ <line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line>
113
+ </svg>
114
+ </button>
115
+ </div>
116
+
117
+ <!-- Large Image Section -->
118
+ <div class="large-image-section">
119
+ <div class="piclet-id">#{String(instance.id).padStart(3, '0')}</div>
120
+ <div class="large-image-container">
121
  <img
122
  src={instance.imageData || instance.imageUrl}
123
  alt={instance.nickname || instance.typeId}
124
+ class="large-piclet-image"
125
  />
126
  </div>
127
  </div>
128
+
129
+ <!-- Card Title -->
130
+ <div class="card-title-section">
131
+ <h1 class="card-title">{instance.nickname || instance.typeId}</h1>
132
+ <div class="tier-badge">{instance.tier.toUpperCase()}</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  </div>
134
  </div>
135
  </div>
 
309
  /* Header Card */
310
  .header-card {
311
  margin: 16px;
312
+ border-radius: 20px;
313
+ overflow: hidden;
314
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
 
315
  position: relative;
316
  }
317
 
318
+ .card-background {
319
+ background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
320
+ padding: 24px;
321
+ position: relative;
322
+ overflow: hidden;
323
+ }
324
+
325
+ .logo-background {
326
  position: absolute;
327
+ top: 50%;
328
+ left: 50%;
329
+ transform: translate(-50%, -50%) rotate(-15deg);
330
+ font-size: 80px;
331
+ font-weight: 900;
332
+ color: rgba(255, 255, 255, 0.1);
333
+ letter-spacing: 8px;
334
+ pointer-events: none;
335
+ z-index: 1;
336
+ }
337
+
338
+ .card-header {
339
+ display: flex;
340
+ justify-content: space-between;
341
+ align-items: center;
342
+ margin-bottom: 20px;
343
+ position: relative;
344
+ z-index: 2;
345
+ }
346
+
347
+ .back-btn-card {
348
  background: rgba(255, 255, 255, 0.2);
349
  border: none;
350
+ color: white;
351
  cursor: pointer;
352
+ padding: 8px;
353
+ border-radius: 12px;
354
  display: flex;
355
  align-items: center;
356
  justify-content: center;
357
  transition: all 0.2s;
358
+ }
359
+
360
+ .back-btn-card:hover {
361
+ background: rgba(255, 255, 255, 0.3);
362
+ }
363
+
364
+ .share-button {
365
+ background: rgba(255, 255, 255, 0.2);
366
+ border: none;
367
  color: white;
368
+ cursor: pointer;
369
+ padding: 8px;
370
+ border-radius: 12px;
371
+ display: flex;
372
+ align-items: center;
373
+ justify-content: center;
374
+ transition: all 0.2s;
375
  }
376
 
377
  .share-button:hover {
 
393
  height: 20px;
394
  }
395
 
396
+ .large-image-section {
 
 
 
 
 
397
  display: flex;
398
  flex-direction: column;
399
  align-items: center;
400
+ margin-bottom: 20px;
401
+ position: relative;
402
+ z-index: 2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  }
404
 
405
+ .piclet-id {
406
+ align-self: flex-start;
 
 
407
  color: white;
408
+ font-size: 16px;
409
+ font-weight: 600;
410
+ margin-bottom: 10px;
411
+ opacity: 0.9;
412
  }
413
 
414
+ .large-image-container {
415
+ background: rgba(255, 255, 255, 0.9);
416
+ border-radius: 20px;
417
+ padding: 20px;
 
 
 
418
  display: flex;
419
+ align-items: center;
420
+ justify-content: center;
421
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
422
+ width: 200px;
423
+ height: 200px;
 
 
 
 
 
 
424
  }
425
 
426
+ .large-piclet-image {
427
+ width: 160px;
428
+ height: 160px;
429
+ object-fit: contain;
430
+ filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
431
  }
432
 
433
+ .card-title-section {
434
  display: flex;
435
  justify-content: space-between;
436
+ align-items: center;
437
+ position: relative;
438
+ z-index: 2;
 
 
 
 
 
 
 
439
  }
440
 
441
+ .card-title {
442
+ margin: 0;
443
+ font-size: 28px;
444
+ font-weight: bold;
445
+ color: white;
446
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
447
  }
448
 
449
+ .tier-badge {
450
+ background: rgba(255, 255, 255, 0.2);
451
+ color: white;
452
+ padding: 6px 12px;
453
+ border-radius: 16px;
454
+ font-size: 14px;
455
+ font-weight: 600;
456
+ backdrop-filter: blur(10px);
457
  }
458
 
459
  /* Tab Bar */
460
  .tab-bar {
461
  margin: 0 16px 16px;
462
+ height: 36px;
463
  background: #e5e5ea;
464
+ border-radius: 12px;
465
  display: flex;
466
  padding: 2px;
467
  }
 
470
  flex: 1;
471
  background: none;
472
  border: none;
473
+ border-radius: 10px;
474
+ font-size: 14px;
475
  font-weight: 500;
476
  color: #8e8e93;
477
  cursor: pointer;
 
479
  }
480
 
481
  .tab-button.active {
482
+ background: #4CAF50;
483
  color: white;
484
+ box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
485
  }
486
 
487
  /* Tab Content */