# Menu of headlines that split in two

> Huge links that, on hover or focus, slice through the middle and pull apart to show a hidden line of text.

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

## Where to use it

Big uppercase menus are common on studio sites, and this one adds a cut: each word is drawn twice with complementary clip paths, so on hover the top and bottom halves slide apart in different colors and a small caption appears in the gap. The links stay plain anchors with readable names. It suits portfolio navigation, agency menus and editorial indexes.

Write the first item in the text field and edit the others and their captions in the HTML. The main color paints the upper half and the caption, the secondary one the lower half. Keyboard focus triggers the same split as the pointer.

## Code

### HTML

```html
<nav class="uvq14-slc" aria-label="Main menu"><a href="#"><span class="n" aria-hidden="true">01</span><span class="w"><span class="b">Projects</span><span class="t" aria-hidden="true">Projects</span><span class="m">Twelve real cases</span></span></a><a href="#"><span class="n" aria-hidden="true">02</span><span class="w"><span class="b">Studio</span><span class="t" aria-hidden="true">Studio</span><span class="m">Six people, one workshop</span></span></a><a href="#"><span class="n" aria-hidden="true">03</span><span class="w"><span class="b">Contact</span><span class="t" aria-hidden="true">Contact</span><span class="m">We reply within a day</span></span></a></nav>
```

### CSS

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

.uvq14-slc {
  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;
}

.uvq14-slc a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7em;
  padding: .55em .2em;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid color-mix(in srgb,var(--fg) 10%,transparent);
  border-radius: .2em;
  -webkit-tap-highlight-color: transparent;
}

