PocketPapi

Developer library · 68 free recipes

Effects, ready to ship.

Free motion recipes for real websites. Browse practical CSS and JavaScript patterns, copy a focused implementation, or let an LLM fetch the exact effect through the PocketPapi API or MCP.

const effect = "fade-up-reveal";
await ship(effect);

The foundation

Native recipes

Small, composable patterns you can paste into a plain HTML site, a CMS, or a generated staging build.

Interactive preview
Scroll-drivenCC0-style snippets

Sticky section progress

Keep a compact step marker pinned while the related section moves through view.

[data-sc-effect="sticky-section-progress"] { position: relative; }
[data-sc-effect="sticky-section-progress"] .sc-sticky-marker {
  position: sticky; top: 1rem; z-index: 2; width: max-content;
  padding: .55rem .75rem; border: 1px solid #dce3ee; border-radius: 999px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
}
[data-sc-effect="sticky-section-progress"] .sc-sticky-marker [aria-current="true"] { color: #155eef; font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  [data-sc-effect="sticky-section-progress"] .sc-sticky-marker { scroll-behavior: auto; }
}
Interactive preview
Scroll-drivenCC0-style snippets

Scroll-highlight navigation

Highlight the navigation item for the section currently in view using native IntersectionObserver.

[data-sc-effect="scroll-highlight"] a { color: #66758a; transition: color 180ms ease; }
[data-sc-effect="scroll-highlight"] a[aria-current="location"] { color: #155eef; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { [data-sc-effect="scroll-highlight"] a { transition: none; } }

const highlightNav = document.querySelector('[data-sc-effect="scroll-highlight"]');
const highlightLinks = [...highlightNav.querySelectorAll('a[href^="#"]')];
const highlightObserver = new IntersectionObserver((entries) => {
  entries.forEach(({ isIntersecting, target }) => {
    if (!isIntersecting) return;
    highlightLinks.forEach((link) => link.removeAttribute('aria-current'));
    highlightNav.querySelector(`a[href="#${target.id}"]`)?.setAttribute('aria-current', 'location');
  });
}, { rootMargin: '-35% 0px -55% 0px' });
highlightLinks.forEach((link) => document.querySelector(link.hash) && highlightObserver.observe(document.querySelector(link.hash)));
Interactive preview
Scroll-drivenCC0-style snippets

SVG path draw

Draw a small inline SVG path into view without an animation library or an external asset.

[data-sc-effect="svg-path-draw"] path {
  fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  pathLength: 1; animation: sc-path-draw 1.1s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes sc-path-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  [data-sc-effect="svg-path-draw"] path { animation: none; stroke-dashoffset: 0; }
}
Interactive preview
Scroll-drivenCC0-style snippets

Reading time progress

Pair a reading-time estimate with a small progress indicator for long-form content.

[data-sc-effect="reading-time-progress"] { --sc-reading-progress: 0%; }
[data-sc-effect="reading-time-progress"]::before { content: ""; display: block; width: var(--sc-reading-progress); height: 3px; background: #155eef; transition: width 120ms linear; }
@media (prefers-reduced-motion: reduce) { [data-sc-effect="reading-time-progress"]::before { transition: none; } }

const reading = document.querySelector('[data-sc-effect="reading-time-progress"]'); let readingFrame = 0; const updateReading = () => { readingFrame = 0; const max = document.documentElement.scrollHeight - innerHeight; reading.style.setProperty('--sc-reading-progress', `${max > 0 ? (scrollY / max) * 100 : 0}%`); }; addEventListener('scroll', () => { if (!readingFrame) readingFrame = requestAnimationFrame(updateReading); }, { passive: true }); updateReading();

Bring a library when it earns its weight

Free library starters

Version-pinned starting points for open-source libraries. Review the license and performance tradeoff before adding another dependency.

For GPTs and other agents

Tell the LLM how to use the library.

Give the model a clear selection loop. It should discover, fetch, compose, then explain where it placed the effect instead of inventing a new dependency.

Recommended instruction

Use this in a system or developer prompt when the model can access the REST API or MCP.

When a user asks for website motion or an interaction effect:
1. Search PocketPapi’s effects catalog before writing a new animation.
2. Prefer a native recipe when it meets the request; use a free MIT library only when it materially reduces complexity.
3. Fetch the chosen effect by effect_id and inspect its reduced-motion and accessibility notes.
4. Read `studio_compatibility` before choosing an effect. `available=true` means Site Studio can stage it on one unique existing element; `available=false` means it is copy-code/MCP composition only and needs markup or reviewed dependency setup.
5. For a connected site, use `sitecommander_site_studio_media` with `media_type=video` to find an approved MP4/WebM and `media_type=poster` for an optional still image, then call `sitecommander_site_studio_effect_apply` with the exact staged page, unique selector, and chosen animation settings. This returns a review preview and never publishes. Authorized REST clients can use `/api/control-plane/site-studio/media` and `/api/control-plane/site-studio/effects` with the same site scope.
6. For standalone code, compose the effect for the user’s real selector. Keep the selector scoped and do not rewrite unrelated styles.
7. Return the exact files or insertion points, explain the dependency (if any), and mention keyboard, touch, and prefers-reduced-motion behavior.
8. Never add a library from an untrusted CDN or use a versionless URL when a pinned URL is available.

Use `sitecommander_effects_search`, `sitecommander_effects_fetch`, and `sitecommander_effects_compose` for discovery and code. Use `sitecommander_site_studio_media` plus `sitecommander_site_studio_effect_apply` only for an authorized site's staging workflow.
Public catalog, connected-site staging.The REST endpoints are public and read-only. An authorized MCP site connection can stage compatible effects for review; publishing remains a separate approval.