- replace the three stacked route cards with a Shortest | Shaded | Accessible segmented control and one large card - default to Accessible for Ruth; keep the 16:00 trade-off visible as one sentence - fold the audience vote into the card's primary action so the mobile action stays above the fold - soften cards with a 28 px radius, soft shadow and one subtle selected ring - leave the stage and city information architecture intact
175 lines
3.9 KiB
Vue
175 lines
3.9 KiB
Vue
<script setup lang="ts">
|
|
import type { CoolRouteOption, CoolRouteValues } from '#shared/cool'
|
|
import { coolDistance, coolMinutes, coolShade, coolStops, coolValues } from '~/utils/cool'
|
|
|
|
const props = defineProps<{
|
|
route: CoolRouteOption
|
|
values: CoolRouteValues | null
|
|
reason: string
|
|
}>()
|
|
|
|
const data = computed(() => coolValues(props.values))
|
|
const ramp = computed(() =>
|
|
props.route.ramp ? props.route.ramp.incline.replace('.0%', '%') : 'no ramp',
|
|
)
|
|
</script>
|
|
|
|
<template>
|
|
<article class="cc-route-card" :class="`cc-route-card--${route.id}`">
|
|
<div class="cc-route-card__head">
|
|
<span class="cc-route-card__dot" aria-hidden="true" />
|
|
<h3 class="cc-route-card__label">{{ route.label }}</h3>
|
|
</div>
|
|
|
|
<p class="cc-route-card__reason">{{ reason }}</p>
|
|
|
|
<p class="cc-route-card__metrics">
|
|
<span><strong>{{ coolShade(data.shadePct) }}</strong> shade</span>
|
|
<span><strong>{{ coolMinutes(data.directSunMin) }}</strong> direct sun</span>
|
|
<span>{{ coolDistance(data.distanceM) }}</span>
|
|
<span>{{ coolMinutes(data.durationMin) }}</span>
|
|
<span class="cc-route-card__metric-break" aria-hidden="true" />
|
|
<span>{{ ramp }}</span>
|
|
<span>water {{ coolStops(data.waterStops) }}</span>
|
|
<span>benches {{ coolStops(data.benchStops) }}</span>
|
|
</p>
|
|
|
|
<div class="cc-route-card__action">
|
|
<slot name="action" />
|
|
</div>
|
|
</article>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.cc-route-card {
|
|
display: flex;
|
|
width: 100%;
|
|
min-width: 0;
|
|
flex-direction: column;
|
|
gap: 0.5rem;
|
|
padding: 1.1rem 1.15rem 1.05rem;
|
|
border-radius: 28px;
|
|
background: var(--cc-surface, rgba(255, 255, 255, 0.86));
|
|
box-shadow:
|
|
0 0 0 1px color-mix(in srgb, var(--cc-shade) 24%, transparent),
|
|
0 18px 48px rgba(18, 18, 18, 0.08);
|
|
backdrop-filter: blur(20px) saturate(140%);
|
|
-webkit-backdrop-filter: blur(20px) saturate(140%);
|
|
color: var(--cc-ink);
|
|
}
|
|
|
|
.cc-route-card__head {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.55rem;
|
|
}
|
|
|
|
.cc-route-card__dot {
|
|
display: block;
|
|
width: 0.5rem;
|
|
height: 0.5rem;
|
|
flex: 0 0 auto;
|
|
border-radius: 50%;
|
|
background: var(--cc-ink);
|
|
}
|
|
|
|
.cc-route-card--shortest .cc-route-card__dot {
|
|
background: var(--cc-heat);
|
|
}
|
|
|
|
.cc-route-card--shaded .cc-route-card__dot {
|
|
background: var(--cc-shade);
|
|
}
|
|
|
|
.cc-route-card__label {
|
|
margin: 0;
|
|
font-size: clamp(1.7rem, 5.6vw, 2.5rem);
|
|
font-weight: 850;
|
|
letter-spacing: -0.045em;
|
|
line-height: 0.95;
|
|
}
|
|
|
|
.cc-route-card__reason {
|
|
max-width: 52ch;
|
|
margin: 0;
|
|
color: var(--cc-muted);
|
|
font-size: 0.88rem;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.cc-route-card__metrics {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.15rem 0;
|
|
margin: 0.1rem 0 0;
|
|
color: var(--cc-ink-2);
|
|
font-size: 0.82rem;
|
|
line-height: 1.6;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.cc-route-card__metrics > span {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.cc-route-card__metrics > span:not(.cc-route-card__metric-break):not(:last-child)::after {
|
|
content: "·";
|
|
margin-inline: 0.55rem;
|
|
color: var(--cc-line-strong);
|
|
}
|
|
|
|
.cc-route-card__metric-break {
|
|
display: none;
|
|
}
|
|
|
|
.cc-route-card__metrics strong {
|
|
color: var(--cc-ink);
|
|
font-weight: 750;
|
|
}
|
|
|
|
.cc-route-card__action {
|
|
margin-top: 0.3rem;
|
|
}
|
|
|
|
.cc-route-card__action :deep(.onyx-button) {
|
|
width: 100%;
|
|
min-height: 52px;
|
|
border-radius: 999px;
|
|
font-family: var(--cc-font);
|
|
font-weight: 650;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
|
|
.cc-route-card__action :deep(.onyx-button__label) {
|
|
font-size: 0.92rem;
|
|
}
|
|
|
|
@media (min-width: 640px) {
|
|
.cc-route-card {
|
|
padding: 1.35rem 1.45rem 1.3rem;
|
|
}
|
|
|
|
.cc-route-card__metric-break {
|
|
display: block;
|
|
flex-basis: 100%;
|
|
height: 0;
|
|
}
|
|
|
|
.cc-route-card__metrics > span:not(.cc-route-card__metric-break):has(+ .cc-route-card__metric-break)::after {
|
|
content: none;
|
|
}
|
|
|
|
.cc-route-card__action :deep(.onyx-button) {
|
|
width: auto;
|
|
min-width: 15rem;
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.cc-route-card {
|
|
backdrop-filter: none;
|
|
-webkit-backdrop-filter: none;
|
|
}
|
|
}
|
|
</style>
|