feat: simplify the Cool City phone decision
ci / check (push) Successful in 54s
ci / check (pull_request) Successful in 56s

- 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
This commit is contained in:
Noel Sabia committed 2026-11-14 14:15:28 +01:00
1 parent 2bc52a314d
commit d908c3264d
6 files changed
+391 -527

No files matched your search

+125 -151
View File
@@ -1,60 +1,43 @@
<script setup lang="ts">
import type { CoolRouteOption, CoolRouteValues } from '#shared/cool'
import { coolDistance, coolMinutes, coolShade, coolStops, coolValues, coolYesNo } from '~/utils/cool'
import { coolDistance, coolMinutes, coolShade, coolStops, coolValues } from '~/utils/cool'
const props = withDefaults(
defineProps<{
route: CoolRouteOption
values: CoolRouteValues | null
recommended?: boolean
selected?: boolean
selectable?: boolean
}>(),
{ recommended: false, selected: false, selectable: false },
)
const props = defineProps<{
route: CoolRouteOption
values: CoolRouteValues | null
reason: string
}>()
const emit = defineEmits<{ select: [id: CoolRouteOption['id']] }>()
const data = computed(() => coolValues(props.values))
const ramp = computed(() =>
props.route.ramp ? props.route.ramp.incline.replace('.0%', '%') : 'no ramp',
)
</script>
<template>
<component
:is="selectable ? 'button' : 'article'"
class="cc-route-card"
:class="[
`cc-route-card--${route.id}`,
{ 'cc-route-card--recommended': recommended, 'cc-route-card--selected': selected },
]"
:type="selectable ? 'button' : undefined"
:aria-pressed="selectable ? selected : undefined"
@click="selectable ? emit('select', route.id) : undefined"
>
<span class="cc-route-card__line" aria-hidden="true" />
<span class="cc-route-card__head">
<span class="cc-route-card__label">{{ route.label }}</span>
<span v-if="recommended" class="cc-route-card__tag">Accessible for Ruth</span>
<span v-else-if="selected" class="cc-route-card__tag cc-route-card__tag--quiet">Selected</span>
</span>
<span class="cc-route-card__desc">{{ route.description }}</span>
<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>
<span class="cc-route-card__primary">
<strong>{{ coolShade(data.shadePct) }}</strong> shade
<span class="cc-route-card__modeled">modelled</span>
<span class="cc-route-card__divider">·</span>
<strong>{{ coolMinutes(data.directSunMin) }}</strong> direct sun
</span>
<p class="cc-route-card__reason">{{ reason }}</p>
<span class="cc-route-card__secondary">
{{ coolDistance(data.distanceM) }} · {{ coolMinutes(data.durationMin) }} ·
<template v-if="route.ramp">{{ route.ramp.incline.replace('.0%', '%') }} ramp</template>
<template v-else>no ramp</template>
</span>
<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>
<span class="cc-route-card__access">
Step-free {{ coolYesNo(data.stepFree) }} · Water {{ coolStops(data.waterStops) }} ·
Benches {{ coolStops(data.benchStops) }}
</span>
</component>
<div class="cc-route-card__action">
<slot name="action" />
</div>
</article>
</template>
<style scoped>
@@ -63,138 +46,129 @@ const data = computed(() => coolValues(props.values))
width: 100%;
min-width: 0;
flex-direction: column;
gap: 0.3rem;
padding: 0.95rem 1rem 0.85rem;
border: 1px solid var(--cc-line);
border-radius: 24px;
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: var(--cc-shadow-soft);
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);
font: inherit;
text-align: left;
}
button.cc-route-card {
cursor: pointer;
}
button.cc-route-card:hover {
border-color: var(--cc-line-strong);
}
.cc-route-card:focus-visible {
outline: 3px solid var(--cc-focus);
outline-offset: 2px;
}
.cc-route-card--selected {
border-color: var(--cc-ink);
box-shadow: 0 0 0 2px var(--cc-ink), var(--cc-shadow-soft);
}
.cc-route-card--recommended {
border-color: var(--cc-shade);
}
.cc-route-card__line {
display: block;
width: 100%;
height: 4px;
margin-bottom: 0.25rem;
border-radius: 999px;
background: var(--cc-ink);
}
.cc-route-card--shortest .cc-route-card__line {
background: var(--cc-heat);
}
.cc-route-card--shaded .cc-route-card__line {
background: var(--cc-shade);
}
.cc-route-card--accessible .cc-route-card__line {
background: var(--cc-ink);
}
.cc-route-card__head {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.45rem;
gap: 0.55rem;
}
.cc-route-card__label {
font-size: 1.18rem;
font-weight: 800;
letter-spacing: -0.02em;
}
.cc-route-card__tag {
margin-inline-start: auto;
padding: 0.16rem 0.42rem;
border-radius: 999px;
background: var(--cc-shade);
color: #fff;
font-size: 0.6rem;
font-weight: 750;
letter-spacing: 0.04em;
}
.cc-route-card__tag--quiet {
.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__desc {
color: var(--cc-muted);
font-size: 0.8rem;
line-height: 1.35;
.cc-route-card--shortest .cc-route-card__dot {
background: var(--cc-heat);
}
.cc-route-card__primary {
margin-top: 0.25rem;
color: var(--cc-ink);
font-size: 1.05rem;
font-weight: 500;
line-height: 1.35;
.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__primary strong {
font-size: 1.35rem;
font-weight: 800;
letter-spacing: -0.03em;
.cc-route-card__metrics > span {
white-space: nowrap;
}
.cc-route-card__modeled {
margin-inline-start: 0.2rem;
color: var(--cc-muted);
font-size: 0.58rem;
font-weight: 600;
letter-spacing: 0.03em;
text-transform: uppercase;
}
.cc-route-card__divider {
margin-inline: 0.25rem;
.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__secondary,
.cc-route-card__access {
color: var(--cc-muted);
font-size: 0.72rem;
line-height: 1.4;
font-variant-numeric: tabular-nums;
.cc-route-card__metric-break {
display: none;
}
.cc-route-card__access {
font-size: 0.68rem;
.cc-route-card__metrics strong {
color: var(--cc-ink);
font-weight: 750;
}
@media (min-width: 760px) {
.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.05rem 1.1rem;
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>