feat(ui): pixel-art breathing logo and external links
This commit is contained in:
1 parent
7ea2fb7e17
commit
7b5c97c84e
4 files changed
+111
-6
No files matched your search
+103
-3
@@ -1,11 +1,111 @@
|
||||
<script setup lang="ts">
|
||||
// 32x32 sprite: '.' = transparent, letters = palette colors.
|
||||
// Head spans half the width (narrow), hoodie fills the bottom as a bust.
|
||||
// Rows: hair (0-3), hairline/forehead (4-5), glasses (6-8), face (9-12),
|
||||
// neck (13), shoulders/chest (14-31, drawstrings on 18).
|
||||
const PALETTE: Record<string, string> = {
|
||||
H: '#4a2f1d', // hair
|
||||
S: '#f2cfa5', // skin
|
||||
F: '#101418', // glasses frame
|
||||
L: '#cfe3ff', // lens glass
|
||||
P: '#2e3a45', // pupils
|
||||
N: '#e0b58f', // nose shade
|
||||
M: '#c26e57', // smile
|
||||
h: '#12151a', // hoodie
|
||||
w: '#e8e8e8', // drawstrings
|
||||
}
|
||||
|
||||
const SPRITE = [
|
||||
'..........HHHHHHHHHHHH..........',
|
||||
'.........HHHHHHHHHHHHHH.........',
|
||||
'........HHHHHHHHHHHHHHHH........',
|
||||
'........HHHHHHHHHHHHHHHH........',
|
||||
'........HHSSSSSSSSSSSSHH........',
|
||||
'........HSSSSSSSSSSSSSSH........',
|
||||
'........SFFFFFFFFFFFFFFS........',
|
||||
'........SFLPPLLFFLLPPLFS........',
|
||||
'........SFLLLLLFFLLLLLFS........',
|
||||
'........SSSSSSSSSSSSSSSS........',
|
||||
'........SSSSSSSNNSSSSSSS........',
|
||||
'........SSSSSSMMMMSSSSSS........',
|
||||
'..........SSSSSSSSSSSS..........',
|
||||
'.............SSSSSS.............',
|
||||
'..........hhhhhhhhhhhh..........',
|
||||
'.........hhhhhhhhhhhhhh.........',
|
||||
'........hhhhhhhhhhhhhhhh........',
|
||||
'.......hhhhhhhhhhhhhhhhhh.......',
|
||||
'......hhhhhhhhwhhwhhhhhhhh......',
|
||||
'....hhhhhhhhhhhhhhhhhhhhhhhh....',
|
||||
'...hhhhhhhhhhhhhhhhhhhhhhhhhh...',
|
||||
'..hhhhhhhhhhhhhhhhhhhhhhhhhhhh..',
|
||||
'.hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',
|
||||
]
|
||||
|
||||
const flat = SPRITE
|
||||
.flatMap((row) => [...row])
|
||||
.map((cell) => PALETTE[cell] ?? 'transparent')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NuxtLink to="/" class="group flex items-center gap-3">
|
||||
<span class="flex items-center justify-center w-8 h-8 rounded bg-surface-container-high text-primary group-hover:text-primary-fixed transition-colors">
|
||||
<span class="material-symbols-outlined text-[1.125rem]">grain</span>
|
||||
<span class="flex items-center justify-center w-8 h-8 rounded bg-surface-container-high transition-colors">
|
||||
<span class="pixel-avatar" aria-hidden="true">
|
||||
<span
|
||||
v-for="(color, i) in flat"
|
||||
:key="i"
|
||||
class="pixel"
|
||||
:style="{ backgroundColor: color }"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<div class="flex flex-col">
|
||||
<span class="font-headline-sm text-headline-sm tracking-tight text-on-surface font-medium">Noel Sabia</span>
|
||||
<span class="font-label-mono text-label-mono text-on-surface-variant tracking-wider uppercase text-[0.625rem]">resilience / arch</span>
|
||||
<span class="font-label-mono text-label-mono text-on-surface-variant tracking-wider uppercase text-[0.625rem]">Im using Arch btw</span>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.pixel-avatar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(32, 1px);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
transform-origin: bottom center;
|
||||
}
|
||||
|
||||
/* Breathing only while the logo link is hovered. */
|
||||
.group:hover .pixel-avatar {
|
||||
animation: breathe 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.pixel {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
@keyframes breathe {
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: scale(1.06);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.group:hover .pixel-avatar {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user