.uvq14-slc a:last-child {
  border-bottom: 1px solid color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq14-slc .n {
  align-self: flex-start;
  margin-top: .5em;
  font: 700 .66em/1 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-slc .w {
  position: relative;
  display: block;
  font-size: calc(var(--s) * 2.55);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.uvq14-slc .b,.uvq14-slc .t {
  display: block;
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1),color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-slc .b {
  clip-path: inset(50% 0 0 0);
}

.uvq14-slc .t {
  position: absolute;
  left: 0;
  top: 0;
  clip-path: inset(0 0 50% 0);
}

.uvq14-slc .m {
  position: absolute;
  left: .1em;
  top: 50%;
  font-size: .17em;
  font-weight: 700;
  letter-spacing: .24em;
  line-height: 1;
  white-space: nowrap;
  color: var(--c1);
  opacity: 0;
  translate: 0 -50%;
  transform: scaleY(0);
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.4s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq14-slc a:hover .t,.uvq14-slc a:focus-visible .t {
  transform: translate(-.03em,-.2em);
  color: var(--c1);
}

.uvq14-slc a:hover .b,.uvq14-slc a:focus-visible .b {
  transform: translate(.05em,.2em);
  color: var(--c2);
}

.uvq14-slc a:hover .m,.uvq14-slc a:focus-visible .m {
  opacity: 1;
  transform: none;
}

.uvq14-slc a:hover .n,.uvq14-slc a:focus-visible .n {
  color: var(--c1);
}

.uvq14-slc a:active .w {
  transform: scale(.98);
}

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

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

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq14-slc {
  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;
}

.uvq14-slc a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7em;
  padding: .55em .2em;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid color-mix(in srgb,var(--fg) 10%,transparent);
  border-radius: .2em;
  -webkit-tap-highlight-color: transparent;
}

.uvq14-slc a:last-child {
  border-bottom: 1px solid color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq14-slc .n {
  align-self: flex-start;
  margin-top: .5em;
  font: 700 .66em/1 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-slc .w {
  position: relative;
  display: block;
  font-size: calc(var(--s) * 2.55);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.uvq14-slc .b,.uvq14-slc .t {
  display: block;
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1),color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-slc .b {
  clip-path: inset(50% 0 0 0);
}

.uvq14-slc .t {
  position: absolute;
  left: 0;
  top: 0;
  clip-path: inset(0 0 50% 0);
}

.uvq14-slc .m {
  position: absolute;
  left: .1em;
  top: 50%;
  font-size: .17em;
  font-weight: 700;
  letter-spacing: .24em;
  line-height: 1;
  white-space: nowrap;
  color: var(--c1);
  opacity: 0;
  translate: 0 -50%;
  transform: scaleY(0);
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.4s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq14-slc a:hover .t,.uvq14-slc a:focus-visible .t {
  transform: translate(-.03em,-.2em);
  color: var(--c1);
}

.uvq14-slc a:hover .b,.uvq14-slc a:focus-visible .b {
  transform: translate(.05em,.2em);
  color: var(--c2);
}

.uvq14-slc a:hover .m,.uvq14-slc a:focus-visible .m {
  opacity: 1;
  transform: none;
}

.uvq14-slc a:hover .n,.uvq14-slc a:focus-visible .n {
  color: var(--c1);
}

.uvq14-slc a:active .w {
  transform: scale(.98);
}

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

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

export default function TxSliceLink() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#7c3aed",
          "--c2": "#f472b6",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <nav className="uvq14-slc" aria-label="Main menu"><a href="#"><span className="n" aria-hidden="true">01</span><span className="w"><span className="b">Projects</span><span className="t" aria-hidden="true">Projects</span><span className="m">Twelve real cases</span></span></a><a href="#"><span className="n" aria-hidden="true">02</span><span className="w"><span className="b">Studio</span><span className="t" aria-hidden="true">Studio</span><span className="m">Six people, one workshop</span></span></a><a href="#"><span className="n" aria-hidden="true">03</span><span className="w"><span className="b">Contact</span><span className="t" aria-hidden="true">Contact</span><span className="m">We reply within a day</span></span></a></nav>
      </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 “Menu of headlines that split in two” block (Text & scroll) from AIMRAN Library to my project.

## What it is
Huge links that, on hover or focus, slice through the middle and pull apart to show a hidden line of text.

## Chosen settings
- Main color: #7c3aed
- Secondary color: #f472b6
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Proyectos"

## 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
import type { CSSProperties } from "react";

const css = `
.uvq14-slc {
  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;
}

.uvq14-slc a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7em;
  padding: .55em .2em;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid color-mix(in srgb,var(--fg) 10%,transparent);
  border-radius: .2em;
  -webkit-tap-highlight-color: transparent;
}

.uvq14-slc a:last-child {
  border-bottom: 1px solid color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq14-slc .n {
  align-self: flex-start;
  margin-top: .5em;
  font: 700 .66em/1 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-slc .w {
  position: relative;
  display: block;
  font-size: calc(var(--s) * 2.55);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.uvq14-slc .b,.uvq14-slc .t {
  display: block;
  transition: transform calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1),color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-slc .b {
  clip-path: inset(50% 0 0 0);
}

.uvq14-slc .t {
  position: absolute;
  left: 0;
  top: 0;
  clip-path: inset(0 0 50% 0);
}

.uvq14-slc .m {
  position: absolute;
  left: .1em;
  top: 50%;
  font-size: .17em;
  font-weight: 700;
  letter-spacing: .24em;
  line-height: 1;
  white-space: nowrap;
  color: var(--c1);
  opacity: 0;
  translate: 0 -50%;
  transform: scaleY(0);
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.4s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq14-slc a:hover .t,.uvq14-slc a:focus-visible .t {
  transform: translate(-.03em,-.2em);
  color: var(--c1);
}

.uvq14-slc a:hover .b,.uvq14-slc a:focus-visible .b {
  transform: translate(.05em,.2em);
  color: var(--c2);
}

.uvq14-slc a:hover .m,.uvq14-slc a:focus-visible .m {
  opacity: 1;
  transform: none;
}

.uvq14-slc a:hover .n,.uvq14-slc a:focus-visible .n {
  color: var(--c1);
}

.uvq14-slc a:active .w {
  transform: scale(.98);
}

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

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

export default function TxSliceLink() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#7c3aed",
          "--c2": "#f472b6",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <nav className="uvq14-slc" aria-label="Main menu"><a href="#"><span className="n" aria-hidden="true">01</span><span className="w"><span className="b">Projects</span><span className="t" aria-hidden="true">Projects</span><span className="m">Twelve real cases</span></span></a><a href="#"><span className="n" aria-hidden="true">02</span><span className="w"><span className="b">Studio</span><span className="t" aria-hidden="true">Studio</span><span className="m">Six people, one workshop</span></span></a><a href="#"><span className="n" aria-hidden="true">03</span><span className="w"><span className="b">Contact</span><span className="t" aria-hidden="true">Contact</span><span className="m">We reply within a day</span></span></a></nav>
      </div>
    </>
  );
}
```

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