Christmas Decorations

Ceri
Ceri
@adolygwr
7 years ago
370 posts
Hi all
Does anyone know of a js script to give a falling snowflake or christmas light effect on the front page? I know these are about in various places on the web but I'm wondering if anyone has found one that works/is easy to implement on JR? If so where would I get it and how would I implement it?


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 03/23/18 09:06:40PM
michael
@michael
7 years ago
7,715 posts
This was at the top of the search results
http://www.schillmania.com/projects/snowstorm/

download this file:
http://www.schillmania.com/projects/snowstorm/snowstormv144_20131208.zip

Unzip it and rename the directory to 'snowstorm'.

Upload that folder to your site at:
/skins/YOUR-SKIN/contrib/snowskin

Adjust your skins meta.tpl to include this line
  <script src="{$jamroom_url}/skins/YOUR-SKIN/contrib/snowstorm/snowstorm.js"></script>

Rest the caches.
snow.jpg
snow.jpg  •  91KB

snowstorm.jpg
snowstorm.jpg  •  397KB

Ceri
Ceri
@adolygwr
7 years ago
370 posts
Hmmmmm....I think I followed the steps outlined above correctly BUT it doesn't seem to work. Any ideas?


--
Ceri Shaw - AmeriCymru
michael
@michael
7 years ago
7,715 posts
See that big YOUR-SKIN.... you're supposed to replace that with your skins name. :)
facepalm.jpg
facepalm.jpg  •  115KB

Ceri
Ceri
@adolygwr
7 years ago
370 posts
Ahhhhh....yes indeed. More coffee is needed I guess :)


--
Ceri Shaw - AmeriCymru
michael
@michael
7 years ago
7,715 posts
:thumbs-up:
Ceri
Ceri
@adolygwr
7 years ago
370 posts
Got it....many thanks :)


--
Ceri Shaw - AmeriCymru
michael
@michael
7 years ago
7,715 posts
oooohhhh, snow! :)

Merry Christmas.
Ceri
Ceri
@adolygwr
7 years ago
370 posts
Merry Christmas Michael :)


--
Ceri Shaw - AmeriCymru
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Hmm, question: Could I apply the snow only to my Main page Admin blog section "About" ?- how to adapt the above instructions to snow only there in that blog widget on my site's main page? (the top section where it says Welcome to FOTMD!)

("facepalm"...L O L)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 12/19/17 12:45:16PM
michael
@michael
7 years ago
7,715 posts
Doesn't look like you can confine the snow to just 'inside' with this script strumelia. These are the options it has:
http://www.schillmania.com/projects/snowstorm/#customizing

And I'm not seeing a target to just have it snow inside a section.

It was the first one from the search results though, so if you care to look for a different snow script and can locate one you like that does work inside a box I'm sure we can get that working too.

--edit--
spoke too soon, it DOES look like you can target one div:
this.targetElement = null;      // element which snow will be appended to (null = document.body) - can be an element ID eg. 'myDiv', or a DOM node reference

Will look at what your about div is called, hold on.
updated by @michael: 12/19/17 01:04:37PM
michael
@michael
7 years ago
7,715 posts
Not seeing the location of the "...Main page Admin blog section "About"...." but get it working first, then try adjusting the target element in the snowstorm.js file to target the ABOUT section.
snowstorm.jpg
snowstorm.jpg  •  226KB

Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
"About" is an Admin blog category...it came with the original Ningja skin as a sort of description box for the top of the Home page.
Does this code from my custom skin's index.tpl help identify what the admin blog "about" section would be called, for the snow code target?:

{* ======== END OF EMBEDDED TEMPLATES ======== *}
{* BEGIN Container *}
<div class="container">
    {* BEGIN About Section *}
    {if isset($_conf.mdFOTMD_Oct3_2017_index_activity_section) && $_conf.mdFOTMD_Oct3_2017_index_activity_section == 'on'}
        <div class="row">
            <div class="col12 last">
                <div class="title m10">
                    <h2>{jrCore_lang skin=$_conf.jrCore_active_skin id="8" default="About"}</h2>
                </div>
                {jrCore_list module="jrBlog" limit="1" search1="blog_category = about" template="index_about.tpl"}
            </div>
        </div>
    {/if}
    {* END About Section *}



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 12/19/17 05:03:08PM
michael
@michael
7 years ago
7,715 posts
Great. Change this:
<div class="container">
to this
<div class="container" id="about_section">

