=== Scrollytelling ===
Contributors: scrollytelling
Tags: scrollytelling, storytelling, embed, interactive, scroll
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed your interactive, scroll-driven Scrollytelling stories into any post or page — inline or as a launch card.

== Description ==

[Scrollytelling](https://scrollytelling.ai/) turns an idea into a single, scroll-driven web page — animated, cinematic, and fully editable. This plugin lets you drop your published stories into WordPress.

* **Block** — add the "Scrollytelling Story" block, paste a story URL, and choose how it appears.
* **Shortcode** — `[scrollytelling url="https://my-story.scrollytelling.ai"]`.
* **Auto-embed (oEmbed)** — paste a story URL on its own line and it embeds automatically.
* **Two display modes** — *inline* (the story embeds in the page, with a fullscreen button) or a *card* (a poster that opens the full immersive story).
* **Connect your account** *(optional)* — add an API key to browse your own stories and insert them with a click, no copy-pasting URLs.

You create and publish stories at [scrollytelling.ai](https://scrollytelling.ai/); this plugin only displays already-published, public stories.

= Getting started (2 minutes) =

1. **Publish a story** at [scrollytelling.ai](https://scrollytelling.ai/) — every published story gets its own address, like `https://my-story.scrollytelling.ai`. You can copy it from your dashboard.
2. **Open any post or page** in the WordPress editor.
3. **Click the + button** (top left of the editor), search for **"Scrollytelling Story"**, and add the block.
4. **Paste your story URL** into the block — the story appears right in the editor.
5. In the block settings (right sidebar), choose **Inline** (the story plays inside your page) or **Card** (a poster that opens the full story), and adjust the height.

Shortcuts: pasting a story URL on an empty line embeds it automatically, just like a YouTube link — or type `/scrollytelling` in the editor. In the Classic editor, use the shortcode below.

*Optional:* connect your account under **Settings → Scrollytelling** with an API key (created at Scrollytelling → Settings → Connect WordPress) to insert stories from a picker instead of pasting URLs. The same settings page has a "How to embed" recap whenever you need it.

== External services ==

This plugin connects to the Scrollytelling API (`https://api.scrollytelling.ai`):

* **oEmbed** — when a story is embedded, WordPress requests `https://api.scrollytelling.ai/published/oembed?url=<your story URL>` to get the embed markup. Only the story URL is sent.
* **Account connection (optional)** — if you save an API key, the plugin requests `https://api.scrollytelling.ai/wp/stories` and `/wp/ping` server-side, sending your API key, to list your own published stories in the editor.

Embedded stories load from your story's public address (e.g. `https://your-story.scrollytelling.ai`).

Terms: https://scrollytelling.ai/terms-of-service/ — Privacy: https://scrollytelling.ai/privacy-policy/

== Installation ==

1. In your WordPress admin, go to **Plugins → Add Plugin**, search for "Scrollytelling", then install and activate it.
2. Open any post or page in the editor, click the **+** button (top left), search for **Scrollytelling Story**, and add the block.
3. Paste your published story URL (every published story has an address like `https://my-story.scrollytelling.ai` — find yours in your scrollytelling.ai dashboard). In the block settings on the right, choose **Inline** or **Card** display.
4. Even simpler: paste a story URL on an empty line in the editor and press Enter — WordPress embeds it automatically, just like a YouTube link.
5. *(Optional)* In **Settings → Scrollytelling**, paste an API key (from Scrollytelling → Settings → Connect WordPress) to browse and insert your stories from the editor without copying URLs. The same page has a "How to embed" recap.

== Frequently Asked Questions ==

= How do I add a story to a post? =
Three ways: add the **Scrollytelling Story** block (click **+** in the editor and search for it), paste a published story URL on an empty line (it auto-embeds), or use the `[scrollytelling url="…"]` shortcode. A short guide also appears under **Settings → Scrollytelling** after activation.

= Do I need a Scrollytelling account? =
To embed by URL, no — any published story URL works. To browse and insert your own stories from the editor, connect your account with an API key.

= Inline or card? =
Inline embeds the scroll experience directly in your page (with a fullscreen button). The card shows a poster that opens the full immersive story — best when you don't want a nested scroll area.

= Does it work with the Classic Editor? =
Yes — use the `[scrollytelling]` shortcode.

== Screenshots ==

1. Creating a story in the Scrollytelling editor at scrollytelling.ai.
2. A published scroll-driven story — the experience your visitors get.
3. Scenes animate cinematically as the reader scrolls.
4. Every story is a scroll-driven web page you can embed with a URL, the block, or the shortcode.

== Changelog ==

= 1.0.2 =
* New: getting-started guidance — a one-time welcome notice after activation, a "How to embed a story" guide on the settings page, and Settings / How-to-embed links on the Plugins screen.
* Inline embed height from the shortcode/block is now capped at 4000px, matching the settings limit.
* The settings height field now allows the full 200–4000px range.
* Uninstall also removes cached URL-verification transients.

= 1.0.1 =
* Settings page now loads its JavaScript with wp_enqueue_script() + wp_localize_script() instead of an inline script tag (WordPress.org review compliance).
* Inline iframes now render only for verified story URLs: *.scrollytelling.ai stories are allowed directly, custom-domain stories are confirmed against the Scrollytelling API (with caching); unverified URLs fall back to the link card.
* Hardened the card poster style against CSS injection via the thumbnail attribute.
* The account-status endpoint now requires administrator capability.
* Requires WordPress 6.6+ (the block uses the JSX runtime introduced in 6.6).

= 1.0.0 =
* Initial release: block, shortcode, oEmbed auto-embed, inline + card display modes, optional account connection.
