# Type on a curve

Slide the start of TIDAL PRESS along the wave. Each letter follows its local slope, so the first and last letters tilt differently.

## Try it

Switch between 10% and 60% and compare the tilt of the T and the final S.

## Interaction details

The SVG textPath startOffset ranges from 0 to 65% of path length. A red dot tracks the start, and the full phrase stays on the path.

## Platform controls

- iOS · Tap a number or drag the slider to move the start of the phrase.
- Android · Tap a number or drag the slider to move the start of the phrase.
- PC · Click a number or focus the slider and use the arrow keys to move by 1%.

## Where to use it

Place a phrase on a curved logo or a circular label.

## Implementation prompt

> Set a phrase on one curve with a continuously adjustable start. Orient each letter to the tangent at its own position and mark the start point.

## Sources and credits

[MDN · SVG startOffset](<https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/startOffset>)

## Standalone HTML

Save the code below as an HTML file and open it in your browser. The example works offline.

```html
<!doctype html>
<html lang="en" data-motion-locales="inline">
<head><script>if(new URLSearchParams(location.search).get('reduce')==='1')document.documentElement.classList.add('motion-reduced');</script><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>곡선 위 활자 · MotionLab</title>
<style>
* { box-sizing: border-box; }
:root { color-scheme: light; font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif; background: #f4f1e9; color: #272923; }
body { margin: 0; min-height: 100svh; display: grid; align-content: center; padding: clamp(8px, 2.6vmin, 18px); }
main { width: min(100%, 680px); margin: auto; }
header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; padding: 0 1px 7px; }
h1 { font-size: clamp(17px, 3.3vw, 28px); line-height: 1.16; margin: 0; letter-spacing: -.045em; }
header span { font: 600 10px/1.4 ui-monospace, monospace; letter-spacing: .06em; }
.stage { display: block; width: 100%; height: auto; border-radius: 6px; }
.controls { margin-top: 10px; display: grid; grid-template-columns: auto minmax(76px,1fr) auto; align-items: center; gap: 5px 10px; }
label { font-size: 13px; font-weight: 700; }
input[type="range"] { width: 100%; min-width: 50px; height: 32px; margin: 0; accent-color: var(--accent); }
output { text-align: right; font: 650 14px ui-monospace,monospace; min-width: 4ch; }
footer { display: flex; gap: 6px 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: 5px; }
button { border: 1px solid #898984; border-radius: 4px; min-height: 32px; min-width: 42px; background: #fcfaf5; color: inherit; padding: 3px 10px; cursor: pointer; font: 650 13px/1.15 inherit; font-family: inherit; font-size: 13px; }
button[aria-pressed="true"] { background: #2b302b; border-color: #2b302b; color: white; }
:focus-visible { outline: 3px solid #1772be; outline-offset: 2px; }
details { font-size: 11px; color: #55594c; } summary { cursor:pointer; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.45 ui-monospace, monospace; }
#hint { font-size: 12px; line-height: 1.4; margin: 7px 0 0; }
@media(max-width:480px){body{padding:8px;} .controls{gap:5px;}button{min-height:40px;}header span{font-size:9px;}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;}}
html.motion-reduced *,html.motion-reduced *::before,html.motion-reduced *::after{scroll-behavior:auto!important;}
:root { --accent: #215f4b; }

</style></head>
<body><main>
<header><h1 data-ui="title">곡선 위 활자</h1><span>startOffset</span></header>
<svg class="stage" viewBox="0 0 640 275" role="img" aria-labelledby="art-title art-desc" xmlns="http://www.w3.org/2000/svg">
<title id="art-title" data-ui="art"></title><desc id="art-desc" data-ui="desc"></desc>
<defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="1" cy="1" r=".9" fill="#788f81"/></pattern></defs>
<rect width="640" height="275" fill="#dae5d6"/><rect x="14" y="14" width="612" height="247" rx="1" fill="url(#grid)" opacity=".6"/>
<g stroke="#95a899" fill="none"><path d="M27 176Q167 8 309 147T612 101" transform="translate(0,20)"/><path d="M27 176Q167 8 309 147T612 101" transform="translate(0,40)"/><path d="M27 176Q167 8 309 147T612 101" transform="translate(0,60)"/></g>
<path id="arc" d="M27 176Q167 8 309 147T612 101" stroke="#295346" stroke-width="1.6" fill="none"/>
<circle cx="27" cy="176" r="3" fill="#295346"/><circle cx="612" cy="101" r="3" fill="#295346"/>
<text id="lettering" font-family="Georgia,'Times New Roman',serif" font-size="28" font-weight="bold" letter-spacing="1.4" fill="#103f36"><textPath id="phrase" href="#arc" startOffset="10%">TIDAL PRESS</textPath></text>
<circle id="pin" r="5" fill="#bb3e29" stroke="#fff8e9" stroke-width="1.6"/>
<g fill="#305546" font-family="ui-monospace,monospace" font-size="12" letter-spacing="1.5"><text x="27" y="37">TIDAL PRESS</text></g>
<g transform="translate(488,213)" stroke="#305546" fill="none"><path d="M0 12Q8 2 16 12T32 12T48 12T64 12T80 12T96 12"/><path d="M0 20Q8 10 16 20T32 20T48 20T64 20T80 20T96 20"/></g>
</svg>
<div class="controls"><label for="axis" data-ui="label">시작 위치</label><input type="range" id="axis" min="0" max="65" step="1" value="10"><output for="axis" id="value">10%</output></div>
<footer><fieldset aria-labelledby="axis-label"><legend id="axis-label" hidden data-ui="label">시작 위치</legend><button type="button" data-value="10">10%</button><button type="button" data-value="35">35%</button><button type="button" data-value="60">60%</button></fieldset>
</footer>
<p id="hint" data-ui="hint">문구의 시작점을 옮기며 첫 글자와 끝 글자의 기울기를 비교해 보세요.</p>
</main>
<script>
const ui = {
  "ko": {
    "title": "곡선 위 활자",
    "art": "물결 곡선 위의 TIDAL PRESS",
    "desc": "붉은 점은 문구의 시작 위치를 표시합니다.",
    "label": "시작 위치",
    "hint": "문구의 시작점을 옮기며 첫 글자와 끝 글자의 기울기를 비교해 보세요."
  },
  "en": {
    "title": "Type on a curve",
    "art": "TIDAL PRESS set on a wave",
    "desc": "A red point marks the start of the phrase.",
    "label": "Start offset",
    "hint": "Move the phrase and compare the tilt of its first and last letters."
  },
  "es": {
    "title": "Texto en una curva",
    "art": "TIDAL PRESS sobre una onda",
    "desc": "Un punto rojo indica el comienzo de la frase.",
    "label": "Punto de inicio",
    "hint": "Mueve la frase y compara la inclinación de su primera y su última letra."
  },
  "zh-Hans": {
    "title": "沿曲线排列文字",
    "art": "沿波浪排列的 TIDAL PRESS",
    "desc": "红点标记文字的起始位置。",
    "label": "起始位置",
    "hint": "移动文字的起点，比较首尾字母的倾斜角度。"
  }
};
const params = new URLSearchParams(location.search);
const requested = params.get('lang') || document.documentElement.lang || 'ko';
const lang = Object.hasOwn(ui, requested) ? requested : 'ko';
document.documentElement.lang = lang;
if (params.get('reduce') === '1') document.documentElement.classList.add('motion-reduced');
const t = ui[lang];
for (const el of document.querySelectorAll('[data-ui]')) el.textContent = t[el.dataset.ui];
document.title = t.title + ' · MotionLab';
const range = document.querySelector('#axis');
const valueLabel = document.querySelector('#value');
const buttons = Array.from(document.querySelectorAll('[data-value]'));
function draw() {
  const value = Number(range.value);
  const path = document.querySelector('#arc');
  const point = path.getPointAtLength(path.getTotalLength() * value / 100);
  document.querySelector('#phrase').setAttribute('startOffset', value + '%');
  document.querySelector('#pin').setAttribute('cx', point.x);
  document.querySelector('#pin').setAttribute('cy', point.y);
  valueLabel.textContent = value + '%';
  for (const button of buttons) button.setAttribute('aria-pressed', String(Number(button.dataset.value) === value));
}
for (const button of buttons) button.addEventListener('click', () => {range.value = button.dataset.value; draw();});
range.addEventListener('input', draw);
draw();
</script>
</body></html>
```