Then in the snowstorm.js file change this:
this.targetElement = null; 
to
this.targetElement = 'about_section'; 
and it should work.
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Michael, I've got the snowstorm working on the entire site for https://pennywhistleclub.com/
however, your instructions in your last post for "about section" I don't think would work, because the initial div class container code I posted actually encompasses all the main page "sections"... not just the About section. So at the moment I can't figure out the proper ID I should use (maybe...8? About?) and how I should change that in my skin index template, to then repeat the target in the snowstorm js.
Here is a slightly longer copy of the code of my skin's Index.tpl, so you can see what I mean...i don't want to change the id of that entire container class. (The "About" section is within it, near the top):

{* BEGIN Container *}
<div class="container">

    {* BEGIN About Section *}
    {if isset($_conf.pwPWskin_Dec20_2017_index_activity_section) && $_conf.pwPWskin_Dec20_2017_index_activity_section == 'on'}
        <div class="row">
            <div class="col12 last">
                <div class="title m10">
                    <h2>{jrCore_lang skin=$_conf.jrCore_active_skin id="8" default="About"}</h2>
                </div>
                {jrCore_list module="jrBlog" limit="1" search1="blog_category = about" template="index_about.tpl"}
            </div>
        </div>
    {/if}
    {* END About Section *}

    {* BEGIN Activity And Top Right Section *}
    {if isset($_conf.pwPWskin_Dec20_2017_index_activity_section) && $_conf.pwPWskin_Dec20_2017_index_activity_section == 'on'}
        <div class="row">
{* BEGIN Activity Section *}
            <div class="col8">

                <div class="title m10">
                    <h2>{jrCore_lang skin=$_conf.jrCore_active_skin id="20" default="Latest"} {jrCore_lang skin=$_conf.jrCore_active_skin id="27" default="Activity"}</h2>
                </div>

                {* BEGIN Activity Section *}
                <a id="activdiv" name="activdiv"></a>
                <div id="activitydiv" style="margin: 10px 10px 0 10px;padding-bottom: 10px;">
                    <div class="item"{if !jrCore_is_mobile_device()} style="max-height:916px;overflow-y:auto;overflow-x:hidden"{/if}>
                      {*  {jrCore_list module="jrAction" search1="action_module != jrFollower" search2="action_data NOT_LIKE %\"comment_module\":\"jrProfile\"%" order_by="_item_id desc" pagebreak=50 page=$_post.p} *}
                        {* michael *}
                        {jrCore_list module="jrAction" search1="action_module != jrFollower"  search3="action_original_item NOT_LIKE jrProfile:%" order_by="_item_id desc" pagebreak=50 page=$_post.p}
                        <br>
                        <div style="width:100%;text-align:center;padding:10px">
                            <a href="{$jamroom_url}/timeline">View More</a>
                        </div>
                    </div>
                </div>

            </div>
            {* END Activity Section *}

            {* BEGIN Right Side Section *}
            <div class="col4 last">
                <div class="container">

                    {* BEGIN Top Groups Section *}
                    {if isset($_conf.pwPWskin_Dec20_2017_top_groups_active) && $_conf.pwPWskin_Dec20_2017_top_groups_active == 'on'}
                    {if isset($_conf.pwPWskin_Dec20_2017_top_groups_limit) && $_conf.pwPWskin_Dec20_2017_top_groups_limit > 5}
                        {assign var="group_pb" value=$_conf.pwPWskin_Dec20_2017_top_groups_limit}
                    {else}



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 12/20/17 02:57:56PM
michael
@michael
7 years ago
7,715 posts
so what you want to do is put an id on the div you want the snowstorm to appear in. That id can be anything, (but make it one word with no weird characters or spaces and it must be unique to the page.) ideas for some acceptable examples:
id="snowstormArea"
id="the_snowstorm_section"
id="i_want_the_snowstorm_here"

like that......

Once that id is in place on whichever div you want to snow, then use that id in the snowstorm.js
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
I do see what you;re saying Michael. I'm just a little unsure exactly where to put the id= part in my index.tpl. I know it should go in that "About section" as you see in the code I pasted.
I'm guessing I need to put it within one of the two divs here:
<div class="row">
            <div class="col12 last">
