Setup parallax

From nirholas/scroll-zoom-thing · View interactive version

Setup parallax is an AI agent skill from the GitHub repository nirholas/scroll-zoom-thing. Scaffold a complete CSS 3D parallax hero for MkDocs Material from scratch — home.html, home.css, and mkdocs.yml.

How to use this skill

Skill file

setup-parallax

Scaffold the complete CSS 3D perspective parallax hero for a MkDocs Material site.

1. Purpose

Wire up layered AVIF images into a working parallax hero using the exact

CSS 3D perspective approach from squidfunk/mkdocs-material (MIT). No JS

required beyond what the Material theme already ships.

2. Instructions

  1. Detect layer files — if layer_files was not provided, list

docs/assets/hero/*.avif. Report what was found and ask the user to

confirm before proceeding.

  1. Assign depths — use the following defaults based on filename sort

order (lowest number = furthest back):

| Position | Depth | --md-image-position |

|---|---|---|

| First (far bg) | 8 | 70% |

| Second | 5 | 25% |

| Third | 2 | 40% |

| Fourth (fg) | 1 | 50% |

If there are fewer or more than 4 layers, adjust the depth spread evenly.

  1. Write docs/overrides/home.html — use the template:

```html

{% extends "base.html" %}

{% block tabs %}

{{ super() }}

<style>

.md-header{position:initial}

.md-main__inner{margin:0}

.md-content{display:none}

@media screen and (min-width:60em){.md-sidebar--secondary{display:none}}

@media screen and (min-width:76.25em){.md-sidebar--primary{display:none}}

</style>

<div class="mdx-parallax" data-mdx-component="parallax">

<section class="mdx-parallax__group" data-md-color-scheme="slate">

<!-- one <picture> per layer, see home.html in this repo -->

<div class="mdx-parallaxlayer mdx-parallaxblend"></div>

<div class="mdx-hero" data-mdx-component="hero">

<div class="mdx-hero__scrollwrap md-grid">

<div class="mdx-hero__inner">

<div class="mdx-hero__teaser md-typeset">

<h1>{{ hero_headline }}</h1>

<p>{{ hero_subtext }}</p>

<a href="..." class="md-button md-button--primary">{{ primary_button_label }}</a>

<a href="..." class="md-button">Learn more</a>

</div>

<div class="mdx-hero__more">

<svg ...></svg>

</div>

</div>

</div>

</div>

</section>

<section class="mdx-parallax__group" data-md-color-scheme="slate">

<div class="md-content md-grid" data-md-component="content">

<div class="md-content__inner md-typeset">{{ page.content }}</div>

</div>

</section>

</div>

{% endblock %}

{% block content %}{% endblock %}

{% block footer %}{% endblock %}

```

  1. Copy docs/assets/stylesheets/home.css from this repo verbatim — do

not modify the parallax CSS without the user's request.

  1. Update mkdocs.yml — ensure these keys are present:

```yaml

theme:

custom_dir: docs/overrides

extra_css:

```

  1. Run mkdocs build — report the last 5 lines of output. If errors,

fix and re-run before reporting success.

3. Guardrails

perspective + translateZ approach.

correct clipping.

4. Example session

User:  I have 4 AVIF files in docs/assets/hero/ and want to add the parallax.
Agent: Found: 1-landscape@4x.avif, 2-plateau@4x.avif, 5-plants-1@4x.avif,
       6-plants-2@4x.avif. Assigning depths 8, 5, 2, 1. What's your hero headline?
User:  "Ship faster. Think clearer."
Agent: Wrote home.html, home.css, updated mkdocs.yml. mkdocs build: success.

5. Changelog

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.