style
Browse files
src/lib/components/Piclets/PicletCard.svelte
CHANGED
|
@@ -1,28 +1,30 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
import type { PicletInstance } from '$lib/db/schema';
|
| 3 |
import { TYPE_DATA } from '$lib/types/picletTypes';
|
| 4 |
-
|
| 5 |
interface Props {
|
| 6 |
piclet: PicletInstance;
|
| 7 |
size?: number;
|
| 8 |
onClick?: () => void;
|
| 9 |
}
|
| 10 |
-
|
| 11 |
let { piclet, size = 100, onClick }: Props = $props();
|
| 12 |
-
|
| 13 |
const typeColor = $derived(TYPE_DATA[piclet.primaryType]?.color || '#6c757d');
|
| 14 |
-
const softTypeColor = $derived(`${typeColor}20`);
|
|
|
|
| 15 |
</script>
|
| 16 |
|
| 17 |
-
<button
|
| 18 |
-
class="piclet-card"
|
| 19 |
-
style="width: {size}px; height: {size +
|
| 20 |
onclick={onClick}
|
| 21 |
type="button"
|
| 22 |
>
|
| 23 |
<div class="image-container">
|
| 24 |
-
<
|
| 25 |
-
|
|
|
|
| 26 |
alt={piclet.typeId || 'Piclet'}
|
| 27 |
class="piclet-image"
|
| 28 |
style="width: {size * 0.8}px; height: {size * 0.8}px;"
|
|
@@ -31,11 +33,14 @@
|
|
| 31 |
{piclet.tier}
|
| 32 |
</div>
|
| 33 |
</div>
|
| 34 |
-
|
| 35 |
<div class="details-section">
|
| 36 |
<p class="nickname">{piclet.nickname || piclet.objectName}</p>
|
| 37 |
-
<div class="
|
| 38 |
-
<span class="type
|
|
|
|
|
|
|
|
|
|
| 39 |
</div>
|
| 40 |
</div>
|
| 41 |
</button>
|
|
@@ -44,20 +49,25 @@
|
|
| 44 |
.piclet-card {
|
| 45 |
display: flex;
|
| 46 |
flex-direction: column;
|
| 47 |
-
background:
|
| 48 |
border-radius: 12px;
|
| 49 |
-
border: 2px solid;
|
| 50 |
-
|
| 51 |
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
| 52 |
padding: 0;
|
| 53 |
cursor: pointer;
|
| 54 |
-
transition:
|
|
|
|
| 55 |
}
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
.piclet-card:active {
|
| 58 |
-
transform: scale(0.
|
| 59 |
}
|
| 60 |
-
|
| 61 |
.image-container {
|
| 62 |
width: 100%;
|
| 63 |
flex: 1;
|
|
@@ -65,74 +75,106 @@
|
|
| 65 |
display: flex;
|
| 66 |
align-items: center;
|
| 67 |
justify-content: center;
|
| 68 |
-
|
| 69 |
overflow: hidden;
|
| 70 |
-
background: rgba(255, 255, 255, 0.7);
|
| 71 |
}
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
.piclet-image {
|
| 74 |
object-fit: contain;
|
|
|
|
|
|
|
|
|
|
| 75 |
}
|
| 76 |
-
|
| 77 |
.tier-badge {
|
| 78 |
position: absolute;
|
| 79 |
-
top:
|
| 80 |
-
right:
|
| 81 |
-
padding:
|
| 82 |
border-radius: 8px;
|
| 83 |
font-size: 9px;
|
| 84 |
font-weight: bold;
|
| 85 |
text-transform: uppercase;
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
-
|
| 88 |
-
.tier-low {
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
.details-section {
|
| 94 |
-
|
| 95 |
-
padding: 6px 8px;
|
| 96 |
display: flex;
|
| 97 |
flex-direction: column;
|
| 98 |
-
|
| 99 |
-
background:
|
| 100 |
-
border-
|
| 101 |
-
width: 100%;
|
| 102 |
}
|
| 103 |
-
|
| 104 |
.nickname {
|
| 105 |
-
margin: 0
|
| 106 |
-
font-size:
|
| 107 |
-
font-weight:
|
| 108 |
text-align: center;
|
| 109 |
overflow: hidden;
|
| 110 |
text-overflow: ellipsis;
|
| 111 |
white-space: nowrap;
|
| 112 |
-
color: #
|
| 113 |
}
|
| 114 |
-
|
| 115 |
-
.
|
| 116 |
display: flex;
|
| 117 |
-
gap: 4px;
|
| 118 |
justify-content: center;
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
-
|
| 121 |
-
.type {
|
| 122 |
-
font-size:
|
| 123 |
-
padding:
|
| 124 |
-
border-radius:
|
| 125 |
-
font-weight:
|
| 126 |
text-transform: uppercase;
|
| 127 |
-
}
|
| 128 |
-
|
| 129 |
-
.type.primary {
|
| 130 |
background: var(--type-color);
|
| 131 |
color: white;
|
| 132 |
}
|
| 133 |
-
|
| 134 |
-
.
|
| 135 |
-
|
|
|
|
| 136 |
color: #666;
|
|
|
|
|
|
|
|
|
|
| 137 |
}
|
| 138 |
-
</style>
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
import type { PicletInstance } from '$lib/db/schema';
|
| 3 |
import { TYPE_DATA } from '$lib/types/picletTypes';
|
| 4 |
+
|
| 5 |
interface Props {
|
| 6 |
piclet: PicletInstance;
|
| 7 |
size?: number;
|
| 8 |
onClick?: () => void;
|
| 9 |
}
|
| 10 |
+
|
| 11 |
let { piclet, size = 100, onClick }: Props = $props();
|
| 12 |
+
|
| 13 |
const typeColor = $derived(TYPE_DATA[piclet.primaryType]?.color || '#6c757d');
|
| 14 |
+
const softTypeColor = $derived(`${typeColor}20`);
|
| 15 |
+
const typeLogoPath = $derived(`/classes/${piclet.primaryType}.png`);
|
| 16 |
</script>
|
| 17 |
|
| 18 |
+
<button
|
| 19 |
+
class="piclet-card"
|
| 20 |
+
style="width: {size}px; height: {size + 50}px; --type-color: {typeColor}; --soft-type-color: {softTypeColor}; --type-logo: url('{typeLogoPath}');"
|
| 21 |
onclick={onClick}
|
| 22 |
type="button"
|
| 23 |
>
|
| 24 |
<div class="image-container">
|
| 25 |
+
<div class="logo-watermark"></div>
|
| 26 |
+
<img
|
| 27 |
+
src={piclet.imageData || piclet.imageUrl}
|
| 28 |
alt={piclet.typeId || 'Piclet'}
|
| 29 |
class="piclet-image"
|
| 30 |
style="width: {size * 0.8}px; height: {size * 0.8}px;"
|
|
|
|
| 33 |
{piclet.tier}
|
| 34 |
</div>
|
| 35 |
</div>
|
| 36 |
+
|
| 37 |
<div class="details-section">
|
| 38 |
<p class="nickname">{piclet.nickname || piclet.objectName}</p>
|
| 39 |
+
<div class="info-row">
|
| 40 |
+
<span class="type-badge">{piclet.primaryType}</span>
|
| 41 |
+
{#if piclet.scanCount}
|
| 42 |
+
<span class="scan-count">×{piclet.scanCount}</span>
|
| 43 |
+
{/if}
|
| 44 |
</div>
|
| 45 |
</div>
|
| 46 |
</button>
|
|
|
|
| 49 |
.piclet-card {
|
| 50 |
display: flex;
|
| 51 |
flex-direction: column;
|
| 52 |
+
background: white;
|
| 53 |
border-radius: 12px;
|
| 54 |
+
border: 2px solid var(--type-color, #007bff);
|
| 55 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
|
|
|
|
| 56 |
padding: 0;
|
| 57 |
cursor: pointer;
|
| 58 |
+
transition: all 0.2s;
|
| 59 |
+
overflow: hidden;
|
| 60 |
}
|
| 61 |
+
|
| 62 |
+
.piclet-card:hover {
|
| 63 |
+
transform: translateY(-2px);
|
| 64 |
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
.piclet-card:active {
|
| 68 |
+
transform: scale(0.97);
|
| 69 |
}
|
| 70 |
+
|
| 71 |
.image-container {
|
| 72 |
width: 100%;
|
| 73 |
flex: 1;
|
|
|
|
| 75 |
display: flex;
|
| 76 |
align-items: center;
|
| 77 |
justify-content: center;
|
| 78 |
+
background: linear-gradient(135deg, var(--soft-type-color) 0%, rgba(255, 255, 255, 0.9) 100%);
|
| 79 |
overflow: hidden;
|
|
|
|
| 80 |
}
|
| 81 |
+
|
| 82 |
+
.logo-watermark {
|
| 83 |
+
position: absolute;
|
| 84 |
+
top: 50%;
|
| 85 |
+
left: 50%;
|
| 86 |
+
transform: translate(-50%, -50%);
|
| 87 |
+
width: 80%;
|
| 88 |
+
height: 80%;
|
| 89 |
+
background-image: var(--type-logo);
|
| 90 |
+
background-size: contain;
|
| 91 |
+
background-repeat: no-repeat;
|
| 92 |
+
background-position: center;
|
| 93 |
+
opacity: 0.08;
|
| 94 |
+
pointer-events: none;
|
| 95 |
+
z-index: 0;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
.piclet-image {
|
| 99 |
object-fit: contain;
|
| 100 |
+
position: relative;
|
| 101 |
+
z-index: 1;
|
| 102 |
+
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
|
| 103 |
}
|
| 104 |
+
|
| 105 |
.tier-badge {
|
| 106 |
position: absolute;
|
| 107 |
+
top: 6px;
|
| 108 |
+
right: 6px;
|
| 109 |
+
padding: 3px 8px;
|
| 110 |
border-radius: 8px;
|
| 111 |
font-size: 9px;
|
| 112 |
font-weight: bold;
|
| 113 |
text-transform: uppercase;
|
| 114 |
+
z-index: 2;
|
| 115 |
+
backdrop-filter: blur(4px);
|
| 116 |
}
|
| 117 |
+
|
| 118 |
+
.tier-low {
|
| 119 |
+
background: rgba(108, 117, 125, 0.9);
|
| 120 |
+
color: white;
|
| 121 |
+
}
|
| 122 |
+
.tier-medium {
|
| 123 |
+
background: rgba(40, 167, 69, 0.9);
|
| 124 |
+
color: white;
|
| 125 |
+
}
|
| 126 |
+
.tier-high {
|
| 127 |
+
background: rgba(253, 126, 20, 0.9);
|
| 128 |
+
color: white;
|
| 129 |
+
}
|
| 130 |
+
.tier-legendary {
|
| 131 |
+
background: rgba(220, 53, 69, 0.9);
|
| 132 |
+
color: white;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
.details-section {
|
| 136 |
+
padding: 8px;
|
|
|
|
| 137 |
display: flex;
|
| 138 |
flex-direction: column;
|
| 139 |
+
gap: 4px;
|
| 140 |
+
background: white;
|
| 141 |
+
border-top: 1px solid var(--soft-type-color);
|
|
|
|
| 142 |
}
|
| 143 |
+
|
| 144 |
.nickname {
|
| 145 |
+
margin: 0;
|
| 146 |
+
font-size: 12px;
|
| 147 |
+
font-weight: 700;
|
| 148 |
text-align: center;
|
| 149 |
overflow: hidden;
|
| 150 |
text-overflow: ellipsis;
|
| 151 |
white-space: nowrap;
|
| 152 |
+
color: #1a1a1a;
|
| 153 |
}
|
| 154 |
+
|
| 155 |
+
.info-row {
|
| 156 |
display: flex;
|
|
|
|
| 157 |
justify-content: center;
|
| 158 |
+
align-items: center;
|
| 159 |
+
gap: 6px;
|
| 160 |
}
|
| 161 |
+
|
| 162 |
+
.type-badge {
|
| 163 |
+
font-size: 9px;
|
| 164 |
+
padding: 2px 6px;
|
| 165 |
+
border-radius: 6px;
|
| 166 |
+
font-weight: 600;
|
| 167 |
text-transform: uppercase;
|
|
|
|
|
|
|
|
|
|
| 168 |
background: var(--type-color);
|
| 169 |
color: white;
|
| 170 |
}
|
| 171 |
+
|
| 172 |
+
.scan-count {
|
| 173 |
+
font-size: 9px;
|
| 174 |
+
font-weight: 600;
|
| 175 |
color: #666;
|
| 176 |
+
background: #f0f0f0;
|
| 177 |
+
padding: 2px 6px;
|
| 178 |
+
border-radius: 6px;
|
| 179 |
}
|
| 180 |
+
</style>
|
src/lib/components/Piclets/PicletDetail.svelte
CHANGED
|
@@ -1,19 +1,28 @@
|
|
| 1 |
<script lang="ts">
|
|
|
|
| 2 |
import type { PicletInstance } from '$lib/db/schema';
|
| 3 |
import { deletePicletInstance } from '$lib/db/piclets';
|
| 4 |
import { uiStore } from '$lib/stores/ui';
|
| 5 |
import { TYPE_DATA } from '$lib/types/picletTypes';
|
| 6 |
-
|
| 7 |
interface Props {
|
| 8 |
instance: PicletInstance;
|
| 9 |
onClose: () => void;
|
| 10 |
onDeleted?: () => void;
|
| 11 |
}
|
| 12 |
-
|
| 13 |
let { instance, onClose, onDeleted }: Props = $props();
|
| 14 |
-
|
| 15 |
const typeColor = $derived(TYPE_DATA[instance.primaryType]?.color || '#007bff');
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
async function handleDelete() {
|
| 18 |
if (confirm(`Are you sure you want to delete ${instance.typeId}?`)) {
|
| 19 |
try {
|
|
@@ -28,258 +37,346 @@
|
|
| 28 |
}
|
| 29 |
</script>
|
| 30 |
|
| 31 |
-
<div class="
|
| 32 |
-
<div class="
|
| 33 |
-
<!-- Header -->
|
| 34 |
-
<div class="header
|
| 35 |
-
<
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
</div>
|
| 38 |
-
|
| 39 |
-
<!--
|
| 40 |
-
<div class="
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
<img
|
| 44 |
-
src={instance.imageData || instance.imageUrl}
|
| 45 |
-
alt={instance.typeId}
|
| 46 |
-
class="piclet-image"
|
| 47 |
-
/>
|
| 48 |
</div>
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<h3>Description</h3>
|
| 62 |
-
<p>{instance.description}</p>
|
| 63 |
</div>
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
<div class="meta-
|
| 67 |
-
<
|
| 68 |
-
|
| 69 |
</div>
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
</
|
| 75 |
-
|
| 76 |
-
{#if instance.variationAttributes && instance.variationAttributes.length > 0}
|
| 77 |
-
<div class="meta-item">
|
| 78 |
-
<strong>Variation:</strong>
|
| 79 |
-
{instance.variationAttributes.join(', ')}
|
| 80 |
-
</div>
|
| 81 |
-
{/if}
|
| 82 |
-
{#if instance.discoveredAt}
|
| 83 |
-
<div class="meta-item">
|
| 84 |
-
<strong>Discovered:</strong>
|
| 85 |
-
{new Date(instance.discoveredAt).toLocaleDateString()}
|
| 86 |
-
</div>
|
| 87 |
-
{/if}
|
| 88 |
-
<div class="meta-item">
|
| 89 |
-
<strong>Scan Count:</strong>
|
| 90 |
-
{instance.scanCount || 1}
|
| 91 |
</div>
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
| 95 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
</div>
|
| 97 |
</div>
|
| 98 |
</div>
|
| 99 |
-
|
| 100 |
<!-- Actions -->
|
| 101 |
-
<div class="actions">
|
| 102 |
-
<button class="
|
| 103 |
-
🗑️ Delete
|
| 104 |
-
</button>
|
| 105 |
</div>
|
| 106 |
</div>
|
| 107 |
</div>
|
| 108 |
|
| 109 |
<style>
|
| 110 |
-
.
|
| 111 |
position: fixed;
|
| 112 |
top: 0;
|
| 113 |
left: 0;
|
| 114 |
right: 0;
|
| 115 |
bottom: 0;
|
| 116 |
-
background:
|
| 117 |
-
display: flex;
|
| 118 |
-
align-items: center;
|
| 119 |
-
justify-content: center;
|
| 120 |
z-index: 1000;
|
| 121 |
-
padding: 1rem;
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
.piclet-detail {
|
| 125 |
-
background: white;
|
| 126 |
-
border-radius: 16px;
|
| 127 |
-
width: 100%;
|
| 128 |
-
max-width: 400px;
|
| 129 |
-
max-height: 80vh;
|
| 130 |
-
overflow: hidden;
|
| 131 |
display: flex;
|
| 132 |
flex-direction: column;
|
| 133 |
}
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
position: relative;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
display: flex;
|
| 141 |
justify-content: space-between;
|
| 142 |
align-items: center;
|
|
|
|
|
|
|
|
|
|
| 143 |
}
|
| 144 |
-
|
| 145 |
-
.
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
border: none;
|
| 148 |
color: white;
|
| 149 |
-
font-size: 1.5rem;
|
| 150 |
cursor: pointer;
|
| 151 |
-
padding:
|
| 152 |
-
|
| 153 |
-
height: 32px;
|
| 154 |
display: flex;
|
| 155 |
align-items: center;
|
| 156 |
justify-content: center;
|
| 157 |
-
|
| 158 |
-
transition: background 0.2s;
|
| 159 |
}
|
| 160 |
-
|
| 161 |
-
.
|
| 162 |
-
background: rgba(255, 255, 255, 0.
|
| 163 |
}
|
| 164 |
-
|
| 165 |
.tier-badge {
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
| 169 |
font-weight: bold;
|
| 170 |
text-transform: uppercase;
|
|
|
|
|
|
|
| 171 |
}
|
| 172 |
-
|
| 173 |
-
.
|
| 174 |
-
.tier-medium { background: #28a745; }
|
| 175 |
-
.tier-high { background: #fd7e14; }
|
| 176 |
-
.tier-legendary { background: #dc3545; }
|
| 177 |
-
|
| 178 |
-
.content {
|
| 179 |
-
flex: 1;
|
| 180 |
-
overflow-y: auto;
|
| 181 |
-
padding: 1.5rem;
|
| 182 |
-
}
|
| 183 |
-
|
| 184 |
-
.image-section {
|
| 185 |
-
text-align: center;
|
| 186 |
-
margin-bottom: 1.5rem;
|
| 187 |
-
}
|
| 188 |
-
|
| 189 |
-
.piclet-image {
|
| 190 |
-
width: 150px;
|
| 191 |
-
height: 150px;
|
| 192 |
-
object-fit: contain;
|
| 193 |
-
border-radius: 12px;
|
| 194 |
-
background: rgba(0, 0, 0, 0.05);
|
| 195 |
-
}
|
| 196 |
-
|
| 197 |
-
.info-section {
|
| 198 |
display: flex;
|
| 199 |
flex-direction: column;
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
.name {
|
| 204 |
-
margin: 0;
|
| 205 |
-
font-size: 1.5rem;
|
| 206 |
-
font-weight: bold;
|
| 207 |
-
text-align: center;
|
| 208 |
-
color: var(--type-color, #007bff);
|
| 209 |
}
|
| 210 |
-
|
| 211 |
-
.
|
| 212 |
display: flex;
|
| 213 |
-
|
| 214 |
justify-content: center;
|
|
|
|
|
|
|
| 215 |
}
|
| 216 |
-
|
| 217 |
-
.
|
| 218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
border-radius: 20px;
|
| 220 |
-
font-size:
|
| 221 |
font-weight: 600;
|
| 222 |
text-transform: uppercase;
|
| 223 |
color: white;
|
|
|
|
| 224 |
}
|
| 225 |
-
|
| 226 |
-
.
|
| 227 |
-
|
| 228 |
-
}
|
| 229 |
-
|
| 230 |
-
.description h3 {
|
| 231 |
-
margin: 0 0 0.5rem 0;
|
| 232 |
-
color: #333;
|
| 233 |
-
font-size: 1.1rem;
|
| 234 |
}
|
| 235 |
-
|
| 236 |
.description p {
|
| 237 |
margin: 0;
|
|
|
|
| 238 |
line-height: 1.5;
|
| 239 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
}
|
| 241 |
-
|
| 242 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
display: flex;
|
| 244 |
flex-direction: column;
|
| 245 |
-
gap:
|
| 246 |
}
|
| 247 |
-
|
| 248 |
-
.meta-
|
| 249 |
display: flex;
|
|
|
|
| 250 |
align-items: center;
|
| 251 |
-
|
| 252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
}
|
| 254 |
-
|
| 255 |
-
.
|
| 256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 257 |
color: white;
|
| 258 |
-
padding:
|
| 259 |
border-radius: 12px;
|
| 260 |
-
font-size:
|
| 261 |
font-weight: 600;
|
| 262 |
}
|
| 263 |
-
|
| 264 |
-
.
|
| 265 |
-
padding:
|
| 266 |
-
border-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
.delete-button {
|
| 272 |
-
background: #dc3545;
|
| 273 |
color: white;
|
| 274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
padding: 0.75rem 1.5rem;
|
|
|
|
| 276 |
border-radius: 8px;
|
|
|
|
| 277 |
font-weight: 600;
|
| 278 |
cursor: pointer;
|
| 279 |
-
transition:
|
| 280 |
}
|
| 281 |
-
|
| 282 |
-
.
|
| 283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
}
|
| 285 |
-
</style>
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
import { onMount } from 'svelte';
|
| 3 |
import type { PicletInstance } from '$lib/db/schema';
|
| 4 |
import { deletePicletInstance } from '$lib/db/piclets';
|
| 5 |
import { uiStore } from '$lib/stores/ui';
|
| 6 |
import { TYPE_DATA } from '$lib/types/picletTypes';
|
| 7 |
+
|
| 8 |
interface Props {
|
| 9 |
instance: PicletInstance;
|
| 10 |
onClose: () => void;
|
| 11 |
onDeleted?: () => void;
|
| 12 |
}
|
| 13 |
+
|
| 14 |
let { instance, onClose, onDeleted }: Props = $props();
|
| 15 |
+
|
| 16 |
const typeColor = $derived(TYPE_DATA[instance.primaryType]?.color || '#007bff');
|
| 17 |
+
const typeLogoPath = $derived(`/classes/${instance.primaryType}.png`);
|
| 18 |
+
|
| 19 |
+
onMount(() => {
|
| 20 |
+
uiStore.openDetailPage();
|
| 21 |
+
return () => {
|
| 22 |
+
uiStore.closeDetailPage();
|
| 23 |
+
};
|
| 24 |
+
});
|
| 25 |
+
|
| 26 |
async function handleDelete() {
|
| 27 |
if (confirm(`Are you sure you want to delete ${instance.typeId}?`)) {
|
| 28 |
try {
|
|
|
|
| 37 |
}
|
| 38 |
</script>
|
| 39 |
|
| 40 |
+
<div class="detail-page">
|
| 41 |
+
<div class="content-scroll">
|
| 42 |
+
<!-- Header Card -->
|
| 43 |
+
<div class="header-card">
|
| 44 |
+
<div class="card-background" style="--type-color: {typeColor}; --type-logo: url('{typeLogoPath}')">
|
| 45 |
+
<!-- Faded Logo Background -->
|
| 46 |
+
<div class="logo-background"></div>
|
| 47 |
+
|
| 48 |
+
<!-- Card Header -->
|
| 49 |
+
<div class="card-header">
|
| 50 |
+
<button
|
| 51 |
+
class="back-btn-card"
|
| 52 |
+
onclick={onClose}
|
| 53 |
+
aria-label="Go back"
|
| 54 |
+
>
|
| 55 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 56 |
+
<path d="M19 12H5m0 0l7 7m-7-7l7-7"></path>
|
| 57 |
+
</svg>
|
| 58 |
+
</button>
|
| 59 |
+
<h1 class="card-title">{instance.typeId}</h1>
|
| 60 |
+
<div class="tier-badge tier-{instance.tier}">{instance.tier}</div>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<!-- Large Image Section -->
|
| 64 |
+
<div class="large-image-section">
|
| 65 |
+
<div class="large-image-container">
|
| 66 |
+
<img
|
| 67 |
+
src={instance.imageData || instance.imageUrl}
|
| 68 |
+
alt={instance.typeId}
|
| 69 |
+
class="large-piclet-image"
|
| 70 |
+
/>
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
</div>
|
| 75 |
+
|
| 76 |
+
<!-- Info Section -->
|
| 77 |
+
<div class="info-card">
|
| 78 |
+
<div class="type-badge" style="background-color: {typeColor}">
|
| 79 |
+
{instance.primaryType}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
</div>
|
| 81 |
+
|
| 82 |
+
<div class="description">
|
| 83 |
+
<p>{instance.description}</p>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<div class="divider"></div>
|
| 87 |
+
|
| 88 |
+
<h3 class="section-heading">Discovery Info</h3>
|
| 89 |
+
<div class="metadata-list">
|
| 90 |
+
<div class="meta-row">
|
| 91 |
+
<span class="meta-label">Object</span>
|
| 92 |
+
<span class="meta-value">{instance.objectName}</span>
|
|
|
|
|
|
|
| 93 |
</div>
|
| 94 |
+
|
| 95 |
+
{#if instance.isCanonical}
|
| 96 |
+
<div class="meta-row">
|
| 97 |
+
<span class="meta-label">Status</span>
|
| 98 |
+
<span class="canonical-badge">Canonical</span>
|
| 99 |
</div>
|
| 100 |
+
{/if}
|
| 101 |
+
|
| 102 |
+
{#if instance.variationAttributes && instance.variationAttributes.length > 0}
|
| 103 |
+
<div class="meta-row">
|
| 104 |
+
<span class="meta-label">Variation</span>
|
| 105 |
+
<span class="meta-value">{instance.variationAttributes.join(', ')}</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
</div>
|
| 107 |
+
{/if}
|
| 108 |
+
|
| 109 |
+
{#if instance.discoveredAt}
|
| 110 |
+
<div class="meta-row">
|
| 111 |
+
<span class="meta-label">Discovered</span>
|
| 112 |
+
<span class="meta-value">{new Date(instance.discoveredAt).toLocaleDateString()}</span>
|
| 113 |
</div>
|
| 114 |
+
{/if}
|
| 115 |
+
|
| 116 |
+
<div class="meta-row">
|
| 117 |
+
<span class="meta-label">Scan Count</span>
|
| 118 |
+
<span class="meta-value">{instance.scanCount || 1}</span>
|
| 119 |
+
</div>
|
| 120 |
+
|
| 121 |
+
<div class="meta-row">
|
| 122 |
+
<span class="meta-label">Rarity</span>
|
| 123 |
+
<span class="rarity-badge tier-{instance.tier}">{instance.tier}</span>
|
| 124 |
</div>
|
| 125 |
</div>
|
| 126 |
</div>
|
| 127 |
+
|
| 128 |
<!-- Actions -->
|
| 129 |
+
<div class="bottom-actions">
|
| 130 |
+
<button class="btn btn-danger" onclick={handleDelete}>Delete Piclet</button>
|
|
|
|
|
|
|
| 131 |
</div>
|
| 132 |
</div>
|
| 133 |
</div>
|
| 134 |
|
| 135 |
<style>
|
| 136 |
+
.detail-page {
|
| 137 |
position: fixed;
|
| 138 |
top: 0;
|
| 139 |
left: 0;
|
| 140 |
right: 0;
|
| 141 |
bottom: 0;
|
| 142 |
+
background: #f2f2f7;
|
|
|
|
|
|
|
|
|
|
| 143 |
z-index: 1000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
display: flex;
|
| 145 |
flex-direction: column;
|
| 146 |
}
|
| 147 |
+
|
| 148 |
+
/* Content Scroll */
|
| 149 |
+
.content-scroll {
|
| 150 |
+
flex: 1;
|
| 151 |
+
overflow-y: auto;
|
| 152 |
+
-webkit-overflow-scrolling: touch;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
/* Header Card */
|
| 156 |
+
.header-card {
|
| 157 |
+
margin-bottom: 16px;
|
| 158 |
+
overflow: hidden;
|
| 159 |
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
| 160 |
position: relative;
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
.card-background {
|
| 164 |
+
background: linear-gradient(135deg, var(--type-color, #4CAF50) 0%, color-mix(in srgb, var(--type-color, #4CAF50) 80%, white) 100%);
|
| 165 |
+
padding: 24px;
|
| 166 |
+
padding-top: calc(24px + env(safe-area-inset-top, 0));
|
| 167 |
+
position: relative;
|
| 168 |
+
overflow: hidden;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.logo-background {
|
| 172 |
+
position: absolute;
|
| 173 |
+
bottom: 5px;
|
| 174 |
+
right: 5px;
|
| 175 |
+
width: 120px;
|
| 176 |
+
height: 120px;
|
| 177 |
+
background-image: var(--type-logo);
|
| 178 |
+
background-size: contain;
|
| 179 |
+
background-repeat: no-repeat;
|
| 180 |
+
background-position: center;
|
| 181 |
+
opacity: 0.15;
|
| 182 |
+
pointer-events: none;
|
| 183 |
+
z-index: 1;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
.card-header {
|
| 187 |
display: flex;
|
| 188 |
justify-content: space-between;
|
| 189 |
align-items: center;
|
| 190 |
+
margin-bottom: 20px;
|
| 191 |
+
position: relative;
|
| 192 |
+
z-index: 2;
|
| 193 |
}
|
| 194 |
+
|
| 195 |
+
.card-title {
|
| 196 |
+
margin: 0;
|
| 197 |
+
font-size: 24px;
|
| 198 |
+
font-weight: bold;
|
| 199 |
+
color: white;
|
| 200 |
+
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
| 201 |
+
flex: 1;
|
| 202 |
+
text-align: center;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
.back-btn-card {
|
| 206 |
+
background: rgba(255, 255, 255, 0.2);
|
| 207 |
border: none;
|
| 208 |
color: white;
|
|
|
|
| 209 |
cursor: pointer;
|
| 210 |
+
padding: 8px;
|
| 211 |
+
border-radius: 12px;
|
|
|
|
| 212 |
display: flex;
|
| 213 |
align-items: center;
|
| 214 |
justify-content: center;
|
| 215 |
+
transition: all 0.2s;
|
|
|
|
| 216 |
}
|
| 217 |
+
|
| 218 |
+
.back-btn-card:hover {
|
| 219 |
+
background: rgba(255, 255, 255, 0.3);
|
| 220 |
}
|
| 221 |
+
|
| 222 |
.tier-badge {
|
| 223 |
+
background: rgba(255, 255, 255, 0.3);
|
| 224 |
+
padding: 6px 12px;
|
| 225 |
+
border-radius: 12px;
|
| 226 |
+
font-size: 11px;
|
| 227 |
font-weight: bold;
|
| 228 |
text-transform: uppercase;
|
| 229 |
+
color: white;
|
| 230 |
+
backdrop-filter: blur(10px);
|
| 231 |
}
|
| 232 |
+
|
| 233 |
+
.large-image-section {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
display: flex;
|
| 235 |
flex-direction: column;
|
| 236 |
+
align-items: center;
|
| 237 |
+
position: relative;
|
| 238 |
+
z-index: 2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
}
|
| 240 |
+
|
| 241 |
+
.large-image-container {
|
| 242 |
display: flex;
|
| 243 |
+
align-items: center;
|
| 244 |
justify-content: center;
|
| 245 |
+
width: 360px;
|
| 246 |
+
height: 360px;
|
| 247 |
}
|
| 248 |
+
|
| 249 |
+
.large-piclet-image {
|
| 250 |
+
width: 360px;
|
| 251 |
+
height: 360px;
|
| 252 |
+
object-fit: contain;
|
| 253 |
+
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
/* Info Card */
|
| 257 |
+
.info-card {
|
| 258 |
+
background: white;
|
| 259 |
+
margin: 0 16px 16px;
|
| 260 |
+
border-radius: 12px;
|
| 261 |
+
padding: 16px;
|
| 262 |
+
border: 0.5px solid #c6c6c8;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
.type-badge {
|
| 266 |
+
display: inline-block;
|
| 267 |
+
padding: 8px 16px;
|
| 268 |
border-radius: 20px;
|
| 269 |
+
font-size: 14px;
|
| 270 |
font-weight: 600;
|
| 271 |
text-transform: uppercase;
|
| 272 |
color: white;
|
| 273 |
+
margin-bottom: 16px;
|
| 274 |
}
|
| 275 |
+
|
| 276 |
+
.description {
|
| 277 |
+
margin-bottom: 16px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
}
|
| 279 |
+
|
| 280 |
.description p {
|
| 281 |
margin: 0;
|
| 282 |
+
font-size: 16px;
|
| 283 |
line-height: 1.5;
|
| 284 |
+
color: #333;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
.divider {
|
| 288 |
+
height: 1px;
|
| 289 |
+
background: #e5e5ea;
|
| 290 |
+
margin: 16px 0;
|
| 291 |
}
|
| 292 |
+
|
| 293 |
+
.section-heading {
|
| 294 |
+
font-size: 18px;
|
| 295 |
+
font-weight: 600;
|
| 296 |
+
color: #495057;
|
| 297 |
+
margin: 0 0 12px 0;
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
.metadata-list {
|
| 301 |
display: flex;
|
| 302 |
flex-direction: column;
|
| 303 |
+
gap: 12px;
|
| 304 |
}
|
| 305 |
+
|
| 306 |
+
.meta-row {
|
| 307 |
display: flex;
|
| 308 |
+
justify-content: space-between;
|
| 309 |
align-items: center;
|
| 310 |
+
font-size: 15px;
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
.meta-label {
|
| 314 |
+
font-weight: 500;
|
| 315 |
+
color: #666;
|
| 316 |
}
|
| 317 |
+
|
| 318 |
+
.meta-value {
|
| 319 |
+
font-weight: 600;
|
| 320 |
+
color: #000;
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
.canonical-badge {
|
| 324 |
+
background: #4CAF50;
|
| 325 |
color: white;
|
| 326 |
+
padding: 4px 12px;
|
| 327 |
border-radius: 12px;
|
| 328 |
+
font-size: 12px;
|
| 329 |
font-weight: 600;
|
| 330 |
}
|
| 331 |
+
|
| 332 |
+
.rarity-badge {
|
| 333 |
+
padding: 4px 12px;
|
| 334 |
+
border-radius: 12px;
|
| 335 |
+
font-size: 12px;
|
| 336 |
+
font-weight: 600;
|
| 337 |
+
text-transform: uppercase;
|
|
|
|
|
|
|
|
|
|
| 338 |
color: white;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.rarity-badge.tier-low { background: #6c757d; }
|
| 342 |
+
.rarity-badge.tier-medium { background: #28a745; }
|
| 343 |
+
.rarity-badge.tier-high { background: #fd7e14; }
|
| 344 |
+
.rarity-badge.tier-legendary { background: #dc3545; }
|
| 345 |
+
|
| 346 |
+
/* Bottom Actions */
|
| 347 |
+
.bottom-actions {
|
| 348 |
+
padding: 16px;
|
| 349 |
+
background: white;
|
| 350 |
+
border-top: 0.5px solid #c6c6c8;
|
| 351 |
+
text-align: center;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
.btn {
|
| 355 |
padding: 0.75rem 1.5rem;
|
| 356 |
+
border: none;
|
| 357 |
border-radius: 8px;
|
| 358 |
+
font-size: 16px;
|
| 359 |
font-weight: 600;
|
| 360 |
cursor: pointer;
|
| 361 |
+
transition: transform 0.2s;
|
| 362 |
}
|
| 363 |
+
|
| 364 |
+
.btn:active {
|
| 365 |
+
transform: scale(0.95);
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
.btn-danger {
|
| 369 |
+
background: #ff3b30;
|
| 370 |
+
color: white;
|
| 371 |
+
width: 100%;
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
@media (min-width: 768px) {
|
| 375 |
+
.detail-page {
|
| 376 |
+
position: relative;
|
| 377 |
+
max-width: 600px;
|
| 378 |
+
margin: 0 auto;
|
| 379 |
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
|
| 380 |
+
}
|
| 381 |
}
|
| 382 |
+
</style>
|