{"id":13626416,"url":"https://github.com/dddddddddzzzz/open-stories-element","last_synced_at":"2025-04-16T14:33:36.980Z","repository":{"id":54340755,"uuid":"518889995","full_name":"dddddddddzzzz/open-stories-element","owner":"dddddddddzzzz","description":"Open Stories feed → Story viewer","archived":false,"fork":false,"pushed_at":"2024-11-05T23:55:48.000Z","size":20112,"stargazers_count":39,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-06T00:32:49.072Z","etag":null,"topics":["custom-element"],"latest_commit_sha":null,"homepage":"https://element.openstories.fyi/demo/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dddddddddzzzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-28T14:59:42.000Z","updated_at":"2024-11-05T23:55:48.000Z","dependencies_parsed_at":"2024-11-06T00:25:34.661Z","dependency_job_id":"505c8c72-c03f-4cd2-8a47-f816a2a1f24f","html_url":"https://github.com/dddddddddzzzz/open-stories-element","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2Fopen-stories-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2Fopen-stories-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2Fopen-stories-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dddddddddzzzz%2Fopen-stories-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dddddddddzzzz","download_url":"https://codeload.github.com/dddddddddzzzz/open-stories-element/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250821,"owners_count":21237961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-element"],"created_at":"2024-08-01T21:02:17.762Z","updated_at":"2025-04-16T14:33:34.162Z","avatar_url":"https://github.com/dddddddddzzzz.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# `\u003copen-stories\u003e`\n\nAn [OpenStoriesFeed](https://github.com/dddddddddzzzz/OpenStories) viewer. See it in action on [muan.co](https://muan.co).\n\n## WIP\n\nThings yet to be supported: \n\n- `feed._open_stories.preview`\n- `feed.items[]._open_stories.preview`\n- `feed.items[]._open_stories.content_warning`\n- `feed.items[]._open_stories.tracks`: Changing tracks for videos\n\n## Usage\n\n```html\n\u003c!-- Include `OpenStoriesElement` --\u003e\n\u003cscript src=\"https://unpkg.com/open-stories-element@0.0.30\" type=\"module\" defer\u003e\u003c/script\u003e\n\n\u003c!-- Render `\u003copen-stories\u003e` --\u003e\n\u003copen-stories src=\"./feed.json\"\u003e\u003c/open-stories\u003e\n```\n\nThis requires native [`\u003cdialog\u003e`](https://caniuse.com/dialog) and [Shadow DOM](https://caniuse.com/shadowdomv1) support. No polyfills included.\n\n## Parts\n\nStyle elements with `::part` ([MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/::part)):\n\n### Button\n\n`open-stories::part(button)` is the selector for the `\u003cbutton\u003e` that opens the story modal. It would be good to style `open-stories:not(:defined)` the same way, to prevent style flashing as the script executes.\n\n### Advanced\n\n- `open-stories::part(dialog)`: The modal `\u003cdialog\u003e`.\n- `open-stories::part(loading-visual)`: The loading overlay.\n- `open-stories::part(error-visual)`: The resource loading error overlay.\n- `open-stories::part(story)`: The `\u003cimg\u003e` or `\u003cvideo\u003e` element of your story. Use `::cue` to style video tracks, for example.\n- `open-stories::part(metadata)`: The `\u003cdetails\u003e` for metadata.\n- `open-stories::part(metadata-summary)`: The `\u003csummary\u003e` for expanding metadata.\n- `open-stories::part(metadata-content)`: The metadata content container.\n\n## Button text / `\u003cslot\u003e`\n\nWhatever you put inside `\u003copen-stories\u003eHERE\u003c/open-stories\u003e` will replace the default button text \"View Stories\".  ([MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot))\n\n## Attributes\n\n- `src`: Required. A [OpenStoriesFeed](https://github.com/dddddddddzzzz/OpenStories) URL.\n- `loading`: Optional. Values: `lazy` or `eager`. Default to `eager`. When set to `lazy`, only the first story in the feed is loaded before user interaction.\n- `duration`: Optional. Number in seconds. Default to `5`.\n- `show-metadata`: Optional. Display `items[]._open_stories.caption`.\n- `is-highlight`: Optional. View history does not get set.\n\n## Classes\n\n- `.is-loading`: Present when feed is being fetched.\n- `.is-empty`: Present when no stories found.\n- `.is-read`: Present when stories have all been viewed. This relies on `localStroage` and does not work cross-origin/cross-devices.\n- `.is-paused`: Present autoplay is paused.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdddddddddzzzz%2Fopen-stories-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdddddddddzzzz%2Fopen-stories-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdddddddddzzzz%2Fopen-stories-element/lists"}