<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Snowfall &#8211; AnonyViet &#8211; English Version</title>
	<atom:link href="https://en.anonyviet.com/tag/snowfall/feed/" rel="self" type="application/rss+xml" />
	<link>https://en.anonyviet.com</link>
	<description>The most popular website for sharing information technology, computer networks, and security knowledge. Stay up to date with the hottest news and tips</description>
	<lastBuildDate>Mon, 15 Dec 2025 21:24:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://en.anonyviet.com/wp-content/uploads/2023/01/cropped-ico-logo-75x75-1.png</url>
	<title>Snowfall &#8211; AnonyViet &#8211; English Version</title>
	<link>https://en.anonyviet.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Share Snowfall Code for Website to celebrate Christmas</title>
		<link>https://en.anonyviet.com/share-snowfall-code-for-website-to-celebrate-christmas/</link>
					<comments>https://en.anonyviet.com/share-snowfall-code-for-website-to-celebrate-christmas/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Mon, 15 Dec 2025 21:24:45 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[celebrate]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Snowfall]]></category>
		<category><![CDATA[Website]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=20977</guid>

					<description><![CDATA[Every Christmas, websites change their interface to respond to the festive atmosphere. One of the simplest but most effective highlights is Snowfall Effect. Join the channel Telegram belong to AnonyViet 👉 Link 👈 However, many old snowfall scripts often use heavy jQuery libraries or complex Canvas, causing the website to be slow and laggy on [&#8230;]]]></description>
										<content:encoded><![CDATA[
<div id="ftwp-postcontent">
<p>Every Christmas, websites change their interface to respond to the festive atmosphere. One of the simplest but most effective highlights is <strong>Snowfall Effect</strong>.</p>
<div align="center">
<table class="aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"> <span style="font-size: 12pt;"> <strong>Join the channel <span style="color: #0000ff;">Telegram</span> belong to <span style="color: #008080;">AnonyViet</span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietoffical" target="_blank" class="local-link">Link</a></span>  👈</strong> </span> </td>
</tr>
</tbody>
</table>
</div>
<p>However, many old snowfall scripts often use heavy jQuery libraries or complex Canvas, causing the website to be slow and laggy on phones. In this article, I will share the passage <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2F%3Fs%3Dcode%2Btuy%25E1%25BA%25BFt%2Br%25C6%25A1i" class="local-link">snowfall code</a> use <strong>CSS3 Animation and Vanilla JavaScript</strong> (pure JS). Ensure 3 criteria: <strong>Super light &#8211; No lag &#8211; Easy to install</strong>.</p>
<h2 id="ftoc-uu-diem-code-tuyet-roi-cho-website-don-giang-sinh" class="ftwp-heading">Advantages of snowfall code for Christmas website</h2>
<ul>
<li><strong>Performance optimization:</strong> Use <code>CSS Keyframes</code> to create movement instead of continuously calculating positions using JS, which reduces CPU load.</li>
<li><strong>Do not block interactions:</strong> Attribute processed <code>pointer-events: none</code>helping users still click on links/buttons under the snow without getting stuck.</li>
<li><strong>Highly customizable:</strong> Easily adjust the amount of snow, falling speed and snowflake shape.</li>
</ul>
<h2 id="ftoc-full-code-hieu-ung-tuyet-roi-html-css-js" class="ftwp-heading">Full Code of falling snow effect (HTML/CSS/JS)</h2>
<p><img post-id="20977" fifu-featured="1" fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-97009" src="https://anonyviet.com/wp-content/uploads/2025/12/cdoe-tuyet-trang-trang-tri-website.png" alt="Share Snowfall Code for Website to celebrate Christmas" title="Share Snowfall Code for Website to celebrate Christmas" width="748" height="443" title="Share Snowfall Code for Christmas Website 7" srcset="https://anonyviet.com/wp-content/uploads/2025/12/cdoe-tuyet-trang-trang-tri-website.png 748w, https://anonyviet.com/wp-content/uploads/2025/12/cdoe-tuyet-trang-trang-tri-website-300x178.png 300w" sizes="(max-width: 748px) 100vw, 748px"/></p>
<p>Below is the full code. You don&#8217;t need to download cumbersome files, just copy and paste.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">      &#13;
&#13;
<script><![CDATA[
  (function() {
    var snowflakes = [],
        browserWidth, browserHeight,
        numberOfSnowflakes = 50, // S&#7889; l&#432;&#7907;ng b&ocirc;ng tuy&#7871;t
        resetPosition = false;

    function setup() {
        window.addEventListener("DOMContentLoaded", generateSnowflakes, false);
        window.addEventListener("resize", setResetFlag, false);
    }

    function setResetFlag(e) {
        resetPosition = true;
    }

    function generateSnowflakes() {

        var originalSnowflake = document.createElement("div");
        originalSnowflake.classList.add("snowflake");
        originalSnowflake.innerHTML = "&#10052;"; 
        originalSnowflake.style.fontSize = "20px"; // K&iacute;ch th&#432;&#7899;c c&#417; b&#7843;n

        var snowflakeContainer = document.body;
        
        browserWidth = document.documentElement.clientWidth;
        browserHeight = document.documentElement.clientHeight;

        for (var i = 0; i < numberOfSnowflakes; i++) {
            var snowflakeClone = originalSnowflake.cloneNode(true);
            snowflakeContainer.appendChild(snowflakeClone);

            var initialX = Math.floor(Math.random() * browserWidth);
            var fallDuration = Math.floor(Math.random() * 10) + 5 + "s";
            var snowflakeSize = Math.floor(Math.random() * 20) + 10 + "px"; // Random k&iacute;ch th&#432;&#7899;c
            var delay = Math.floor(Math.random() * 5) + "s";

            snowflakeClone.style.left = initialX + "px";
            snowflakeClone.style.animationDuration = fallDuration;
            snowflakeClone.style.fontSize = snowflakeSize;
            snowflakeClone.style.animationDelay = delay;
            snowflakeClone.style.opacity = Math.random(); // &#272;&#7897; m&#7901; ng&#7851;u nhi&ecirc;n
        }
    }
    setup();
  })();
]]&gt;</script></pre>
<p>To change the color of the snow, change the color code in the line <code>color: #F527E4;</code></p>
<h2 id="ftoc-full-code-hieu-ung-tuyet-roi-co-dong-tuyet-o-chan-trang" class="ftwp-heading">Full Code for snowfall effect with snow cave at the footer</h2>
<p><img decoding="async" class="aligncenter size-full wp-image-97008" src="https://anonyviet.com/wp-content/uploads/2025/12/code-tuyet-roi-ngung-dong-chan-trang.png" alt="The code is great, it's the source of the page" width="775" height="720" title="Share Snowfall Code for Christmas Website 8" srcset="https://anonyviet.com/wp-content/uploads/2025/12/code-tuyet-roi-ngung-dong-chan-trang.png 775w, https://anonyviet.com/wp-content/uploads/2025/12/code-tuyet-roi-ngung-dong-chan-trang-300x279.png 300w, https://anonyviet.com/wp-content/uploads/2025/12/code-tuyet-roi-ngung-dong-chan-trang-768x713.png 768w, https://anonyviet.com/wp-content/uploads/2025/12/code-tuyet-roi-ngung-dong-chan-trang-750x697.png 750w" sizes="(max-width: 775px) 100vw, 775px"/></p>
<p data-path-to-node="11"><i>This is an enhanced version using HTML5 Canvas. This effect will allow snow to fall and collect at the base of the site. Over time, the layer of snow will thicken and can cover the screen like a real blizzard.</i></p>
<blockquote data-path-to-node="13">
<p data-path-to-node="13,0">The effect of snow accumulation will be <b>obscure content</b> your website from bottom to top. Please consider carefully before using it for sales pages because customers may not see the &#8220;Buy now&#8221; button or Footer. You can adjust variables <code>maxSnowHeight</code> in the code to limit the height of the snow (for example, only make it 100px high and then stop).</p>
</blockquote>
<hr data-path-to-node="14"/>
<h3 id="ftoc-giai-thich-cac-thong-so-trong-code-de-ban-tuy-chinh" class="ftwp-heading" data-path-to-node="15">Explanation of the parameters in the code for you to customize:</h3>
<ul>
<li data-path-to-node="16,0,0"><code>maxSnowHeight = height;</code>: The snow will rise until it fills the screen (full screen). If you just want it to rise a little and then stop (so as not to cover the web), change it to a specific number of pixels, e.g. <code>maxSnowHeight = 150;</code>.</li>
<li data-path-to-node="16,1,0"><code>snowflakeCount = 200;</code>: Number of falling snowflakes. Increasing it makes it thicker, but a weak device can lag.</li>
<li data-path-to-node="16,2,0"><code>snowPile</code>: This is a technical piece to save a “topographic map” of the bottom layer of snow.</li>
</ul>
<pre class="EnlighterJSRAW" data-enlighter-language="generic"><canvas id="snowCanvas" style="position: fixed; top: 0; left: 0; z-index: 99999; pointer-events: none;"/>&#13;
&#13;
<script><![CDATA[
(function() {
    var canvas = document.getElementById('snowCanvas');
    if (!canvas) { console.error("Kh&ocirc;ng t&igrave;m th&#7845;y th&#7867; canvas"); return; }
    
    var ctx = canvas.getContext('2d');
    var width = window.innerWidth;
    var height = window.innerHeight;
    
    // --- C&#7844;U H&Igrave;NH ---
    var maxSnowHeight = 200;    // &#272;&#7897; cao t&#7889;i &#273;a tuy&#7871;t &#273;&#7885;ng (pixel)
    var snowflakeCount = 200;   // S&#7889; l&#432;&#7907;ng h&#7841;t tuy&#7871;t
    var snowColor = "#ADD8E6";  // M&agrave;u tuy&#7871;t (Xanh nh&#7841;t &#273;&#7875; d&#7877; test, mu&#7889;n tr&#7855;ng s&#7917;a th&agrave;nh #FFFFFF)
    // ----------------
    
    canvas.width = width;
    canvas.height = height;

    var snowflakes = [];
    var snowPile = new Array(width).fill(0); 

    // H&agrave;m t&#7841;o l&#7841;i h&#7841;t tuy&#7871;t khi r&#417;i xu&#7889;ng ho&#7863;c m&#7899;i b&#7855;t &#273;&#7847;u
    function resetSnowflake(flake) {
        flake.x = Math.floor(Math.random() * width);
        flake.y = Math.floor(Math.random() * -height); 
        flake.size = Math.random() * 3 + 2; 
        flake.speed = (Math.random() * 1) + 1.5; // T&#7889;c &#273;&#7897; r&#417;i
        flake.velY = flake.speed;
        flake.velX = 0;
        flake.opacity = (Math.random() * 0.5) + 0.3;
    }

    // Kh&#7903;i t&#7841;o c&aacute;c h&#7841;t tuy&#7871;t
    function init() {
        snowflakes = [];
        for (var i = 0; i < snowflakeCount; i++) {
            var flake = {};
            resetSnowflake(flake);
            snowflakes.push(flake);
        }
        // G&#7884;I H&Agrave;M UPDATE &#272;&#7874; B&#7854;T &#272;&#7846;U CH&#7840;Y
        update();
    }

    // V&ograve;ng l&#7863;p chuy&#7875;n &#273;&#7897;ng
    function update() {
        ctx.clearRect(0, 0, width, height);

        // 1. V&#7869; &#273;&#7889;ng tuy&#7871;t t&iacute;ch t&#7909; d&#432;&#7899;i &#273;&aacute;y
        ctx.fillStyle = snowColor;
        ctx.beginPath();
        ctx.moveTo(0, height);
        for (var x = 0; x < width; x++) {
            ctx.lineTo(x, height - snowPile[x]);
        }
        ctx.lineTo(width, height);
        ctx.fill();

        // 2. V&#7869; v&agrave; c&#7853;p nh&#7853;t b&ocirc;ng tuy&#7871;t &#273;ang r&#417;i
        for (var i = 0; i < snowflakes.length; i++) {
            var f = snowflakes[i];

            f.x += Math.sin(f.y * 0.05) * 0.5; // L&#7855;c l&#432; nh&#7865;
            f.y += f.velY;

            var currentX = Math.floor(f.x);
            if (currentX < 0) currentX = 0;
            if (currentX >= width) currentX = width - 1;

            // Ki&#7875;m tra va ch&#7841;m v&#7899;i &#273;&#7889;ng tuy&#7871;t
            var pileHeight = snowPile[currentX];
            
            if (f.y >= height - pileHeight) {
                // T&iacute;ch t&#7909; tuy&#7871;t n&#7871;u ch&#432;a v&#432;&#7907;t qu&aacute; gi&#7899;i h&#7841;n
                if (pileHeight < maxSnowHeight) {
                    var range = 3; 
                    for(var k = -range; k <= range; k++) {
                        var neighborX = currentX + k;
                        if(neighborX >=0 && neighborX < width) {
                             snowPile[neighborX] += f.size * 0.3; 
                        }
                    }
                }
                resetSnowflake(f); // T&#7841;o l&#7841;i h&#7841;t m&#7899;i t&#7915; tr&ecirc;n cao
            }

            // V&#7869; b&ocirc;ng tuy&#7871;t &#273;&#417;n l&#7867;
            ctx.fillStyle = snowColor;
            ctx.globalAlpha = f.opacity; // &#272;&#7897; trong su&#7889;t
            ctx.beginPath();
            ctx.arc(f.x, f.y, f.size, 0, Math.PI * 2);
            ctx.fill();
            ctx.globalAlpha = 1; // Reset l&#7841;i alpha
        }
        
        requestAnimationFrame(update);
    }

    // X&#7917; l&yacute; khi resize m&agrave;n h&igrave;nh
    window.addEventListener('resize', function() {
        width = window.innerWidth;
        height = window.innerHeight;
        canvas.width = width;
        canvas.height = height;
        snowPile = new Array(width).fill(0); // Reset tuy&#7871;t &#273;&#7885;ng khi resize &#273;&#7875; tr&aacute;nh l&#7895;i hi&#7875;n th&#7883;
    });

    init();
})();
]]&gt;</script></pre>
<h2 id="ftoc-huong-dan-them-code-tuyet-roi-website-code-tay-html-php" class="ftwp-heading">Additional instructions for Snowfall Code Website Manual Code (HTML/PHP)</h2>
<p>For self-coded websites or other open source code (Laravel, CodeIgniter&#8230;), you do the following:</p>
<ol>
<li>Open the file <strong>footer</strong> of the interface (usually <code>footer.php</code>, <code>footer.html</code> or main layout file).</li>
<li>Find the closing tag <code/></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/share-snowfall-code-for-website-to-celebrate-christmas/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2025/12/cdoe-tuyet-trang-trang-tri-website.png" medium="image"></media:content>
            	</item>
	</channel>
</rss>
