재미있는 TC: Discourse Confetti Clicks

:information_source: Summary Add fun to your community by having confetti where you click, using tsParticles.
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - NateDhaliwal/discourse-confetti-clicks · GitHub
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This theme component creates confetti where the user clicks or taps. The amount of confetti and the angle of spread of confetti can both be controlled using settings.
This TC creates more fun for your community to make it more interactive.
The confetti is made possible with tsParticles, a JS library for animating confetti, snow, lines and more.
Some assistance came from ask.discourse.com.

Settings:

  1. confetti_amount changes the amount of confetti on each click.

:warning: Try not to put too high a number, or there will be more lag with the confetti appearing and dispersing. 100-200 is a good range.

  1. confetti_spread changes the angle of which the confetti disperses. All numbers are in degrees. A value of 360 causes the confetti to disperse in all directions. A value of 1 causes the confetti to disperse and fall in a straight line.
  2. allowed_in sets where the confetti can be used in. Enter the category slug(s) into this field. For multiple categories, separate the slugs with a | (no spaces).
    Leaving this field blank enables confetti in all pages.
13개의 좋아요

This is fun! Might I suggest adding limits to where this is enabled? It doesn’t seem practical when navigating a general space, but it could be fun on a celebratory page.

5개의 좋아요

this needs to be tied to the automation for members’ birthdays :smiley:

14개의 좋아요

Would this be a forum page like /leaderboard or /about, or topics in a specific category?

UPDATE:
There is a new setting, allowed_in, that allows the confetti to be showed only in specific categories. Enter the category slug. For multiple categories, separate them with a |.

3개의 좋아요

This is now fixed! Leaving this field blank enables confetti in all pages.

1개의 좋아요

Update: the allowed_in category is now updated to use category as the list_type for the setting. This allows a better way to select categories.

The theme creator preview link doesn’t do anything for me.

1개의 좋아요

Whoops, my bad. The categories in the setting were #school and #movies. I’ve changed it to #general.

이 TC는 아마도 가장 쓸모없는 것일 겁니다 :laughing:


곧 스크립트 태그를 현대화할 예정입니다. 특정 URL 경로에서 표시되도록 설정하는 기능도 추가할 수 있겠네요.

1개의 좋아요

이 컴포넌트를 업데이트하여 더 이상 <script type='text/discourse-plugin'>을 사용하지 않습니다.

또한 포럼 내 특정 경로에서 컨페티를 활성화하기 위해 allowed_in_urls 설정을 추가했습니다. (확인 시 URL 인수는 제거됩니다.)

예를 들어, Theme Creator에서 제가 설정한 내용은 다음과 같습니다:

즉, 컨페티는 다음 장소에서 활성화됩니다:

2개의 좋아요