|
| 1 | +<script setup lang="ts"> |
| 2 | +import { computed } from 'vue' |
| 3 | +
|
| 4 | +const props = withDefaults( |
| 5 | + defineProps<{ |
| 6 | + packages: string | string[] |
| 7 | + primaryColor?: string |
| 8 | + }>(), |
| 9 | + { |
| 10 | + packages: () => [], |
| 11 | + primaryColor: '#60a5fa', |
| 12 | + }, |
| 13 | +) |
| 14 | +
|
| 15 | +const ACCENT_COLORS = ['#60a5fa', '#f472b6', '#34d399', '#fbbf24'] |
| 16 | +
|
| 17 | +const displayPackages = computed(() => { |
| 18 | + const raw = props.packages |
| 19 | + const list = typeof raw === 'string' |
| 20 | + ? raw.split(',').map(p => p.trim()).filter(Boolean) |
| 21 | + : raw |
| 22 | + return list.slice(0, 4) |
| 23 | +}) |
| 24 | +</script> |
| 25 | + |
| 26 | +<template> |
| 27 | + <div |
| 28 | + class="h-full w-full flex flex-col justify-center px-20 bg-[#050505] text-[#fafafa] relative overflow-hidden" |
| 29 | + style="font-family: 'Geist Mono', sans-serif" |
| 30 | + > |
| 31 | + <div class="relative z-10 flex flex-col gap-6"> |
| 32 | + <!-- Icon + title row (same pattern as Default/Package) --> |
| 33 | + <div class="flex items-start gap-4"> |
| 34 | + <div |
| 35 | + class="flex items-center justify-center w-16 h-16 p-3.5 rounded-xl shadow-lg bg-gradient-to-tr from-[#3b82f6]" |
| 36 | + :style="{ backgroundColor: primaryColor }" |
| 37 | + > |
| 38 | + <svg |
| 39 | + width="36" |
| 40 | + height="36" |
| 41 | + viewBox="0 0 24 24" |
| 42 | + fill="none" |
| 43 | + stroke="white" |
| 44 | + stroke-width="2.5" |
| 45 | + stroke-linecap="round" |
| 46 | + stroke-linejoin="round" |
| 47 | + > |
| 48 | + <circle cx="18" cy="18" r="3" /> |
| 49 | + <circle cx="6" cy="6" r="3" /> |
| 50 | + <path d="M13 6h3a2 2 0 0 1 2 2v7" /> |
| 51 | + <path d="M11 18H8a2 2 0 0 1-2-2V9" /> |
| 52 | + </svg> |
| 53 | + </div> |
| 54 | + |
| 55 | + <h1 class="text-8xl font-bold"> |
| 56 | + <span |
| 57 | + class="opacity-80 tracking-[-0.1em]" |
| 58 | + :style="{ color: primaryColor }" |
| 59 | + style="margin-left: -1rem; margin-right: 0.5rem" |
| 60 | + >./</span>compare |
| 61 | + </h1> |
| 62 | + </div> |
| 63 | + |
| 64 | + <!-- Package names as badges (same badge style as Default/Package) --> |
| 65 | + <div |
| 66 | + class="flex flex-wrap items-center gap-x-3 gap-y-3 text-4xl text-[#a3a3a3]" |
| 67 | + style="font-family: 'Geist', sans-serif" |
| 68 | + > |
| 69 | + <template v-for="(pkg, index) in displayPackages" :key="pkg"> |
| 70 | + <span |
| 71 | + class="px-3 py-1 rounded-lg border font-normal" |
| 72 | + :style="{ |
| 73 | + color: ACCENT_COLORS[index % ACCENT_COLORS.length], |
| 74 | + backgroundColor: ACCENT_COLORS[index % ACCENT_COLORS.length] + '10', |
| 75 | + borderColor: ACCENT_COLORS[index % ACCENT_COLORS.length] + '30', |
| 76 | + boxShadow: `0 0 20px ${ACCENT_COLORS[index % ACCENT_COLORS.length]}25`, |
| 77 | + }" |
| 78 | + > |
| 79 | + {{ pkg }} |
| 80 | + </span> |
| 81 | + <span v-if="index < displayPackages.length - 1"> |
| 82 | + vs |
| 83 | + </span> |
| 84 | + </template> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + |
| 88 | + <div |
| 89 | + class="absolute -top-32 -inset-ie-32 w-[550px] h-[550px] rounded-full blur-3xl" |
| 90 | + :style="{ backgroundColor: primaryColor + '10' }" |
| 91 | + /> |
| 92 | + </div> |
| 93 | +</template> |
0 commit comments