冬季雪景主题组件 ❄️

This theme component adds some animated snow to your forum.

:christmas_tree: Warning: the animations will increase browser CPU usage :santa:

:eye: Demo

:link: Repository

Javascript mode (shared by @cjk77 here):

CSS Mode (adapted from here)

37 个赞

Thanks - now with snow :smiley:

Installation:

Go to: /admin/customize/themes
Choose Compontes - add Install.
Paste in the link: https://github.com/davidtaylorhq/discourse-snow-theme.git
Go back to admin/customize/themes and find your theme.
Click it and you can customize your theme.
Scroll down
Add the new component to your theme.

And your have :snowflake:

10 个赞

I’ve got a couple of users using Firefox and Opera where this isn’t working (configured with js-mode), but the codepen example of the code does work. Works fine in Chrome. Any ideas?

ETA: Both users have confirmed that css mode works for them

1 个赞

It seems to be a Chrome-only component. On Firefox, with JS-mode, there’s nothing, and with CSS mode there’s a wall of jerky snow flakes that covers the screen, so it’s not really usable.

3 个赞

It is now updated so that js-mode works for Firefox. I haven’t tested Opera, but I suspect the same fix will help there as well.

14 个赞

Can confirm it’s now working for both of my users, Firefox and Opera. Thanks for the fix.

5 个赞

I use Opera,

looked great but as David noted

image

image
the CPU is too much,

1% without up to 39% with,

Sadly had to go :pensive:

6 个赞

is there a way to make this have random fireworks instead of snow?

and my CPU never increased with the snow, used it on desktops and phones, my entire forum loved it, and not one complaint about CPU usage

10 个赞

Hi! I love this, it’s adorable and really brings things to life. I’m wondering, however, if it’s possible to make it appear only to the right and left/in the unused space beside the board (or go behind it)? That way it doesn’t snow all over the text and make reading difficult.

4 个赞

Seems to work fine with the latest discourse release…

2 个赞

非常喜欢这个主题组件,但有没有办法将“点”(或者说“圆点”?)更改为真正的雪花图标?

1 个赞

有没有办法让雪花下落得慢一点,这样就不会那么分散注意力了?有点像懒洋洋的雪?或者有没有办法让用户自己关闭雪花,这样有些人可以享受它,而那些觉得它有问题的人可以关闭它?

1 个赞

您使用的是 CSS 版本还是 JS 版本?

已从 JS 切换到 CSS!但我们可以尝试任何一种,看哪种更容易。@famousamos.1 供您参考

3 个赞

@dennisjbr 正在处理 - 我应该先问他的,但我的待办事项清单太长了。他帮助我们维护网站。

3 个赞

CSS 版本更容易更改,但这并非相同效果。:thinking:

如果您对 CSS 版本感到满意,并希望减慢下落速度,请将此 CSS 添加到您的主题或新的主题组件中,并根据需要调整值。值越高,速度越慢。

#snow {
    animation: snow 60s linear infinite;
}
6 个赞

非常感谢

3 个赞