# Loose type letterpress hero you can push around

> A bold cobalt hero where every headline letter is a loose piece of type that springs away from your finger or cursor and settles back.

- Category: Business
- Version: 1.0
- Source: https://ownlyplans.com/bhaskar/loose-type-letterpress-hero-you-can-push-around/

## Overview

A single-file hero for a letterpress studio, with no libraries. The headline is split into letters. Each letter has its own small spring, so it is pushed away by the pointer, tilts as it goes and settles back. Pressing harder (mouse down or touch) makes the push stronger. The first view is one entrance moment: the letters drop in as if the line has just been locked up. The page is plain cobalt blue and white, with one serif face doing all the work.

## Tech stack

- CSS
- HTML
- JavaScript

## Build steps

### 1. Set the cobalt page and the type

Use one strong colour and one heavy serif. The headline is the whole design, so keep everything around it quiet.

Prompt:

```text
Create a single-file HTML hero for Galley & Co., a two-press letterpress studio. Page colour cobalt #2438ff with a soft navy glow in the bottom right, text in paper white #fbfaf5, secondary text #c7ccff. Fonts: Fraunces 900 for the headline and Instrument Sans for everything else, loaded from Google Fonts with Georgia and system-ui fallbacks. Layout: a top bar with the studio name and a few links, then a giant two-line headline, "Set in lead." in solid white and "Pulled by hand." as outlined letters (transparent fill, 2px white text stroke), left aligned. Below it put a short paragraph and two buttons, and a thin rule and small footer line at the bottom. The headline should be about 13vw wide so it fills the page.
```

**Done when:** A cobalt page with a huge two-line headline, one solid and one outlined, a paragraph, two buttons and a footer line.

### 2. Split the headline into letters

Turn each character into its own inline-block span so it can move on its own, while keeping the headline readable for screen readers.

Prompt:

```text
In JavaScript, take the text of each headline row from a data attribute and create one inline-block span per character (use a non-breaking space for spaces). Keep the headline as one accessible label with aria-label and mark the visual rows aria-hidden. Store each letter's centre point from getBoundingClientRect after fonts have loaded and again on resize and scroll. Give each letter its own state: x, y, rotation and their velocities.
```

**Done when:** The headline looks the same as before, but each letter is its own element with a stored position.

### 3. Add the spring and the push

Every frame, push letters away from the pointer and pull them back toward home. Damping makes them settle instead of wobbling forever.

Prompt:

```text
Run a requestAnimationFrame loop. For each letter, measure its distance to the pointer. Inside a radius of about 16% of the screen width (between 120px and 240px) add a velocity away from the pointer that grows with the square of how close it is, and add a rotation velocity in the same direction. Pressing the pointer down multiplies the push by about 1.6. Then add a spring that pulls x, y and rotation back to zero (about 7.5% of the offset per frame), damp the velocities (multiply by 0.82 for position, 0.8 for rotation) and apply the result with transform: translate3d and rotate. At start, drop every letter in from above with a small random tilt so the first thing the visitor sees is the line being locked up.
```

**Done when:** Moving the mouse over the headline scatters the letters, and they spring back into place when you move away.

### 4. Make it work on phones and respect reduced motion

The same effect works with a finger. Then handle the small screen and anyone who asks for less motion.

Prompt:

```text
Use pointer events so touch and mouse share the same code, and set touch-action: pan-y on the hero so vertical scrolling still works. Reset the pointer position when the finger lifts or leaves. At 760px and below hide the text links, make the paragraph and buttons stack, make the buttons share the row, and stack the footer lines. If prefers-reduced-motion is on, skip the animation loop and draw the letters once in their home position. Check there is no horizontal scrolling at 390px wide.
```

**Done when:** On a phone, dragging a finger across the headline pushes the letters, the page still scrolls, and nothing overflows sideways.

## Assets

### loose-type-hero.html — The finished file. Open it in a browser.

```
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#2438ff">
<title>Galley &amp; Co. · Letterpress studio</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,900&family=Instrument+Sans:wght@400;500;600&display=swap">
<style>
:root{--blue:#2438ff;--navy:#0b1470;--paper:#fbfaf5;--lead:#c7ccff;--ink:#0a0f3d;
--serif:"Fraunces",Georgia,"Times New Roman",serif;--sans:"Instrument Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box;margin:0}
html,body{height:100%;background:var(--blue);color:var(--paper);font-family:var(--sans);-webkit-font-smoothing:antialiased}
.hero{position:relative;min-height:100vh;min-height:100svh;overflow:hidden;display:grid;grid-template-rows:auto 1fr auto;padding:0 clamp(20px,4.5vw,64px);touch-action:pan-y}
.hero::before{content:"";position:absolute;inset:0;background:radial-gradient(120% 80% at 80% 110%,rgba(11,20,112,.55),transparent 60%);pointer-events:none}
header,footer{position:relative;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:20px}
header{padding-block:26px}
.mark{font-family:var(--serif);font-weight:900;font-size:22px;letter-spacing:-.02em;color:var(--paper);text-decoration:none}
nav{display:flex;gap:26px;align-items:center;font-size:15px}
nav a{color:var(--lead);text-decoration:none;font-weight:500}
nav a:hover,nav a:focus-visible{color:#fff}
nav .pill{background:var(--paper);color:var(--blue);padding:9px 16px;border-radius:8px;font-weight:600}
a:focus-visible,button:focus-visible{outline:2px solid #fff;outline-offset:3px;border-radius:6px}
main{position:relative;z-index:1;display:flex;flex-direction:column;justify-content:center;padding-block:10px 20px;min-height:0}
h1{font-family:var(--serif);font-weight:900;font-size:clamp(54px,13.4vw,236px);line-height:.86;letter-spacing:-.045em;font-variation-settings:"opsz" 144;color:var(--paper);user-select:none;-webkit-user-select:none}
h1 .row{display:block;white-space:nowrap}
h1 .row.soft{color:transparent;-webkit-text-stroke:2px var(--paper)}
.ch{display:inline-block;will-change:transform;transform:translate3d(0,0,0)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.under{position:relative;z-index:2;margin-top:clamp(18px,3vw,36px);display:grid;grid-template-columns:minmax(0,38ch) auto;gap:24px 48px;align-items:end;justify-content:space-between}
.under p{font-size:clamp(16px,1.4vw,19px);line-height:1.55;color:var(--lead)}
.cta{display:flex;gap:12px;flex-wrap:wrap}
.btn{font:600 15px/1 var(--sans);padding:15px 22px;border-radius:10px;text-decoration:none;cursor:pointer;border:1px solid transparent}
.btn.main{background:var(--paper);color:var(--blue)}
.btn.main:hover{background:#fff}
.btn.ghost{border-color:rgba(255,255,255,.4);color:#fff}
.btn.ghost:hover{border-color:#fff}
footer{padding-block:22px;font-size:13px;color:var(--lead);border-top:1px solid rgba(255,255,255,.22);margin-top:clamp(20px,3vw,36px)}
footer span:last-child{text-align:right}
@media (max-width:760px){
 nav a:not(.pill){display:none}
 .under{grid-template-columns:1fr}
 h1 .row.soft{-webkit-text-stroke-width:1.5px}
 footer{flex-direction:column;align-items:flex-start;gap:6px}
 footer span:last-child{text-align:left}
 .btn{flex:1 1 auto;text-align:center}
}
</style>
</head>
<body>
<section class="hero" id="hero">
<header>
 <a class="mark" href="#">Galley &amp; Co.</a>
 <nav><a href="#">Work</a><a href="#">Presses</a><a href="#">Commissions</a><a class="pill" href="#">Book a visit</a></nav>
</header>
<main>
 <h1 id="h1" aria-label="Set in lead. Pulled by hand.">
  <span class="row" aria-hidden="true" data-t="Set in lead."></span>
  <span class="row soft" aria-hidden="true" data-t="Pulled by hand."></span>
 </h1>
 <div class="under">
  <p>A two-press letterpress studio in Visakhapatnam. Wedding suites, book covers and posters, set one letter at a time and printed on cotton paper that holds the bite.</p>
  <div class="cta"><a class="btn main" href="#">See the print wall</a><a class="btn ghost" href="#">Ask for a quote</a></div>
 </div>
</main>
<footer><span>Hand-set since 2014</span><span>Try pushing the letters</span></footer>
</section>
<script>
(function(){
var reduce=matchMedia('(prefers-reduced-motion:reduce)').matches,hero=document.getElementById('hero'),chars=[];
document.querySelectorAll('.row').forEach(function(r){
 r.dataset.t.split('').forEach(function(ch){
  var s=document.createElement('span');s.className='ch';s.textContent=ch===' '?' ':ch;r.appendChild(s);
  chars.push({el:s,x:0,y:0,vx:0,vy:0,r:0,vr:0,cx:0,cy:0})
 })
});
var mx=-999,my=-999,down=false,lastMX=0,lastMY=0,kx=0,ky=0;
function measure(){chars.forEach(function(c){c.el.style.transform='none'});chars.forEach(function(c){var b=c.el.getBoundingClientRect();c.cx=b.left+b.width/2;c.cy=b.top+b.height/2;c.w=b.width});}
function place(){measure()}
addEventListener('resize',place);
if(document.fonts&&document.fonts.ready)document.fonts.ready.then(place);
place();
function move(e){mx=e.clientX;my=e.clientY;kx=mx-lastMX;ky=my-lastMY;lastMX=mx;lastMY=my}
hero.addEventListener('pointermove',move,{passive:true});
hero.addEventListener('pointerdown',function(e){down=true;move(e)});
addEventListener('pointerup',function(){down=false;mx=my=-999});
hero.addEventListener('pointerleave',function(){mx=my=-999});
addEventListener('scroll',place,{passive:true});
// one entrance: letters drop in like a composed line being locked up
chars.forEach(function(c,i){c.y=-60-(i%5)*14;c.r=(i%2?1:-1)*(8+(i%4)*3);c.vy=0});
var R=Math.min(220,innerWidth*.22);
function step(){
 var rad=Math.min(240,Math.max(120,innerWidth*.16));
 for(var i=0;i<chars.length;i++){
  var c=chars[i],dx=c.cx+c.x-mx,dy=c.cy+c.y-my,d=Math.sqrt(dx*dx+dy*dy)||1;
  if(d<rad){var f=(1-d/rad);f=f*f*(down?2.4:1.5);c.vx+=dx/d*f*3.2;c.vy+=dy/d*f*3.2;c.vr+=(dx>0?1:-1)*f*1.4}
  c.vx+=-c.x*.075;c.vy+=-c.y*.075;c.vr+=-c.r*.08;
  c.vx*=.82;c.vy*=.82;c.vr*=.8;
  c.x+=c.vx;c.y+=c.vy;c.r+=c.vr;
  c.el.style.transform='translate3d('+c.x.toFixed(1)+'px,'+c.y.toFixed(1)+'px,0) rotate('+c.r.toFixed(2)+'deg)'
 }
 if(!reduce)requestAnimationFrame(step)
}
if(reduce){chars.forEach(function(c){c.y=0;c.r=0});step()}else requestAnimationFrame(step);
})();
</script>
</body>
</html>
```


## Build instructions by tool

### Claude Code

Open a terminal in an empty folder, run `claude`, then paste the prompt.

```text
Build the "Loose type letterpress hero you can push around" app from the OwnlyPlans blueprint at https://ownlyplans.com/bhaskar/loose-type-letterpress-hero-you-can-push-around/.
Stack: CSS, HTML, JavaScript.
Follow the plan's steps in order: Set the cobalt page and the type → Split the headline into letters → Add the spring and the push → Make it work on phones and respect reduced motion.
Download the full plan (Markdown) from the link above and keep it in the project root as PLAN.md.
Ask me before adding anything not in the plan. (Prepared for Claude Code.)
```

### Cursor

Open an empty folder in Cursor, start an Agent chat, then paste the prompt.

```text
Build the "Loose type letterpress hero you can push around" app from the OwnlyPlans blueprint at https://ownlyplans.com/bhaskar/loose-type-letterpress-hero-you-can-push-around/.
Stack: CSS, HTML, JavaScript.
Follow the plan's steps in order: Set the cobalt page and the type → Split the headline into letters → Add the spring and the push → Make it work on phones and respect reduced motion.
Download the full plan (Markdown) from the link above and keep it in the project root as PLAN.md.
Ask me before adding anything not in the plan. (Prepared for Cursor.)
```

### Lovable

Start a new Lovable project and paste the prompt as your first message.

```text
Build the "Loose type letterpress hero you can push around" app from the OwnlyPlans blueprint at https://ownlyplans.com/bhaskar/loose-type-letterpress-hero-you-can-push-around/.
Stack: CSS, HTML, JavaScript.
Follow the plan's steps in order: Set the cobalt page and the type → Split the headline into letters → Add the spring and the push → Make it work on phones and respect reduced motion.
Download the full plan (Markdown) from the link above and keep it in the project root as PLAN.md.
Ask me before adding anything not in the plan. (Prepared for Lovable.)
```

## Definition of done

- Every build step is complete and the app runs locally.
- The main user flow works end to end.
- Share your build on OwnlyPlans with a demo link, build time and tool.
