# Pencil list on a notebook page

> On a ruled notebook page, a pencil writes each line from left to right and then crosses out what is already done.

- Category: [Text & scroll](https://library.aimran.es/components/text-scroll)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tx-notebook-ink
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A ruled page with a red margin and punched holes sets the scene, and a CSS clip path uncovers each line while a small pencil travels along it, so the list looks written live. Finished tasks then get a marker strike. It suits to-do apps, planners, onboarding checklists, schools and any product that talks about getting things done.

Change the heading in the text field and the tasks in the list; add the done class to the ones that should be crossed out. The main color is the ink and the secondary one the strike. The text is real, so screen readers read it straight away.

## Code

### HTML

```html
<div class="uvq14-nb"><div class="pg"><p class="dt">Monday, 3 March</p><h3><span class="w" style="--i:0"><span class="t">Things for today</span><i class="pn" aria-hidden="true"></i></span></h3><ul><li class="dn"><span class="w" style="--i:1"><span class="t">Call the printer</span><i class="pn" aria-hidden="true"></i></span></li><li class="dn"><span class="w" style="--i:2"><span class="t">Buy coffee and envelopes</span><i class="pn" aria-hidden="true"></i></span></li><li><span class="w" style="--i:3"><span class="t">Water the plants</span><i class="pn" aria-hidden="true"></i></span></li></ul></div><button type="button" class="rw">Write it again</button></div>
```

### CSS

```css
.uvq14-nb {
  --c1: #1d4ed8;
  --c2: #dc2626;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq14-nb {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 19em;
  display: grid;
  justify-items: center;
  gap: 1em;
}

.uvq14-nb .pg {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: .9em 1em 1.3em 3em;
  color: var(--c1);
  background: linear-gradient(90deg,transparent 2.3em,rgba(220,38,38,.55) 2.3em 2.4em,transparent 2.4em),repeating-linear-gradient(transparent 0 calc(1.9em - 1px),#a9c7e8 calc(1.9em - 1px) 1.9em) 0 .9em/100% 100% no-repeat,#fffdf6;
  border-radius: .2em .6em .6em .2em;
  box-shadow: 0 .1em .2em rgba(0,0,0,.08),0 1.2em 2em -1.2em rgba(0,0,0,.35);
  font-family: "Segoe Print","Bradley Hand","Chalkboard SE","Comic Sans MS",cursive;
}

.uvq14-nb .pg::before {
  content: "";
  position: absolute;
  left: .8em;
  top: 1.4em;
  bottom: 1.4em;
  width: .7em;
  background: radial-gradient(circle,var(--bg) .3em,transparent .32em) 0 0/.7em 3.8em repeat-y;
}

.uvq14-nb .dt {
  margin: 0;
  height: 1.9em;
  line-height: 1.9em;
  font-size: .72em;
  text-align: right;
  color: #6b7280;
}

.uvq14-nb h3,.uvq14-nb li {
  margin: 0;
  height: 1.9em;
  line-height: 1.9em;
  font-weight: 700;
}

.uvq14-nb h3 {
  font-size: 1.15em;
  line-height: 1.65em;
  height: 1.65em;
}

.uvq14-nb ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1em;
}

.uvq14-nb li::before {
  content: "·";
  margin-right: .4em;
}

.uvq14-nb .w {
  position: relative;
  display: inline-block;
}

.uvq14-nb .t {
  display: inline-block;
  clip-path: inset(-20% 100% -20% 0);
}

.uvq14-nb .pn {
  position: absolute;
  left: 0;
  bottom: .35em;
  width: .32em;
  height: 1.7em;
  border-radius: .1em .1em 0 0;
  opacity: 0;
  transform-origin: 50% 100%;
  rotate: 28deg;
  background: linear-gradient(transparent 0 76%,#e7c79c 76% 90%,#333 90%),linear-gradient(90deg,#f5b800 0 50%,#e0a400 50%);
  clip-path: polygon(0 0,100% 0,100% 76%,50% 100%,0 76%);
}

.uvq14-nb.on .t {
  animation: uvq14-nb-w calc(1s / var(--k)) linear calc(var(--i) * calc(1.05s / var(--k))) forwards;
}

.uvq14-nb.on .pn {
  animation: uvq14-nb-p calc(1s / var(--k)) linear calc(var(--i) * calc(1.05s / var(--k))) both;
}

.uvq14-nb .dn .w::after {
  content: "";
  position: absolute;
  left: -.15em;
  right: -.15em;
  top: 52%;
  height: .13em;
  border-radius: 1em;
  background: var(--c2);
  transform: scaleX(0);
  transform-origin: 0 50%;
  rotate: -1.5deg;
}

.uvq14-nb.on .dn .w::after {
  animation: uvq14-nb-s calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(calc(4.3s / var(--k)) + var(--i) * calc(0.3s / var(--k))) forwards;
}

.uvq14-nb .rw {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .55em 1.1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-nb .rw:hover {
  transform: translateY(-2px);
}

.uvq14-nb .rw:active {
  transform: scale(.95);
}

.uvq14-nb .rw:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq14-nb-w {
  to {
    clip-path: inset(-20% -5% -20% 0);
  }
}

@keyframes uvq14-nb-p {
  0% {
    left: 0;
    opacity: 1;
  }
  96% {
    left: 100%;
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes uvq14-nb-s {
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-nb,.uvq14-nb *,.uvq14-nb *::before,.uvq14-nb *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq14-nb").forEach(el => {
  const go=()=>{el.classList.remove("on");void el.offsetWidth;el.classList.add("on")};const io=new IntersectionObserver(es=>{if(es[0].isIntersecting){go();io.disconnect()}},{threshold:.5});io.observe(el);el.querySelector(".rw").addEventListener("click",go);return()=>io.disconnect()
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq14-nb {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 19em;
  display: grid;
  justify-items: center;
  gap: 1em;
}

.uvq14-nb .pg {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: .9em 1em 1.3em 3em;
  color: var(--c1);
  background: linear-gradient(90deg,transparent 2.3em,rgba(220,38,38,.55) 2.3em 2.4em,transparent 2.4em),repeating-linear-gradient(transparent 0 calc(1.9em - 1px),#a9c7e8 calc(1.9em - 1px) 1.9em) 0 .9em/100% 100% no-repeat,#fffdf6;
  border-radius: .2em .6em .6em .2em;
  box-shadow: 0 .1em .2em rgba(0,0,0,.08),0 1.2em 2em -1.2em rgba(0,0,0,.35);
  font-family: "Segoe Print","Bradley Hand","Chalkboard SE","Comic Sans MS",cursive;
}

.uvq14-nb .pg::before {
  content: "";
  position: absolute;
  left: .8em;
  top: 1.4em;
  bottom: 1.4em;
  width: .7em;
  background: radial-gradient(circle,var(--bg) .3em,transparent .32em) 0 0/.7em 3.8em repeat-y;
}

.uvq14-nb .dt {
  margin: 0;
  height: 1.9em;
  line-height: 1.9em;
  font-size: .72em;
  text-align: right;
  color: #6b7280;
}

.uvq14-nb h3,.uvq14-nb li {
  margin: 0;
  height: 1.9em;
  line-height: 1.9em;
  font-weight: 700;
}

.uvq14-nb h3 {
  font-size: 1.15em;
  line-height: 1.65em;
  height: 1.65em;
}

.uvq14-nb ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1em;
}

.uvq14-nb li::before {
  content: "·";
  margin-right: .4em;
}

.uvq14-nb .w {
  position: relative;
  display: inline-block;
}

.uvq14-nb .t {
  display: inline-block;
  clip-path: inset(-20% 100% -20% 0);
}

.uvq14-nb .pn {
  position: absolute;
  left: 0;
  bottom: .35em;
  width: .32em;
  height: 1.7em;
  border-radius: .1em .1em 0 0;
  opacity: 0;
  transform-origin: 50% 100%;
  rotate: 28deg;
  background: linear-gradient(transparent 0 76%,#e7c79c 76% 90%,#333 90%),linear-gradient(90deg,#f5b800 0 50%,#e0a400 50%);
  clip-path: polygon(0 0,100% 0,100% 76%,50% 100%,0 76%);
}

.uvq14-nb.on .t {
  animation: uvq14-nb-w calc(1s / var(--k)) linear calc(var(--i) * calc(1.05s / var(--k))) forwards;
}

.uvq14-nb.on .pn {
  animation: uvq14-nb-p calc(1s / var(--k)) linear calc(var(--i) * calc(1.05s / var(--k))) both;
}

.uvq14-nb .dn .w::after {
  content: "";
  position: absolute;
  left: -.15em;
  right: -.15em;
  top: 52%;
  height: .13em;
  border-radius: 1em;
  background: var(--c2);
  transform: scaleX(0);
  transform-origin: 0 50%;
  rotate: -1.5deg;
}

.uvq14-nb.on .dn .w::after {
  animation: uvq14-nb-s calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(calc(4.3s / var(--k)) + var(--i) * calc(0.3s / var(--k))) forwards;
}

.uvq14-nb .rw {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .55em 1.1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-nb .rw:hover {
  transform: translateY(-2px);
}

.uvq14-nb .rw:active {
  transform: scale(.95);
}

.uvq14-nb .rw:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq14-nb-w {
  to {
    clip-path: inset(-20% -5% -20% 0);
  }
}

@keyframes uvq14-nb-p {
  0% {
    left: 0;
    opacity: 1;
  }
  96% {
    left: 100%;
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes uvq14-nb-s {
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-nb,.uvq14-nb *,.uvq14-nb *::before,.uvq14-nb *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const go=()=>{el.classList.remove("on");void el.offsetWidth;el.classList.add("on")};const io=new IntersectionObserver(es=>{if(es[0].isIntersecting){go();io.disconnect()}},{threshold:.5});io.observe(el);el.querySelector(".rw").addEventListener("click",go);return()=>io.disconnect()
}

export default function TxNotebookInk() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#1d4ed8",
          "--c2": "#dc2626",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq14-nb"><div className="pg"><p className="dt">Monday, 3 March</p><h3><span className="w" style={{ "--i": "0" } as CSSProperties}><span className="t">Things for today</span><i className="pn" aria-hidden="true"></i></span></h3><ul><li className="dn"><span className="w" style={{ "--i": "1" } as CSSProperties}><span className="t">Call the printer</span><i className="pn" aria-hidden="true"></i></span></li><li className="dn"><span className="w" style={{ "--i": "2" } as CSSProperties}><span className="t">Buy coffee and envelopes</span><i className="pn" aria-hidden="true"></i></span></li><li><span className="w" style={{ "--i": "3" } as CSSProperties}><span className="t">Water the plants</span><i className="pn" aria-hidden="true"></i></span></li></ul></div><button type="button" className="rw">Write it again</button></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Pencil list on a notebook page” block (Text & scroll) from AIMRAN Library to my project.

## What it is
On a ruled notebook page, a pencil writes each line from left to right and then crosses out what is already done.

## Chosen settings
- Main color: #1d4ed8
- Secondary color: #dc2626
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Cosas para hoy"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq14-nb {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 19em;
  display: grid;
  justify-items: center;
  gap: 1em;
}

.uvq14-nb .pg {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: .9em 1em 1.3em 3em;
  color: var(--c1);
  background: linear-gradient(90deg,transparent 2.3em,rgba(220,38,38,.55) 2.3em 2.4em,transparent 2.4em),repeating-linear-gradient(transparent 0 calc(1.9em - 1px),#a9c7e8 calc(1.9em - 1px) 1.9em) 0 .9em/100% 100% no-repeat,#fffdf6;
  border-radius: .2em .6em .6em .2em;
  box-shadow: 0 .1em .2em rgba(0,0,0,.08),0 1.2em 2em -1.2em rgba(0,0,0,.35);
  font-family: "Segoe Print","Bradley Hand","Chalkboard SE","Comic Sans MS",cursive;
}

.uvq14-nb .pg::before {
  content: "";
  position: absolute;
  left: .8em;
  top: 1.4em;
  bottom: 1.4em;
  width: .7em;
  background: radial-gradient(circle,var(--bg) .3em,transparent .32em) 0 0/.7em 3.8em repeat-y;
}

.uvq14-nb .dt {
  margin: 0;
  height: 1.9em;
  line-height: 1.9em;
  font-size: .72em;
  text-align: right;
  color: #6b7280;
}

.uvq14-nb h3,.uvq14-nb li {
  margin: 0;
  height: 1.9em;
  line-height: 1.9em;
  font-weight: 700;
}

.uvq14-nb h3 {
  font-size: 1.15em;
  line-height: 1.65em;
  height: 1.65em;
}

.uvq14-nb ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1em;
}

.uvq14-nb li::before {
  content: "·";
  margin-right: .4em;
}

.uvq14-nb .w {
  position: relative;
  display: inline-block;
}

.uvq14-nb .t {
  display: inline-block;
  clip-path: inset(-20% 100% -20% 0);
}

.uvq14-nb .pn {
  position: absolute;
  left: 0;
  bottom: .35em;
  width: .32em;
  height: 1.7em;
  border-radius: .1em .1em 0 0;
  opacity: 0;
  transform-origin: 50% 100%;
  rotate: 28deg;
  background: linear-gradient(transparent 0 76%,#e7c79c 76% 90%,#333 90%),linear-gradient(90deg,#f5b800 0 50%,#e0a400 50%);
  clip-path: polygon(0 0,100% 0,100% 76%,50% 100%,0 76%);
}

.uvq14-nb.on .t {
  animation: uvq14-nb-w calc(1s / var(--k)) linear calc(var(--i) * calc(1.05s / var(--k))) forwards;
}

.uvq14-nb.on .pn {
  animation: uvq14-nb-p calc(1s / var(--k)) linear calc(var(--i) * calc(1.05s / var(--k))) both;
}

.uvq14-nb .dn .w::after {
  content: "";
  position: absolute;
  left: -.15em;
  right: -.15em;
  top: 52%;
  height: .13em;
  border-radius: 1em;
  background: var(--c2);
  transform: scaleX(0);
  transform-origin: 0 50%;
  rotate: -1.5deg;
}

.uvq14-nb.on .dn .w::after {
  animation: uvq14-nb-s calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(calc(4.3s / var(--k)) + var(--i) * calc(0.3s / var(--k))) forwards;
}

.uvq14-nb .rw {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .55em 1.1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 700;
  color: var(--bg);
  background: var(--fg);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-nb .rw:hover {
  transform: translateY(-2px);
}

.uvq14-nb .rw:active {
  transform: scale(.95);
}

.uvq14-nb .rw:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq14-nb-w {
  to {
    clip-path: inset(-20% -5% -20% 0);
  }
}

@keyframes uvq14-nb-p {
  0% {
    left: 0;
    opacity: 1;
  }
  96% {
    left: 100%;
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes uvq14-nb-s {
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-nb,.uvq14-nb *,.uvq14-nb *::before,.uvq14-nb *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const go=()=>{el.classList.remove("on");void el.offsetWidth;el.classList.add("on")};const io=new IntersectionObserver(es=>{if(es[0].isIntersecting){go();io.disconnect()}},{threshold:.5});io.observe(el);el.querySelector(".rw").addEventListener("click",go);return()=>io.disconnect()
}

export default function TxNotebookInk() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#1d4ed8",
          "--c2": "#dc2626",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq14-nb"><div className="pg"><p className="dt">Monday, 3 March</p><h3><span className="w" style={{ "--i": "0" } as CSSProperties}><span className="t">Things for today</span><i className="pn" aria-hidden="true"></i></span></h3><ul><li className="dn"><span className="w" style={{ "--i": "1" } as CSSProperties}><span className="t">Call the printer</span><i className="pn" aria-hidden="true"></i></span></li><li className="dn"><span className="w" style={{ "--i": "2" } as CSSProperties}><span className="t">Buy coffee and envelopes</span><i className="pn" aria-hidden="true"></i></span></li><li><span className="w" style={{ "--i": "3" } as CSSProperties}><span className="t">Water the plants</span><i className="pn" aria-hidden="true"></i></span></li></ul></div><button type="button" className="rw">Write it again</button></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