...but am I right about that...and within which one of those divs should I put the new id?
I'm almost there, but the right location is not quite clear to me.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
7 years ago
7,715 posts
either of those locations would work. add it to one, then move it to a different one if its snowing in the wrong location.
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Those didn't work for me. I eventually went into my custom skin's Index_About.tpl ...and I added it there instead. That got some snow into the main page upper section, but it's kind of off centered to the left, and is limited to only the topmost part of the About section, but at least it's something! : https://pennywhistleclub.com/
Here is where I put the id, in that Index_About template:
{if isset($_items)}
<div style="margin: 10px 10px 0 10px;padding-bottom: 2px;">
    {jrCore_module_url module="jrBlog" assign="burl"}
    {foreach from=$_items item="item"}
        <div class="p10" id="snowstormArea">
            
            {$item.blog_text|jrCore_format_string:$item.profile_quota_id:null:nl2br|jrBlog_readmore}
            {if strpos($item.blog_text,'<!-- pagebreak -->')}
                <span class="info"><a href="{$jamroom_url}/{$item.profile_url}/{$burl}/{$item._item_id}/{$item.blog_title_url}">{jrCore_lang module="jrBlog" id="25" default="Read more"} &raquo;</a></span>
            {/if}
        </div>
    {/foreach}
</div>
{elseif jrUser_is_master()}
    <div class="center p10">
        Create an Admin blog with the category set to <b>about</b> to add content to this section.
    </div>
{else}
    <div class="center p10">
        <h1>Welcome to {$_conf.jrCore_system_name}!</h1>
    </div>
{/if}



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
michael
@michael
7 years ago
7,715 posts
try adding this to your css:
#snowstormArea {
    display: block;
    position: relative;
}
snowing.jpg
snowing.jpg  •  631KB

douglas
@douglas
7 years ago
2,790 posts
It is a little more work than just setting up a div. You have to tell the script to use the div using JavaScript.

First you'll need a div to hold the snow:

CSS
/* SNOW DIV */
#snow-div {
    position: relative;
    overflow: hidden;
    _zoom: 1; /* IE 6 display fix */
}

In the template you want the snow in, create the div:

<div id="snow-div">
Content should go inside this div...
</div>

Then in your skins/YOURSKIN/js/snowstorm.js file, find this:

  this.targetElement = null;      // element which snow will be appended to (null = document.body) - can be an element ID eg. 'myDiv', or a DOM node reference

and change it to this:

  this.targetElement = snow-div;      // element which snow will be appended to (null = document.body) - can be an element ID eg. 'myDiv', or a DOM node reference

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Thanks you two!
Douglas- hmm... if i follow your instructions, do I then NOT need to do Michael's last instructions of adding the relative block position in the CSS?
(and Michael: I've been looking at all my skin's CSS files..can't figure out which css file to add this code to...does it matter?*
Douglas: can you suggest to me which CSS file in my skin that I should add this SNOW DIV in the beginning of your instructions? There are so many css files in my skin, and none of them seem particularly related to that area of my site, or to Admin Blogs. :(

* P.S. Michael: your screenshot seems to show the snow falling in the correct area... I'd try your css suggestion first (since it's simpler to try), but I can't figure out which css file to add it to. Ugh, sorry to be so dense.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 12/22/17 09:00:58AM
douglas
@douglas
7 years ago
2,790 posts
It doesn't really matter what CSS file you put it in, totally up to you. I added it to my site.css file for my skin.

If you use my instructions, you won't need Michael's code.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Ok, i'll work on this tonight! :)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
Well, just to finish up on my fiddling around with this snow script on my Jamroom...
I tried Douglas' method but I came up against my own lack of skills in applying it, so I started over and undid everything.
Then i tried Michael's method again and applied his last code as well, for the 'relative block position'. This actually worked to center the snow in my About section at top of my main page.
So... I had the snow going in the area i wanted it!
However, I then ran into problems customizing the snow effects as per the instructions in the snow script itself. I understood their instructions. But could not turn off the damned mousefollow effect ("null" and "False" both did nothing), and the speed of the snow was also wildly fluctuating....was totally different every time I refreshed my browser page. Changing the numbers and values in the script the way they instructed didn't seem to do what it should. Couldn't get rid of the fact that moving my mouse to one side of my home page would create a 200mph blizard. Annoying as heck!! =8-0
Finally, I went to check out my snow on windows in browsers other than my usual Chrome. I found there was NO snow showing on either FF or Safari. Well that was the last straw. Pffft! At this point I'm dumping the whole thing.
Life is too short to spend five hours on trying to get some snowflakes that I'd have to remove after New Years anyway... I'd rather be eating chocolate pudding and watching a movie. L O L

But hey Douglas and Michael, THANK you for your time and energy in helping me with this- you did your part. I did learn a little something here and there while I fumbled about in the codes you gave me, and i got it work in the correct location.
I suspect the script may be outdated in some way as well, or won't play nice with some newer browsers.

We're supposed to get five inches of the REAL stuff....snow...tomorrow. So I'll be shoveling and will get sick of snowflakes by that time. ;)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015