Snowflakes

Started by Chen Zhen, December 24, 2018, 06:44:11 AM

Previous topic - Next topic

Steve

Checked all events on your latest version and everything seems to be working fine without the "Append to <body> of the HTML page" checked.  :)
DO NOT pm me for support!

jsx

@Chen Zhen

I have this modification installed in version 1.79 and youtube videos in Ohara YouTube Embed v1.2.11 modification stopped displaying. When I disable the Snowflakes modification, the videos work again.

Chen Zhen

I've already told you why that mod causes a conflict in a previous post from this thread

Ask the author of that mod to replace all of the document.write() with proper DOM manipulation. I'm not going to do it and if the author doesn't want to bother (or anyone capable) then your out of luck She is still occasionally active but ask in her mod thread or on her public forum, do not PM her about mod support like you previously did to me in the past.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

jsx

I had to forget what you wrote to me because your mod is only used once a year for those few days. And don't educate me about private messages.

Steve

Apparently he did as you sent him unwanted PMs. And there will be no more discussion about that in this topic.

Let's keep it on topic, please.
DO NOT pm me for support!

Michael Vail

Such a cool mod! I really like how the setting options change when you select the type of effects. Really nice work on this. Thanks you so much. The detail you put into it is amazing.

Happy New Year.

petewadey

I'm getting the following error messages

/smf/index.php?PHPSESSID=b9f061190472c83f5bd0a680f65e5bb9&amp;action=dlattach;topic=11051.0;attach=32078;image;ts=1553017207
8: Trying to access array offset on value of type null
/smf/Sources/snowflakesMobileDetect.php
Line: 1065

==>1065:                   if (is_array($matchType['matches'])) {

I'm using the latest version of Snowflake, smf 2.0.19 and php 7.4

Any idea why?
Thanks

Chen Zhen


@petewadey
The null error you were receiving in your log should be fixed for Snowflakes v1.80.

Thanks for the report.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

JasonSGN

Thanks for the great mod. I installed it on a clean 2.1.1 installation and the snowflakes work fine, but trying to change any settings resulted in a blank screen when saving. The only thing I can think of is that my site is running on PHP 8.x. Could that be the problem? Thanks in advance.

Steve

Can you drop your PHP to 7.x and see if you still have the same problem?
DO NOT pm me for support!

Arantor

Would love to know what errors are hitting the server (not necessarily SMF's) error log.

JasonSGN

Quote from: Steve on February 21, 2022, 01:54:42 PMCan you drop your PHP to 7.x and see if you still have the same problem?
I downgraded to 7.4 and it seems to be working fine now. Thanks. Hopefully it can be updated to support PHP 8.x in the future.

Chen Zhen


@JasonSGN :
I updated the mod to version 1.81 which should allow it to function using PHP 8.0.0+.

The changelog shows what was fixed for anyone curious about it.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

JasonSGN

Thanks. Just tested it with PHP 8.04 and it works perfectly. I appreciate you updating it so quickly.

Julius_2000

Hi there, great mod!

Question: I would like to assign a random opacity value to each flake in Flurry mode to create a little more depth. All I was able to do with my limited knowledge so far was to add this randomization to the jquerySnow01.js file

{op=(Math.random() * (0.99 - 0.75) + 0.75).toFixed(2)};

But it makes the flakes changing opacity indefintely. It looks nice, too, giving them a shimmering effect, but it's not quite what I'd like it to be. Is there a way to get individual opacity for each flake?

Chen Zhen

Just use the Math.random() function by itself & add to the JS where it alters the css for the flakes (instead of the op variable).

ie.
f.css('opacity',Math.random());



My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen

To make it affect each flake a bit different you can try this...

find:
f.css('opacity',op);

replace with:
setInterval(flakeOpacity, (Math.floor(Math.random() * 15000) + 2000), f);

Put this at the end of the file:
function flakeOpacity(f) {
    f.css('opacity',Math.random());
}

You can change the random interval to your liking (15000 & 2000 from above).

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen


IMO for this scenario an interval (repeat) is not necessary & will cause a bit of a performance issue.
A timeout is more suitable for the desired outcome.

Change the above interval function to a timeout:
setTimeout(flakeOpacity, (Math.floor(Math.random() * 15000) + 2000), f);

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Julius_2000

Thank you so much for helping out, Zhen! Your solution creates interesting effects but they still flicker.

I'd like to achieve something like this:
https://www.cssscript.com/demo/snow-falling-animation/

The reason I would like to use your mod instead of the one in my link is that yours is a bit more CPU efficient, at least it seems that way.

woolly bugger

What happened to the exploding lights, my peeps are missing them...


Advertisement: