Components / Story
Focus Reveal
The word you hover stays sharp in brackets; the rest softens. Linked words show a card.
Install
npm install @effect79/cardverseUsage
<script src="https://cdn.jsdelivr.net/npm/@effect79/cardverse@1/dist/cardverse.min.js"></script>
<e79-focus-reveal theme="light">
<script type="application/json">
{
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
}
</script>
</e79-focus-reveal>import { FocusReveal } from '@effect79/cardverse/react';
const items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
export default function Section() {
return <FocusReveal theme="light" items={items} config={{ /* from the Studio */ }} />;
}// app/page.jsx — a Server Component can render it; the wrapper is a client component
import '@effect79/cardverse/fonts.css'; // once, e.g. in app/layout.jsx
import { FocusReveal } from '@effect79/cardverse/react';
const items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
export default function Page() {
return <FocusReveal theme="light" items={items} />;
}<script setup>
import '@effect79/cardverse'; // registers <e79-focus-reveal> (once, anywhere in your app)
const items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
const config = {}; // from the Studio
</script>
<template>
<e79-focus-reveal theme="light" :items.prop="items" :config.prop="config" />
</template>// vite.config.js — tell Vue that <e79-…> tags are web components
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('e79-') } } })],
});// nuxt.config.ts — then use the same tag inside <ClientOnly> … </ClientOnly>
export default defineNuxtConfig({
vue: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('e79-') } },
});
// plugins/cardverse.client.ts
import '@effect79/cardverse';
export default defineNuxtPlugin(() => {});<script setup>
const items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
const config = {}; // from the Studio
</script>
<template>
<e79-focus-reveal theme="light" :items.prop="items" :config.prop="config" />
</template><script>
import '@effect79/cardverse'; // registers <e79-focus-reveal>
const items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
const config = {}; // from the Studio
</script>
<e79-focus-reveal theme="light" {items} {config}></e79-focus-reveal>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@effect79/cardverse'; // registers <e79-focus-reveal>
@Component({
selector: 'app-root',
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA], // lets Angular accept <e79-…> tags
template: `<e79-focus-reveal theme="light" [items]="items" [config]="config"></e79-focus-reveal>`,
})
export class AppComponent {
items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
config = {}; // from the Studio
}---
const items = {
"text": "Good interfaces feel {inevitable|inevitable}. Every surface knows its weight, every move can be interrupted, and nothing…",
"cards": {}
};
const config = {}; // from the Studio
---
<e79-focus-reveal theme="light" config={JSON.stringify(config)}>
<script type="application/json" is:inline set:html={JSON.stringify(items)}></script>
</e79-focus-reveal>
<script>
import '@effect79/cardverse'; // registers <e79-focus-reveal> in the browser
</script>WordPress, Webflow, Shopify, Framer, Wix: use the HTML tab in a custom-code / embed block. More in the Docs.
Set the look visually: open Focus Reveal in the Studio, change anything, then Copy code. Only changed settings are exported.
Content
An object in the tag's JSON <script>, the items property, or src="content.json". Rows missing a required field are skipped, never break the page; an empty list shows a friendly placeholder.
| Field | Required | What it does |
|---|---|---|
text | yes | Paragraphs (blank line = new paragraph). Link a word to a card: {word|key}. |
cards | no | { key: { title, desc, media, link } } — previews for linked words. |
grid | no | [ { media, title, tag } ] for the Cards mode. |
Links & video
Give a row a link and its call to action goes there (on this demo, links point to this section). Add target: "_blank" for a new tab and cta for the button text. Without a link the call to action is hidden — never a button that does nothing.
Photos that fit every card. Add focus: "30% 20%" to keep a face or product in view when the card crops the photo, and mediaTall (plus videoTall) for a portrait version: each card shows the picture made for its shape, the way streaming apps do. More.
Settings
Pass only what you change, as JSON in the config attribute or the config prop. Every value is validated and clamped.
| Key | Setting | Default | Range / options |
|---|---|---|---|
| Content | |||
mode | Focus on | "text" | text grid |
tiles | Cards | 8 | 4 – 8 |
width | Max width | 880 | 420 – 1100 px |
| Type | |||
font | Font | "serif" | serif sans mono |
size | Size | 40 | 18 – 64 px |
lineHeight | Line height | 1.3 | 1 – 1.9 |
wordGap | Word gap | 0.02 | -0.1 – 0.6 em |
| Focus | |||
blur | Blur | 3.6 | 0 – 12 px |
dim | Dim | 0.32 | 0 – 0.85 |
falloff | NeighboursWords next to the focus stay a little sharper. | 0.4 | 0 – 1 |
fade | Fade time | 420 | 0 – 900 ms |
preview | Word previewsUnderlined words open a small card. | true | true / false |
| Frame | |||
frameTone | Colour | "accent" | accent ink blue amber |
padX | Pad X | 7 | 0 – 20 px |
padY | Pad Y | 3 | 0 – 16 px |
corner | Corner size | 12 | 5 – 26 px |
thickness | Thickness | 2 | 1 – 4 px |
| Driving | |||
manual | Manual focusHold the focus on one word (for screenshots and tuning). | false | true / false |
word | Word | 8 | 0 – 80 |
autoRead | Auto-readWalks the text word by word; hovering takes over. | false | true / false |
wpm | Reading speed | 230 | 100 – 500 wpm |
| Motion | |||
response | SpeedHow fast the frame glides. | 0.36 | 0.15 – 1 s |
bounce | BounceOvershoot. | 0.16 | 0 – 0.5 |
Theming
theme="light" | "dark" | "auto". Override tokens on the element, e.g. e79-focus-reveal { --accent: #ff5a36; --bg: #0b0b0f; --e79-font: 'Inter' }. Methods: el.replay(), el.pin('state'). States: idle focus.