SkateSpots/src/lib/diyGuides.ts
SkateSpots b247be13b0 DIY: parametric 2D deck designer with 1:1 printable template
New /diy/deck-designer tool. src/lib/deckDesign.ts holds the pure geometry
(outline, waist, rounded ends, kicks, concave) and the exporters; the component
renders a live top view, side profile and concave section with presets, saved
locally.

Exports: true-size SVG, a tiled 1:1 PDF (A4/Letter, split across sheets with
corner registration crosses), and an R12 DXF (outline polyline + 3/16" truck
holes + centreline, $INSUNITS=4). Truck patterns: New school 53.975x41.275 mm
and Old school 63.5x41.275 mm.

Deliberately 2D: this is the outline a builder traces and cuts, not a SK8CAD
clone (SK8CAD is proprietary; only its JSCAD engine is MIT, and we copied
nothing).
2026-10-05 11:16:34 +07:00

214 lines
6.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Curated DIY resources — how to make your own boards, ramps and concrete spots.
*
* Policy: point at **our own** app sections whenever we have something relevant
* (`to`), and otherwise show the topic as an unclickable **"coming soon"** card
* (`comingSoon: true`) instead of linking out. So this is a roadmap of what the
* DIY hub will cover, with live links where the app already has content.
*
* Content, not user data — no moderation. Titles/blurbs are i18n keys (`diyUi.*`).
*/
export type DiyCategoryId = 'boards' | 'ramps' | 'concrete' | 'repairs' | 'tools';
export interface DiyCategory {
id: DiyCategoryId;
titleKey: string;
emoji: string;
}
/** A resource card — an in-app link (`to`) or a "coming soon" placeholder. */
export interface DiyCard {
id: string;
/** Omit for the cross-link actions block. */
category?: DiyCategoryId;
titleKey: string;
blurbKey: string;
emoji: string;
/** In-app route. Omit for a coming-soon card. */
to?: string;
/** No destination yet — rendered unclickable with a "Coming soon" badge. */
comingSoon?: boolean;
}
export const DIY_CATEGORIES: DiyCategory[] = [
{ id: 'boards', titleKey: 'diyUi.categories.boards', emoji: '🛹' },
{ id: 'ramps', titleKey: 'diyUi.categories.ramps', emoji: '🪚' },
{ id: 'concrete', titleKey: 'diyUi.categories.concrete', emoji: '🧱' },
{ id: 'repairs', titleKey: 'diyUi.categories.repairs', emoji: '🔧' },
{ id: 'tools', titleKey: 'diyUi.categories.tools', emoji: '📐' },
];
export const DIY_CARDS: DiyCard[] = [
// ── Boards ────────────────────────────────────────────────────────────────
{
id: 'ossBuild',
category: 'boards',
emoji: '🛹',
titleKey: 'diyUi.cards.ossBuild.title',
blurbKey: 'diyUi.cards.ossBuild.blurb',
comingSoon: true,
},
{
id: 'sk8cad',
category: 'boards',
emoji: '🧊',
titleKey: 'diyUi.cards.sk8cad.title',
blurbKey: 'diyUi.cards.sk8cad.blurb',
comingSoon: true,
},
{
id: 'deckCost',
category: 'boards',
emoji: '💰',
titleKey: 'diyUi.cards.deckCost.title',
blurbKey: 'diyUi.cards.deckCost.blurb',
to: '/diy/deck-cost',
},
{
id: 'deckDesigner',
category: 'boards',
emoji: '📐',
titleKey: 'diyUi.cards.deckDesigner.title',
blurbKey: 'diyUi.cards.deckDesigner.blurb',
to: '/diy/deck-designer',
},
// ── Ramps & wooden obstacles ─────────────────────────────────────────────
{
id: 'ledgeBox',
category: 'ramps',
emoji: '📦',
titleKey: 'diyUi.cards.ledgeBox.title',
blurbKey: 'diyUi.cards.ledgeBox.blurb',
comingSoon: true,
},
{
id: 'quarterpipe',
category: 'ramps',
emoji: '🌊',
titleKey: 'diyUi.cards.quarterpipe.title',
blurbKey: 'diyUi.cards.quarterpipe.blurb',
comingSoon: true,
},
{
id: 'flatbar',
category: 'ramps',
emoji: '➖',
titleKey: 'diyUi.cards.flatbar.title',
blurbKey: 'diyUi.cards.flatbar.blurb',
comingSoon: true,
},
// ── Concrete & DIY spots ─────────────────────────────────────────────────
{
id: 'mapSpot',
category: 'concrete',
emoji: '📍',
titleKey: 'diyUi.cards.mapSpot.title',
blurbKey: 'diyUi.cards.mapSpot.blurb',
to: '/create-spot',
},
{
id: 'concreteBasics',
category: 'concrete',
emoji: '🧱',
titleKey: 'diyUi.cards.concreteBasics.title',
blurbKey: 'diyUi.cards.concreteBasics.blurb',
comingSoon: true,
},
{
id: 'coping',
category: 'concrete',
emoji: '🛞',
titleKey: 'diyUi.cards.coping.title',
blurbKey: 'diyUi.cards.coping.blurb',
comingSoon: true,
},
// ── Repairs & tuning ─────────────────────────────────────────────────────
{
id: 'regrip',
category: 'repairs',
emoji: '🩹',
titleKey: 'diyUi.cards.regrip.title',
blurbKey: 'diyUi.cards.regrip.blurb',
comingSoon: true,
},
{
id: 'tune',
category: 'repairs',
emoji: '🔩',
titleKey: 'diyUi.cards.tune.title',
blurbKey: 'diyUi.cards.tune.blurb',
comingSoon: true,
},
{
id: 'buyParts',
category: 'repairs',
emoji: '🛒',
titleKey: 'diyUi.cards.buyParts.title',
blurbKey: 'diyUi.cards.buyParts.blurb',
to: '/marketplace',
},
// ── Tools & plans ────────────────────────────────────────────────────────
{
id: 'printMolds',
category: 'tools',
emoji: '🖨️',
titleKey: 'diyUi.cards.printMolds.title',
blurbKey: 'diyUi.cards.printMolds.blurb',
comingSoon: true,
},
{
id: 'sk8cadTools',
category: 'tools',
emoji: '📐',
titleKey: 'diyUi.cards.sk8cadTools.title',
blurbKey: 'diyUi.cards.sk8cadTools.blurb',
comingSoon: true,
},
];
/**
* Cross-links into the rest of the app — the point of the section: turn a topic
* into a person, a place, or a sale.
*/
export const DIY_ACTIONS: DiyCard[] = [
{
id: 'find-builder',
emoji: '🧱',
titleKey: 'diyUi.actions.findBuilder.title',
blurbKey: 'diyUi.actions.findBuilder.blurb',
to: '/lab?craft=building',
},
{
id: 'find-crew',
emoji: '👥',
titleKey: 'diyUi.actions.findCrew.title',
blurbKey: 'diyUi.actions.findCrew.blurb',
to: '/crews',
},
{
id: 'map-spot-action',
emoji: '📍',
titleKey: 'diyUi.actions.mapSpot.title',
blurbKey: 'diyUi.actions.mapSpot.blurb',
to: '/create-spot',
},
{
id: 'sell-builds',
emoji: '🛒',
titleKey: 'diyUi.actions.sellBuilds.title',
blurbKey: 'diyUi.actions.sellBuilds.blurb',
to: '/create-listing',
},
{
id: 'find-coach',
emoji: '🎓',
titleKey: 'diyUi.actions.findCoach.title',
blurbKey: 'diyUi.actions.findCoach.blurb',
to: '/lab?craft=coaching',
},
];