{"id":20054369,"url":"https://github.com/divriots/flying-santa","last_synced_at":"2025-07-04T23:02:12.321Z","repository":{"id":45858449,"uuid":"433431426","full_name":"divriots/flying-santa","owner":"divriots","description":"Flying Santa christmas component","archived":false,"fork":false,"pushed_at":"2022-02-10T11:06:41.000Z","size":345,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-01T14:16:51.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://webcomponents.dev/view/MW0MuMtZp2VIRSFEzvQ0","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/divriots.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}},"created_at":"2021-11-30T12:57:39.000Z","updated_at":"2021-12-01T14:36:15.000Z","dependencies_parsed_at":"2022-07-22T11:02:42.369Z","dependency_job_id":null,"html_url":"https://github.com/divriots/flying-santa","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fflying-santa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fflying-santa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fflying-santa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fflying-santa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divriots","download_url":"https://codeload.github.com/divriots/flying-santa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241482113,"owners_count":19969850,"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":[],"created_at":"2024-11-13T12:40:08.869Z","updated_at":"2025-03-02T09:18:09.909Z","avatar_url":"https://github.com/divriots.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flying Santa\n\n\u003cp\u003e\n  \u003ca href=\"https://divRIOTS.com\"\u003eBrought to you by\u003cbr/\u003e\u003c/a\u003e\n  \u003ca href=\"https://divRIOTS.com#gh-light-mode-only\"\u003e\n    \u003cimg width=\"150\" height=\"40\" src=\"https://divRIOTS.com/divriots.svg\" alt=\"‹div›RIOTS\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://divRIOTS.com#gh-dark-mode-only\"\u003e\n    \u003cimg width=\"150\" height=\"40\" src=\"https://divRIOTS.com/divriots-dark.svg\" alt=\"‹div›RIOTS\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nFun little christmas gimmick Web Component, works anywhere, based on [Lit](https://lit.dev) and [TypeScript](https://www.typescriptlang.org/).\n\n[See landing page](https://divriots.github.io/flying-santa/)\n\n[See the full demos \u0026 code](https://webcomponents.dev/edit/MW0MuMtZp2VIRSFEzvQ0/stories/index.stories.js)\n\n## Usage\n\n```sh\nnpm i @divriots/flying-santa\n```\n\n```html\n\u003cscript type=\"module\"\u003e\nimport '@divriots/flying-santa';\n\u003c/script\u003e\n\u003cflying-santa\u003e\u003c/flying-santa\u003e\n```\n\nOr if you want to extend the components\n\n```js\nimport { FlyingSanta, SantaPresent } from '@divriots/flying-santa';\n```\n\nOr from a CDN without needing NPM\n\n```html\n\u003cscript type=\"module\" src=\"https://unpkg.com/@divriots/flying-santa/dist/index.js?module\"\u003e\u003c/script\u003e\n\u003cflying-santa\u003e\u003c/flying-santa\u003e\n```\n\n## Features\n\n- Configure the interval speed at which Santa changes direction with the `change-speed` attribute (default 5000, which is milliseconds)\n- Configure speed amplifier to change how fast Santa travels with the `speed` attribute (default 1)\n- Change the distance at which Santa starts throwing presents with the `presents-distance` attribute (default 100, which is in pixels)\n- Change the interval at which Santa throws presents with the `presents-interval` (default 100)\n- Configure the gravity strength pulling on the thrown presents with the `presents-drop-speed` (default 0.5)\n\n## SPA accumulating Santas\n\nNote that Santa can be put anywhere on the page, and then it will insert itself into `\u003chtml\u003e` element and fly all over your page.\nIf you use SPA pattern and have the flying-santa on multiple pages, the number of Santas will accumulate.\n\nTherefore, you probably want to clean up the Santas on route switching, there's a util for that:\n\n```js\nimport { cleanup } from '@divriots/flying-santa';\n\n// whenever you switch routes call this before the new page renders\n// if you're using a different tag-name for your Santa element, pass it as an argument\ncleanup();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivriots%2Fflying-santa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivriots%2Fflying-santa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivriots%2Fflying-santa/lists"}