Liferay DXP 2026.Q4    |    Release Webinar: 18 November 2026    |    Replay coming soon! 

Blogs

Real case fragment usage

How to create a Snow Flakes fragment in 30 minutes

Tshirt shop in winter with snow

Eric D
Eric D
阅读少于一分钟

Hello everybody,

A small post to explain how to create a vanilla javascript native fragment in Liferay in few minutes.

I want to create a small animation for this winter... a Snow Flakes animation on all of my site pages.

For this, I decide to create a fragment and put it on the master page of my site.


I simply go on github and find this repository :  https://github.com/le-pepe/snow-effect

With the associated Code Pen : https://codepen.io/codebubb/pen/LYqovoV

Here is the fragment I have created :

And after I have add some configurations :

{
    "fieldSets": [
        {
                    "fields": [
                 {
                     "dataType": "string",
                     "defaultValue": "100",
                     "label": "number-of-snow-flakes",
                     "name": "numberOfSnowFlakes",
                     "type": "text"
                 },
                 {
                     "dataType": "string",
                     "defaultValue": "5",
                     "label": "max-snow-flake-size",
                     "name": "maxSnowFlakeSize",
                     "type": "text"
                 },
                 {
                     "dataType": "string",
                     "defaultValue": "2",
                     "label": "max-snow-flake-speed",
                     "name": "maxSnowFlakeSpeed",
                     "type": "text"
                 },
                 {
                     "defaultValue": "#DDDDDD",
                     "label": "snow-flake-color",
                     "name": "snowFlakeColor",
                     "type": "colorPicker"
                 }
            ]
        }
    ]
}


And I put it on my master page and configure it :
 


 

 

That's all !

Enjoy, it is free (and the source using MIT Licence)
Eric

页面评论

Thanks for sharing! Looking forward to your next post.

Related Assets...

未找到结果

More Blog Entries...

Himanshu Chauhan
十一月 20, 2026
Tony Lim
十一月 19, 2026