# Fullscreen Slider

> Full-bleed slides that change with a curtain while the title rises from a mask. Horizontal or vertical, buttons, arrow keys and swipe. No GSAP.

Media · slider, carousel, fullscreen, image · HTML, CSS, vanilla JS · no dependencies · updated 2026-10-21
Demo: https://kodza.dev/components/slider-horizontal-fullscreen/

Takes the whole screen (or reacts to the page scroll): give it a page, not a small box.

## Files

The code below, served as files: byte for byte what the Kodza site copies (the CSS includes its theme guard).

- [`kodza-slider-horizontal-fullscreen.css`](https://kodza.dev/registry/slider-horizontal-fullscreen/kodza-slider-horizontal-fullscreen.css) · 11.8 KB
- [`kodza-slider-horizontal-fullscreen.js`](https://kodza.dev/registry/slider-horizontal-fullscreen/kodza-slider-horizontal-fullscreen.js) · 6.7 KB
- [`kodza-slider-horizontal-fullscreen.html`](https://kodza.dev/registry/slider-horizontal-fullscreen/kodza-slider-horizontal-fullscreen.html) · 2.1 KB · the markup, to adapt and paste into your page

**Can you run shell commands? Download the CSS and the JS, don't retype them.** Retyping costs thousands of tokens and can drop or change lines of the CSS. Put the files where your stack expects them (Use it says where: change the `-o` paths):

```bash
curl -fsSL --create-dirs -o kodza/kodza-slider-horizontal-fullscreen.css https://kodza.dev/registry/slider-horizontal-fullscreen/kodza-slider-horizontal-fullscreen.css
curl -fsSL --create-dirs -o kodza/kodza-slider-horizontal-fullscreen.js https://kodza.dev/registry/slider-horizontal-fullscreen/kodza-slider-horizontal-fullscreen.js
```

Then load the files from your page as Use it shows, instead of pasting the content. The HTML is the part you adapt (text, links, modifiers): paste it from the Code section. Copy the CSS and the JS from the Code section only if you can't run commands, exactly as they are. (Windows PowerShell: `curl.exe`.)

## API

- Root: `.kodza-slider`
- Variables (set them on the root element itself: it declares its own defaults):
  - `--kz-slider-height: 100vh`
  - `--kz-slider-fg: #ffffff`
  - `--kz-slider-shade: rgba(0, 0, 0, 0.38)`
  - `--kz-slider-duration: 1s`
  - `--kz-slider-ease: cubic-bezier(0.76, 0, 0.24, 1)`
- Attributes:
  - `data-dir` (e.g. `-1`, `1`)
  - `data-direction` (e.g. `vertical`)
- Lifecycle: `kodza:init` / `kodza:destroy` on `document`, with `{ detail: { root } }` to target a container.

## Keyboard

What each key does, by where the focus is. Keep it working when you adapt the HTML: same elements, same classes.

- Over the slider, or focus inside (while `.kodza-slider:not([data-direction="vertical"]):hover, .kodza-slider:not([data-direction="vertical"]):focus-within` is on the page):
  - `ArrowRight` / `ArrowLeft`: Next or previous slide, round and round
- Over a vertical slider, or focus inside (while `.kodza-slider[data-direction="vertical"]:hover, .kodza-slider[data-direction="vertical"]:focus-within` is on the page):
  - `ArrowDown` / `ArrowUp`: Next or previous slide, round and round

## Dark mode

Nothing to set: it takes its colours from the text around it, or looks the same on a light and a dark page.

Its images have dark versions next to them (`kz-columns-2400.webp` → `kz-columns-dark-2400.webp`). To swap them on a dark page: `<picture><source media="(prefers-color-scheme: dark)" srcset="…-dark-….webp"><img …></picture>`.

## Use it

### Plain HTML page

- CSS: `kodza/kodza-slider-horizontal-fullscreen.css` next to the page (the Files commands as they are), linked in `<head>`: `<link rel="stylesheet" href="kodza/kodza-slider-horizontal-fullscreen.css">`. Without a shell, paste it in a `<style>` in `<head>` instead. It only touches `kodza-` classes.
- HTML: where the component goes. Paste it as many times as you need: instances never interfere.
- JS: `kodza/kodza-slider-horizontal-fullscreen.js`, loaded with `<script src="kodza/kodza-slider-horizontal-fullscreen.js" defer></script>` in `<head>`. Without a shell, paste it in a `<script>` before `</body>` (or in `<head>`: it waits for the page). One copy per page, whatever the number of instances.
- Restyle with the `--kz-…` variables, set on the component's root element itself (the root declares its own defaults, so a value on an ancestor is ignored), and with the modifiers / attributes listed under API.
- Font: it takes the page's own. The Kodza look is Geist: `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap">`.
- Content added later (AJAX navigation, a SPA route, a builder preview): start it with `document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root: container } }))`; before removing it, the same call with `'kodza:destroy'` stops it and puts the original markup back.

### Claude artifact (claude.ai)

- Paste the CSS in a `<style>` and the JS in a `<script>` at the end, in the artifact itself: it loads stylesheets only from Google Fonts and scripts only from a few CDNs, so no `<link>` or `<script src>` to Kodza.
- Writing the artifact file with a shell? Insert the downloaded files (Files) with a command instead of retyping them: a line `KODZA-CSS` alone inside the `<style>`, `KODZA-JS` inside the `<script>`, then `sed -e '/^KODZA-CSS$/{r kodza/kodza-slider-horizontal-fullscreen.css' -e 'd' -e '}' -e '/^KODZA-JS$/{r kodza/kodza-slider-horizontal-fullscreen.js' -e 'd' -e '}' page.html > artifact.html`.
- Font: load Geist from Google Fonts (allowed): `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap">`.
- Images: the artifact blocks every other host, `kodza.dev` included, without an error. Embed each one as a `data:` URI, with a command if you can run one (`curl -s <url> | base64`; the 1400 px files weigh 10 to 30 KB), never by typing base64 out. If you can't run commands, keep the `<img>` with its `width` and `height`, and tell the user the picture stays blank inside the artifact.
- Dark mode: the viewer sets `data-theme="dark"` or `"light"` on `<html>`, or nothing when it follows the system. Write the Dark mode rules twice: inside `@media (prefers-color-scheme: dark)` with `:root:not([data-theme="light"])` in front of each selector, and with `:root[data-theme="dark"]` in front of each selector.

### WordPress

- HTML: a **Custom HTML** block (or a pattern / template part). WordPress keeps this markup as it is only for users allowed to post unfiltered HTML (Administrators; Super Admins on multisite): for anyone else it strips tags such as `<svg>`, `<input>` or `<dialog>`, so add it from the theme (a pattern or template part) instead.
- This one spans the page: a block theme keeps a Custom HTML block to the width of the text column, so put it inside a **Group** block set to **Full width**, with **Inner blocks use content width** turned off.
- CSS and JS: the downloaded files go in the theme, under `wp-content/themes/<your-theme>/kodza/` (the child theme if there is one), enqueued from its functions.php (or a code-snippets plugin):
  ```php
  add_action('wp_enqueue_scripts', function () {
    $dir = get_stylesheet_directory() . '/kodza/';
    $uri = get_stylesheet_directory_uri() . '/kodza/';
    wp_enqueue_style('kodza-slider-horizontal-fullscreen', $uri . 'kodza-slider-horizontal-fullscreen.css', [], filemtime($dir . 'kodza-slider-horizontal-fullscreen.css'));
    wp_enqueue_script('kodza-slider-horizontal-fullscreen', $uri . 'kodza-slider-horizontal-fullscreen.js', [], filemtime($dir . 'kodza-slider-horizontal-fullscreen.js'), true);
  });
  ```
  Scoped to `kodza-` classes, the CSS never touches the theme. One copy of the JS, whatever the number of blocks.
- No access to the theme files? The CSS can also go, as it is, in **Appearance → Customize → Additional CSS** (classic theme) or **Styles → Additional CSS** in the Site Editor (block theme).
- Theme with AJAX page transitions: fire `kodza:init` on the new content after each swap (and `kodza:destroy` on the old one).
- Performance plugin (WP Rocket, LiteSpeed Cache, Perfmatters…) with **Delay JavaScript execution** turned on: add `kodza` to the scripts it must not delay. Otherwise the component waits for the visitor's first scroll, tap or mouse move, and that first click can be lost.
- Colours: it takes the colour of the text around it (or keeps its own monochrome): nothing to point at the theme.
- WordPress turns straight quotes and `--` into typographic ones in the text of a Custom HTML block (not inside `<code>` or `<pre>`).

#### With Elementor

- HTML: an **HTML** widget (Elementor shows it to administrators only). It keeps the code exactly as pasted, straight quotes included.
- This one spans the page: give the widget its own container, **Content Width: Full Width**, padding 0.
- CSS and JS: as above. Elementor's Site Settings → Theme Style styles every button, field, link and image of the page, components included; the theme guard at the end of the CSS keeps the component's buttons, fields and link colours as they are.
- The Elementor editor redraws each widget after the page has loaded: without the script below, the component stays still in the editor preview (the published page works). Add it once per site, in the footer like the component's script (`kodza/elementor-editor.js`, or a code-snippets plugin):

```js
// Kodza in the Elementor editor: the editor redraws each HTML widget after the page has loaded.
// Start Kodza in what it draws, stop it in what it replaces or removes. Once per site.
window.addEventListener('elementor/frontend/init', () => {
  if (!elementorFrontend.isEditMode()) return;
  class KodzaWidget extends elementorModules.frontend.handlers.Base {
    onInit() {
      super.onInit();
      this.kodza = [...this.$element[0].children];
      document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root: this.$element[0] } }));
    }
    onDestroy() {
      super.onDestroy();
      this.kodza.forEach((root) => document.dispatchEvent(new CustomEvent('kodza:destroy', { detail: { root } })));
    }
  }
  elementorFrontend.elementsHandler.attachHandler('html', KodzaWidget);
});
```

- No child theme: everything can go in the HTML widget instead, `<style>` with the CSS, the HTML, then `<script>` with the JS. It works on the page and in the editor without the script above.

### Shopify

- Files: `assets/kodza-slider-horizontal-fullscreen.css` and `assets/kodza-slider-horizontal-fullscreen.js` (the Files commands with `-o assets/…`).
- In the section: `{{ 'kodza-slider-horizontal-fullscreen.css' | asset_url | stylesheet_tag }}` and `<script src="{{ 'kodza-slider-horizontal-fullscreen.js' | asset_url }}" defer></script>`, then the HTML.
- The theme editor re-renders sections: restart them with
  `document.addEventListener('shopify:section:load', (e) => document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root: e.target } })));`
  and the same with `shopify:section:unload` → `kodza:destroy`.

### React / Next.js

- Files, side by side (e.g. in `components/kodza/`): `FullscreenSlider.tsx` (below), the CSS block under Code saved as `slider-horizontal-fullscreen.css` and the JS block as `slider-horizontal-fullscreen.js`, both as they are. The HTML block is already inside the component: skip it.
- Use it: `import { FullscreenSlider } from '@/components/kodza/FullscreenSlider';` then `<FullscreenSlider />`. Props: `vars` (the `--kz-…` variables listed under API, e.g. `vars={{ '--kz-slider-height': … }}`), `className`, `style` and the other props of its `<section>` (`onClick`, `aria-…`).
- Next.js App Router: it is a Client Component already (`'use client'`). Pages Router: Next.js takes global CSS only in `pages/_app`, so move the `import './slider-horizontal-fullscreen.css'` line there.
- Safe under StrictMode, client-side navigation and prop changes: when a prop changes, the `key` gives React a fresh element, `kodza:destroy` stops the script on the old one and `kodza:init` starts it on the new one.

```tsx
'use client';
// Kodza — Fullscreen Slider, for React. From https://kodza.dev/components/slider-horizontal-fullscreen/
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Next to this file: slider-horizontal-fullscreen.css and slider-horizontal-fullscreen.js, the component's CSS and JS from Kodza, as they are.
// Yours to edit: the markup is plain JSX below.
// The script changes this markup once React has rendered it (it adds layers, splits text, moves
// nodes), so React must not patch it afterwards. When a prop changes, the key gives React a fresh
// element: kodza:destroy stops the script on the old one, kodza:init starts it on the new one.
import { useRef, useEffect, type ComponentPropsWithoutRef, type ComponentRef, type CSSProperties } from 'react';
import './slider-horizontal-fullscreen.css';

export type FullscreenSliderProps = Omit<ComponentPropsWithoutRef<'section'>, "children" | "vars"> & {
  /** Settings, as CSS variables on the root */
  vars?: {
    /** default: 100vh */
    "--kz-slider-height"?: string | number;
    /** default: #ffffff */
    "--kz-slider-fg"?: string | number;
    /** default: rgba(0, 0, 0, 0.38) */
    "--kz-slider-shade"?: string | number;
    /** default: 1s */
    "--kz-slider-duration"?: string | number;
    /** default: cubic-bezier(0.76, 0, 0.24, 1) */
    "--kz-slider-ease"?: string | number;
  };
  className?: string;
};

export function FullscreenSlider({ vars, className, style, ...rest }: FullscreenSliderProps) {
  const ref = useRef<ComponentRef<'section'>>(null);
  const classes = ["kodza-slider", className].filter(Boolean).join(' ');
  // Everything the markup is made of: when it changes, React gets a fresh element (see the top)
  const key = JSON.stringify([classes, vars, style, rest]);

  // Starts the script on this element once React has rendered it, stops it when it goes
  useEffect(() => {
    const root = ref.current;
    let live = true;
    // @ts-ignore: a plain script, no types to find
    import('./slider-horizontal-fullscreen.js').then(() => {
      if (live) document.dispatchEvent(new CustomEvent('kodza:init', { detail: { root } }));
    });
    return () => {
      live = false;
      document.dispatchEvent(new CustomEvent('kodza:destroy', { detail: { root } }));
    };
  }, [key]);

  return (
    <section aria-roledescription="carousel" aria-label="Kodza slides" key={key} {...rest} className={classes} style={{ ...vars, ...style } as CSSProperties} ref={ref}>
      <div className="kodza-slider__slides">
        <figure className="kodza-slider__slide">
          <img src="https://kodza.dev/media/kz-columns-2400.webp" alt="A row of square concrete pillars under a flat roof, casting striped shadows" />
          <figcaption>
            <h2 className="kodza-slider__title">repeat(7, 1fr)</h2>
            <p className="kodza-slider__text">Grid layout, 1968 edition.</p>
          </figcaption>
        </figure>
        <figure className="kodza-slider__slide">
          <img src="https://kodza.dev/media/kz-steps-2400.webp" alt="A concrete staircase that climbs nine steps and stops in mid-air" loading="lazy" />
          <figcaption>
            <h2 className="kodza-slider__title">transition: steps(9)</h2>
            <p className="kodza-slider__text">Goes up. Goes nowhere. Ships anyway.</p>
          </figcaption>
        </figure>
        <figure className="kodza-slider__slide">
          <img src="https://kodza.dev/media/kz-float-2400.webp" alt="A concrete block hovering above the ground, over its own shadow" loading="lazy" />
          <figcaption>
            <h2 className="kodza-slider__title">position: absolute</h2>
            <p className="kodza-slider__text">Out of the flow, and loving it.</p>
          </figcaption>
        </figure>
        <figure className="kodza-slider__slide">
          <img src="https://kodza.dev/media/kz-arch-2400.webp" alt="A concrete wall with a round-topped opening, sunlight pouring through it onto the ground" loading="lazy" />
          <figcaption>
            <h2 className="kodza-slider__title">border-radius: 50%</h2>
            <p className="kodza-slider__text">Even concrete has a soft side.</p>
          </figcaption>
        </figure>
      </div>
      <div className="kodza-slider__bar">
        <span className="kodza-slider__count"><b>01</b> / 04</span>
        <div className="kodza-slider__nav">
          <button type="button" data-dir="-1" aria-label="Previous slide">
            <svg viewBox="0 0 16 16" aria-hidden="true">
              <path d="M10 3L5 8l5 5" />
            </svg>
          </button>
          {' '}
          <button type="button" data-dir="1" aria-label="Next slide">
            <svg viewBox="0 0 16 16" aria-hidden="true">
              <path d="M6 3l5 5-5 5" />
            </svg>
          </button>
        </div>
      </div>
    </section>
  );
}
```

## Code

```html
<section class="kodza-slider" aria-roledescription="carousel" aria-label="Kodza slides">
  <div class="kodza-slider__slides">
    <figure class="kodza-slider__slide">
      <img src="https://kodza.dev/media/kz-columns-2400.webp" alt="A row of square concrete pillars under a flat roof, casting striped shadows" />
      <figcaption>
        <h2 class="kodza-slider__title">repeat(7, 1fr)</h2>
        <p class="kodza-slider__text">Grid layout, 1968 edition.</p>
      </figcaption>
    </figure>
    <figure class="kodza-slider__slide">
      <img src="https://kodza.dev/media/kz-steps-2400.webp" alt="A concrete staircase that climbs nine steps and stops in mid-air" loading="lazy" />
      <figcaption>
        <h2 class="kodza-slider__title">transition: steps(9)</h2>
        <p class="kodza-slider__text">Goes up. Goes nowhere. Ships anyway.</p>
      </figcaption>
    </figure>
    <figure class="kodza-slider__slide">
      <img src="https://kodza.dev/media/kz-float-2400.webp" alt="A concrete block hovering above the ground, over its own shadow" loading="lazy" />
      <figcaption>
        <h2 class="kodza-slider__title">position: absolute</h2>
        <p class="kodza-slider__text">Out of the flow, and loving it.</p>
      </figcaption>
    </figure>
    <figure class="kodza-slider__slide">
      <img src="https://kodza.dev/media/kz-arch-2400.webp" alt="A concrete wall with a round-topped opening, sunlight pouring through it onto the ground" loading="lazy" />
      <figcaption>
        <h2 class="kodza-slider__title">border-radius: 50%</h2>
        <p class="kodza-slider__text">Even concrete has a soft side.</p>
      </figcaption>
    </figure>
  </div>
  <div class="kodza-slider__bar">
    <span class="kodza-slider__count"><b>01</b> / 04</span>
    <div class="kodza-slider__nav">
      <button type="button" data-dir="-1" aria-label="Previous slide"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3L5 8l5 5" /></svg></button>
      <button type="button" data-dir="1" aria-label="Next slide"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3l5 5-5 5" /></svg></button>
    </div>
  </div>
</section>
```

```css
/* Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license */
/* Kodza — Fullscreen Slider
   Full-bleed slides that change with a curtain: the next image wipes in while the
   current one is pushed out by the same edge, and the title rises from behind a mask.
   Horizontal by default, vertical with data-direction="vertical".
   It fills its container (give it a height, or let it take the screen).
   Everything is tuned with the --kz-slider-* variables. */
.kodza-slider {
  --kz-slider-height: 100vh;
  --kz-slider-fg: #ffffff;
  --kz-slider-shade: rgba(0, 0, 0, 0.38);
  --kz-slider-duration: 1s;
  --kz-slider-ease: cubic-bezier(0.76, 0, 0.24, 1);

  position: relative;
  height: var(--kz-slider-height);
  height: min(var(--kz-slider-height), 100dvh);
  overflow: hidden;
  background: #0a0a0a;
  color: var(--kz-slider-fg);
  touch-action: pan-y;
}

.kodza-slider[data-direction="vertical"] {
  touch-action: pan-x;
}

.kodza-slider__slides,
.kodza-slider__slide {
  position: absolute;
  inset: 0;
  margin: 0;
}

.kodza-slider__slide {
  overflow: hidden;
  visibility: hidden;
}

.kodza-slider__slide.is-current,
.kodza-slider__slide.is-leaving {
  visibility: visible;
}

.kodza-slider__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A soft shade at the bottom, so the caption reads on any image */
.kodza-slider__slide::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, var(--kz-slider-shade));
  pointer-events: none;
}

.kodza-slider__slide figcaption {
  position: absolute;
  z-index: 1;
  left: clamp(20px, 5vw, 56px);
  bottom: clamp(84px, 13vh, 120px);
  max-width: min(640px, 80%);
}

.kodza-slider__title,
.kodza-slider__text {
  margin: 0;
  overflow: hidden;
}

.kodza-slider__title {
  font-size: clamp(30px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.kodza-slider__text {
  margin-top: 10px;
  font-size: clamp(15px, 1.4vw, 18px);
  opacity: 0.8;
}

/* Each caption line rises from behind its own mask */
.kodza-slider__line {
  display: block;
}

.kodza-slider__bar {
  position: absolute;
  z-index: 2;
  right: clamp(20px, 5vw, 56px);
  bottom: clamp(24px, 5vh, 44px);
  left: clamp(20px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kodza-slider__count {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  opacity: 0.75;
}

.kodza-slider__count b {
  font-weight: 500;
  opacity: 1;
}

.kodza-slider__nav {
  display: flex;
  gap: 8px;
}

.kodza-slider__nav button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  color: inherit;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.25s ease;
}

.kodza-slider__nav button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.kodza-slider__nav button:focus-visible {
  outline: 2px solid var(--kz-slider-fg);
  outline-offset: 3px;
}

.kodza-slider__nav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Vertical: the arrows point up and down */
.kodza-slider[data-direction="vertical"] .kodza-slider__nav svg {
  transform: rotate(90deg);
}

/* Without the script, the first slide is simply shown */
.kodza-slider:not(.is-ready) .kodza-slider__slide:first-child {
  visibility: visible;
}

/* kodza-guard e1a12e0299f1 — generated by Kodza, do not edit.
   Theme guard: keeps a site's own CSS (WordPress themes, Bootstrap, CSS resets…) off this
   component. :not(#_) is always true and weighs as much as an id, so these lines win over
   theme rules made of classes and tags. Customise the component through its --kz-* variables. */

/* What the browser gives, where the component sets it only in some states: at the lowest weight, so its own rules below put it back */

:where(.kodza-slider__nav button:where(:not([class*="kodza-"]))):not(#_) {
  outline: revert;
  outline-offset: revert;
}

/* What the browser gives, on everything the component leaves to it */

.kodza-slider:not(#_),
.kodza-slider__slides:not(#_),
.kodza-slider__line:not(#_),
.kodza-slider__bar:not(#_),
.kodza-slider__count:not(#_),
.kodza-slider__nav:not(#_) {
  box-sizing: revert;
}

.kodza-slider__slide:not(#_) {
  border: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-slider__title:not(#_) {
  border: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-style: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-slider__text:not(#_) {
  border: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-slider__slide img:where(:not([class*="kodza-"]):not(.kodza-slider__slide [class*="kodza-"] *)):not(#_),
.kodza-slider__nav svg:where(:not([class*="kodza-"])):not(#_) {
  border: revert;
  margin: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-slider__slide figcaption:where(:not([class*="kodza-"]):not(.kodza-slider__slide [class*="kodza-"] *)):not(#_) {
  border: revert;
  margin: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-slider__count b:where(:not([class*="kodza-"])):not(#_) {
  border: revert;
  margin: revert;
  padding: revert;
  border-radius: revert;
  outline: revert;
  text-decoration: revert;
  transition: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  background-color: revert;
  background-image: revert;
  box-shadow: revert;
  outline-offset: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  color: revert;
  font-family: revert;
  font-size: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
}

.kodza-slider__nav button:where(:not([class*="kodza-"])):not(#_) {
  margin: revert;
  text-decoration: revert;
  list-style: revert;
  box-sizing: revert;
  float: revert;
  position: revert;
  appearance: revert;
  max-width: revert;
  max-height: revert;
  font-family: revert;
  font-size: revert;
  font-weight: revert;
  font-style: revert;
  line-height: revert;
  letter-spacing: revert;
  text-transform: revert;
  text-underline-offset: revert;
  text-align: revert;
  text-indent: revert;
  text-shadow: revert;
  vertical-align: revert;
  white-space: revert;
  min-height: revert;
}

.kodza-slider__slide:not(#_):where(:not([hidden])),
.kodza-slider__title:not(#_):where(:not([hidden])),
.kodza-slider__text:not(#_):where(:not([hidden])),
.kodza-slider__slide figcaption:where(:not([class*="kodza-"]):not(.kodza-slider__slide [class*="kodza-"] *)):not(#_):where(:not([hidden])),
.kodza-slider__count b:where(:not([class*="kodza-"])):not(#_):where(:not([hidden])),
.kodza-slider__nav svg:where(:not([class*="kodza-"])):not(#_):where(:not([hidden])) {
  display: revert;
}

.kodza-slider__slide:not(#_):where([hidden]),
.kodza-slider__title:not(#_):where([hidden]),
.kodza-slider__text:not(#_):where([hidden]),
.kodza-slider__slide figcaption:where(:not([class*="kodza-"]):not(.kodza-slider__slide [class*="kodza-"] *)):not(#_):where([hidden]),
.kodza-slider__count b:where(:not([class*="kodza-"])):not(#_):where([hidden]),
.kodza-slider__nav svg:where(:not([class*="kodza-"])):not(#_):where([hidden]) {
  display: none;
}

.kodza-slider__slide:not(#_)::after {
  box-sizing: revert;
}

/* The component's own rules, one step stronger: real buttons and fields, what it sets on tags themes style (links, lists, headings, images…), and the root width (a theme may narrow it, never widen it) */

.kodza-slider__slide:not(#_) {
  position: absolute;
  margin: 0;
}

.kodza-slider__slide img:not(#_) {
  display: block;
}

.kodza-slider__slide figcaption:not(#_) {
  position: absolute;
  max-width: min(640px, 80%);
}

.kodza-slider__title:not(#_),
.kodza-slider__text:not(#_) {
  margin: 0;
}

.kodza-slider__title:not(#_) {
  font-size: clamp(30px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.kodza-slider__text:not(#_) {
  margin-top: 10px;
  font-size: clamp(15px, 1.4vw, 18px);
}

.kodza-slider__count b:not(#_) {
  font-weight: 500;
}

.kodza-slider__nav button:not(#_) {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  color: inherit;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.25s ease;
}

.kodza-slider__nav button:hover:not(#_) {
  background: rgba(255, 255, 255, 0.24);
}

.kodza-slider__nav button:focus-visible:not(#_) {
  outline: 2px solid var(--kz-slider-fg);
  outline-offset: 3px;
}
```

```js
// Kodza License: free to use, client work included. Not to resell or redistribute, ported or not: https://kodza.dev/docs/#print-license
// Kodza — Fullscreen Slider
// Curtain transitions between full-bleed slides: the next one wipes in from an edge while
// the current one is pushed out by the same edge, each image drifting inside its own
// frame. Buttons, arrow keys (when the slider has focus or the pointer) and swipe.
(() => {
  const SELECTOR = '.kodza-slider';
  const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
  const pad = (n) => String(n).padStart(2, '0');

  // One instance. Everything it starts is tied to `signal`, so kodza:destroy stops it all
  function mount(root, signal) {
    const slides = [...root.querySelectorAll('.kodza-slider__slide')];
    const count = root.querySelector('.kodza-slider__count b');
    if (slides.length < 2) return;
    const vertical = root.dataset.direction === 'vertical';
    const style = getComputedStyle(root);
    const duration = reduceMotion ? 0 : parseFloat(style.getPropertyValue('--kz-slider-duration')) * 1000 || 1000;
    const ease = style.getPropertyValue('--kz-slider-ease').trim() || 'ease';
    let current = 0;
    let busy = false;

    // Caption lines get their own mask, so they can rise into place
    slides.forEach((slide) => {
      slide.querySelectorAll('.kodza-slider__title, .kodza-slider__text').forEach((el) => {
        const line = document.createElement('span');
        line.className = 'kodza-slider__line';
        line.append(...el.childNodes);
        el.append(line);
      });
    });
    slides[0].classList.add('is-current');
    root.classList.add('is-ready');

    // Clip-path insets for each edge: [top, right, bottom, left]
    const inset = (side, amount) => {
      const v = ['0', '0', '0', '0'];
      v[side] = amount;
      return `inset(${v.join(' ')})`;
    };

    async function go(dir) {
      if (busy) return;
      busy = true;
      const from = slides[current];
      current = (current + dir + slides.length) % slides.length;
      const to = slides[current];
      const img = to.querySelector('img');
      img.loading = 'eager';
      await img.decode().catch(() => {});

      // Forward: the new slide comes from the right (or the bottom) and the old one leaves by the left (or the top)
      const enterSide = vertical ? (dir > 0 ? 0 : 2) : dir > 0 ? 3 : 1;
      const leaveSide = vertical ? (dir > 0 ? 2 : 0) : dir > 0 ? 1 : 3;
      const axis = vertical ? 'Y' : 'X';
      const timing = { duration, easing: ease, fill: 'forwards' };

      from.classList.replace('is-current', 'is-leaving');
      to.classList.add('is-current');
      to.style.zIndex = 1;
      from.style.zIndex = 0;
      if (count) count.textContent = pad(current + 1);

      const wipeIn = to.animate([{ clipPath: inset(enterSide, '100%') }, { clipPath: inset(enterSide, '0%') }], timing);
      to.querySelector('img').animate([{ transform: `translate${axis}(${dir * 14}%) scale(1.1)` }, { transform: 'none' }], timing);
      from.animate([{ clipPath: inset(leaveSide, '0%') }, { clipPath: inset(leaveSide, '100%') }], timing);
      from.querySelector('img').animate([{ transform: 'none' }, { transform: `translate${axis}(${-dir * 18}%)` }], timing);
      to.querySelectorAll('.kodza-slider__line').forEach((line, i) => {
        line.animate([{ transform: 'translateY(105%)' }, { transform: 'none' }], {
          duration: duration * 0.8,
          delay: duration * 0.45 + i * 90,
          easing: 'cubic-bezier(0.22, 1, 0.36, 1)',
          fill: 'backwards',
        });
      });

      await wipeIn.finished.catch(() => {});
      from.classList.remove('is-leaving');
      [from, to].forEach((slide) => {
        slide.getAnimations({ subtree: true }).forEach((a) => a.cancel());
        slide.style.zIndex = '';
      });
      busy = false;
    }

    root.querySelectorAll('.kodza-slider__nav button').forEach((button) =>
      button.addEventListener('click', () => go(Number(button.dataset.dir)), { signal })
    );

    // Arrow keys work while the pointer is over the slider or the focus is inside it
    let pointerInside = false;
    root.addEventListener('pointerenter', () => (pointerInside = true), { signal });
    root.addEventListener('pointerleave', () => (pointerInside = false), { signal });
    document.addEventListener('keydown', (event) => {
      if (!pointerInside && !root.contains(document.activeElement)) return;
      const next = vertical ? 'ArrowDown' : 'ArrowRight';
      const prev = vertical ? 'ArrowUp' : 'ArrowLeft';
      if (event.key === next || event.key === prev) {
        event.preventDefault();
        go(event.key === next ? 1 : -1);
      }
    }, { signal });

    // Swipe along the slider's own direction
    let start = null;
    root.addEventListener('pointerdown', (event) => (start = { x: event.clientX, y: event.clientY }), { signal });
    root.addEventListener('pointerup', (event) => {
      if (!start) return;
      const delta = vertical ? event.clientY - start.y : event.clientX - start.x;
      start = null;
      if (Math.abs(delta) > 50) go(delta < 0 ? 1 : -1);
    }, { signal });
  }

  // Kodza lifecycle, the same in every component: `kodza:init` starts the instances inside
  // event.detail.root (the whole page by default), `kodza:destroy` stops them and puts their
  // markup back. For themes and apps that swap content without a page load.
  const instances = new WeakMap();
  const find = (scope = document) => [scope, ...scope.querySelectorAll(SELECTOR)].filter((el) => el.matches?.(SELECTOR));
  const init = (scope) => find(scope).forEach((root) => {
    if (root.classList.contains('is-ready')) return; // already running, maybe from another copy of this script
    const controller = new AbortController();
    instances.set(root, { controller, html: root.innerHTML, attrs: [...root.attributes].map((a) => [a.name, a.value]) });
    mount(root, controller.signal);
    root.classList.add('is-ready');
  });
  const destroy = (scope) => find(scope).forEach((root) => {
    const instance = instances.get(root);
    if (!instance) return;
    instances.delete(root);
    instance.controller.abort();
    [...root.attributes].forEach((a) => root.removeAttribute(a.name));
    instance.attrs.forEach(([name, value]) => root.setAttribute(name, value));
    root.innerHTML = instance.html;
  });
  document.addEventListener('kodza:init', (event) => init(event.detail?.root));
  document.addEventListener('kodza:destroy', (event) => destroy(event.detail?.root));
  init();
  // Loaded in <head>, the script runs before the markup exists: once more when it is parsed
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', () => init(), { once: true });
})();
```

Free to use, from Kodza (https://kodza.dev).
