{"id":13514985,"url":"https://github.com/avo-hq/stimulus-confetti","last_synced_at":"2025-04-05T10:07:28.871Z","repository":{"id":63980061,"uuid":"521165626","full_name":"avo-hq/stimulus-confetti","owner":"avo-hq","description":"The easiest way to add confetti to your StimulusJS app","archived":false,"fork":false,"pushed_at":"2024-10-11T05:57:08.000Z","size":16627,"stargazers_count":81,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T09:11:48.714Z","etag":null,"topics":["confetti","rails","stimulus","stimulusjs"],"latest_commit_sha":null,"homepage":"https://avohq.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avo-hq.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["adrianthedev"]}},"created_at":"2022-08-04T07:23:44.000Z","updated_at":"2025-03-25T02:08:52.000Z","dependencies_parsed_at":"2024-08-21T21:41:01.814Z","dependency_job_id":"f359e763-99e1-4954-b316-e134e276a905","html_url":"https://github.com/avo-hq/stimulus-confetti","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"411195e0298162eeff7727e0f893f691359331e9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avo-hq%2Fstimulus-confetti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avo-hq%2Fstimulus-confetti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avo-hq%2Fstimulus-confetti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avo-hq%2Fstimulus-confetti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avo-hq","download_url":"https://codeload.github.com/avo-hq/stimulus-confetti/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"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":["confetti","rails","stimulus","stimulusjs"],"created_at":"2024-08-01T05:01:04.934Z","updated_at":"2025-04-05T10:07:28.847Z","avatar_url":"https://github.com/avo-hq.png","language":"JavaScript","funding_links":["https://github.com/sponsors/adrianthedev","https://github.com/sponsors/catdad"],"categories":["JavaScript","**Awesome Hotwire** [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Stimulus"],"readme":"# Stimulus confetti\n\nAre you in the mood to add confetti to your stimulus application? You're in luck! This package helps you do that in no-time.\n\n\n![The easiest way to add confetti to your Stimulus JS app](school-pride.gif)\n\n## Install\n\nAdd the package to your project.\n\n```bash\nyarn add stimulus-confetti\n# or\nnpm install stimulus-confetti\n```\n\n## Register the stimulus controller\n\nRegister the controller in your Stimulus app.\n\n```javascript\nimport { Confetti } from \"stimulus-confetti\"\n\napplication.register('confetti', Confetti)\n```\n\n## Use the DOM\n\n```html\n\u003ca\n  href=\"https://github.com/avo-hq/avo\"\n  target=\"_blank\"\n  data-controller=\"confetti\"\n  data-action=\"click-\u003econfetti#spray\"\n\u003eStar Avo\u003c/a\u003e\n```\n\nWhen you click that link, the confetti will spray and after the animation finishes, the browser will navigate to that location.\n\n## Animation types\n\nThere are three types of animation. Note: actions should match animation values.\n\n1. **Basic** which shoots of confetti under your mouse\n\n```html\n\u003ca\n  href=\"https://github.com/avo-hq/avo\"\n  target=\"_blank\"\n  data-controller=\"confetti\"\n  data-action=\"click-\u003econfetti#spray\"\n  data-confetti-animation-value=\"basic\"\n\u003eStar Avo\u003c/a\u003e\n```\n\n![](basic.gif)\n\n2. **School pride** which adds two cannons on each side of the screen\n\n```html\n\u003ca\n  href=\"https://github.com/avo-hq/avo\"\n  target=\"_blank\"\n  data-controller=\"confetti\"\n  data-action=\"click-\u003econfetti#spray\"\n  data-confetti-animation-value=\"school-pride\"\n  data-confetti-duration-value=\"10\"\n  data-confetti-first-color-value=\"#CC0000\"\n  data-confetti-second-color-value=\"#0000FF\"\n\u003eStar Avo\u003c/a\u003e\n```\n\n![](school-pride.gif)\n\n3. **Stars** which will spray stars from under your cursor\n\n```html\n\u003ca\n  href=\"https://github.com/avo-hq/avo\"\n  target=\"_blank\"\n  data-controller=\"confetti\"\n  data-action=\"click-\u003econfetti#spray\"\n  data-confetti-animation-value=\"stars\"\n\u003eStar Avo\u003c/a\u003e\n```\n\n![](stars.gif)\n\n## Configuration\n\n### `data-confetti-animation-value`\n\nValues can be `basic`, `school-pride`, or `stars` and will change the type of animation.\n\nDefaults to `basic`.\n\n### `data-confetti-follow-value`\n\nControls whether at the end of the animation, the browser should follow the link. You can set it to `false` when you want to test the animation.\n\nDefaults to `true`.\n\n### `data-confetti-duration-value`\n\nThe duration, in seconds, for the **School pride** animation.\n\nDefaults to `5`.\n\n### `data-confetti-first-color-value`\n\nThe first color for the **School pride** animation.\nDefaults to `#0886DE`\n\n### `data-confetti-second-color-value`\n\nThe second color for the **School pride** animation.\nDefaults to `#FF6154`\n\n### `data-confetti-debug-value`\n\nControls wether log messages are being displayed in the console.\n\nDefaults to `false`.\n\n### `data-confetti-particleCount-value`, `data-confetti-startVelocity-value`, `data-confetti-spread-value`, and `data-confetti-ticks-value`\n\nControls various setting for the [`canvas-confetti`](https://github.com/catdad/canvas-confetti) package.\n\n## Thanks\n\nThis package is based on the [`canvas-confetti`](https://github.com/catdad/canvas-confetti) package, so please [donate](https://github.com/sponsors/catdad) to help them and support their work.\n\n## Other packages\n\n- [`active_storage-blurhash`](https://github.com/avo-hq/active_storage-blurhash) - A plug-n-play [blurhash](https://blurha.sh/) integration for images stored in ActiveStorage\n - [`avo`](https://github.com/avo-hq/avo) - Build Content management systems with Ruby on Rails\n - [`class_variants`](https://github.com/avo-hq/class_variants) - Easily configure styles and apply them as classes. Very useful when you're implementing Tailwind CSS components and call them with different states.\n - [`prop_initializer`](https://github.com/avo-hq/prop_initializer) - A flexible tool for defining properties on Ruby classes.\n\n## Try Avo ⭐️\n\nIf you enjoyed this gem try out [Avo](https://github.com/avo-hq/avo). It helps developers build Internal Tools, Admin Panels, CMSes, CRMs, and any other type of Business Apps 10x faster on top of Ruby on Rails.\n\n[![](./logo-on-white.png)](https://github.com/avo-hq/avo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favo-hq%2Fstimulus-confetti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favo-hq%2Fstimulus-confetti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favo-hq%2Fstimulus-confetti/lists"}