• Kiến thức
  • Network
  • Security
  • Software
  • Thủ thuật
  • Tin học văn phòng
  • Tin tức
  • Mail ảo tạm thời miễn phí
  • Tools tra cứu thông tin
  • Công cụ đổi số thành chữ
  • AI Text Watermark Remover
AnonyViet
  • Tin tức
  • Network
    • Mạng cơ bản
    • Hyper-V
    • Linux
    • Windown Server 2012
  • Security
    • Basic Hacking
    • Deface
    • Kali Linux / Parrot
    • SQL Injection
  • Thủ thuật
    • Khóa Học Miễn Phí
    • Code
    • Mẹo Vặt Máy Tính
    • Facebook
    • Windows 7/8/10/11
    • Đồ Họa
    • Video
  • Software
    • Phần mềm máy tính
    • Phần mềm điện thoại
  • Tin học văn phòng
  • Kiến thức
  • MMO
    • Advertisers – Publishers
    • Affiliate Program
    • Kiếm tiền bằng điện thoại
    • Pay Per Click – PPC
No Result
View All Result
  • Tin tức
  • Network
    • Mạng cơ bản
    • Hyper-V
    • Linux
    • Windown Server 2012
  • Security
    • Basic Hacking
    • Deface
    • Kali Linux / Parrot
    • SQL Injection
  • Thủ thuật
    • Khóa Học Miễn Phí
    • Code
    • Mẹo Vặt Máy Tính
    • Facebook
    • Windows 7/8/10/11
    • Đồ Họa
    • Video
  • Software
    • Phần mềm máy tính
    • Phần mềm điện thoại
  • Tin học văn phòng
  • Kiến thức
  • MMO
    • Advertisers – Publishers
    • Affiliate Program
    • Kiếm tiền bằng điện thoại
    • Pay Per Click – PPC
No Result
View All Result
AnonyViet
No Result
View All Result

Code Tạo Pháo Hoa Cho Website Trang Trí Tết

AnonyViet by AnonyViet
27/01/2016 - Updated on 26/12/2019
in Code
A A
6

   Ngày tết gần đến rồi, ắt hẵn những bạn làm Webiste đều muốn trang trí cho ngôi nhà thứ 2 của mình thêm lộng lẫy lung linh huyền ảo. Hôm này mình sẽ hướng dẫn cho các bạn cách tạo pháo hoa để tạo không khí tết cho Webiste nhé.

📢 Tham gia kênh Telegram của AnonyViet
👉 Vào Telegram AnonyViet
Cập nhật bài mới, tools hay và thủ thuật IT nhanh nhất

Bước 1: Trước tiên bạn cần tạo 1 file tên phaohoa.js, nội dung code copy ở dưới nhé (có thể dùng notepad). Rồi up lên Hosting

Các bài viết liên quan

Security Audit Skill

Quét lỗ hổng bảo mật cho Vide Coding bằng Security Audit Skill

27/10/2026
cách nhận gói Booster trị giá 100$ trên Rocket

Nhận gói 100$ trên Rocket để Vide Coding – Tạo Website bằng AI

14/03/2026
lovable pro 3 thang code

Cách nhận Lovable Pro 3 tháng miễn phí – Tạo Website bằng AI

29/12/2025
cdoe tuyet trang trang tri website

Chia sẻ Code tuyết rơi cho Website đón Giáng Sinh

16/12/2025

Hoặc bạn có thể tải về theo link: https://anonyviet.com/resource/phaohoa/phaohoa.js

// <![CDATA[
var bits=80; // how many bits
var speed=33; // how fast - smaller is faster
var bangs=5; // how many can be launched simultaneously (note that using too many can slow the script down)
var colours=new Array("#03f", "#f03", "#0e0", "#93f", "#0cf", "#f93", "#f0c"); 
//                     blue    red     green   purple  cyan    orange  pink

/****************************
*      Fireworks Effect     *
*(c)2004-14 mf2fm web-design*
*  http://www.mf2fm.com/rv  *
* DON'T EDIT BELOW THIS BOX *
****************************/
var bangheight=new Array();
var intensity=new Array();
var colour=new Array();
var Xpos=new Array();
var Ypos=new Array();
var dX=new Array();
var dY=new Array();
var stars=new Array();
var decay=new Array();
var swide=1000;
var shigh=600;
var boddie;

if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) {
  var oldonload=window.onload;
  if (typeof(oldonload)!='function') window.onload=funky;
  else window.onload=function() {
    if (oldonload) oldonload();
    funky();
  }
}

addRVLoadEvent(light_blue_touchpaper);

function light_blue_touchpaper() { if (document.getElementById) {
  var i;
  boddie=document.createElement("div");
  boddie.style.position="fixed";
  boddie.style.top="0px";
  boddie.style.left="0px";
  boddie.style.overflow="visible";
  boddie.style.zIndex = '9999';
  boddie.style.width="1px";
  boddie.style.height="1px";
  boddie.style.backgroundColor="transparent";
  document.body.appendChild(boddie);
  set_width();
  for (i=0; i<bangs; i++) {
    write_fire(i);
    launch(i);
    setInterval('stepthrough('+i+')', speed);
  }
}}

function write_fire(N) {
  var i, rlef, rdow;
  stars[N+'r']=createDiv('|', 12);
  boddie.appendChild(stars[N+'r']);
  for (i=bits*N; i<bits+bits*N; i++) {
    stars[i]=createDiv('*', 13);
    boddie.appendChild(stars[i]);
  }
}

function createDiv(char, size) {
  var div=document.createElement("div");
  div.style.font=size+"px monospace";
  div.style.position="absolute";
  div.style.zIndex = '9999';
  div.style.backgroundColor="transparent";
  div.appendChild(document.createTextNode(char));
  return (div);
}

function launch(N) {
  colour[N]=Math.floor(Math.random()*colours.length);
  Xpos[N+"r"]=swide*0.5;
  Ypos[N+"r"]=shigh-5;
  bangheight[N]=Math.round((0.5+Math.random())*shigh*0.4);
  dX[N+"r"]=(Math.random()-0.5)*swide/bangheight[N];
  if (dX[N+"r"]>1.25) stars[N+"r"].firstChild.nodeValue="/";
  else if (dX[N+"r"]<-1.25) stars[N+"r"].firstChild.nodeValue="\\";
  else stars[N+"r"].firstChild.nodeValue="|";
  stars[N+"r"].style.color=colours[colour[N]];
}

function bang(N) {
  var i, Z, A=0;
  for (i=bits*N; i<bits+bits*N; i++) { 
    Z=stars[i].style;
    Z.left=Xpos[i]+"px";
    Z.top=Ypos[i]+"px";
    if (decay[i]) decay[i]--;
    else A++;
    if (decay[i]==15) Z.fontSize="7px";
    else if (decay[i]==7) Z.fontSize="2px";
    else if (decay[i]==1) Z.visibility="hidden";
	if (decay[i]>1 && Math.random()<.1) {
	   Z.visibility="hidden";
	   setTimeout('stars['+i+'].style.visibility="visible"', speed-1);
	}
    Xpos[i]+=dX[i];
    Ypos[i]+=(dY[i]+=1.25/intensity[N]);

  }
  if (A!=bits) setTimeout("bang("+N+")", speed);
}

function stepthrough(N) { 
  var i, M, Z;
  var oldx=Xpos[N+"r"];
  var oldy=Ypos[N+"r"];
  Xpos[N+"r"]+=dX[N+"r"];
  Ypos[N+"r"]-=4;
  if (Ypos[N+"r"]<bangheight[N]) {
    M=Math.floor(Math.random()*3*colours.length);
    intensity[N]=5+Math.random()*4;
    for (i=N*bits; i<bits+bits*N; i++) {
      Xpos[i]=Xpos[N+"r"];
      Ypos[i]=Ypos[N+"r"];
      dY[i]=(Math.random()-0.5)*intensity[N];
      dX[i]=(Math.random()-0.5)*(intensity[N]-Math.abs(dY[i]))*1.25;
      decay[i]=16+Math.floor(Math.random()*16);
      Z=stars[i];
      if (M<colours.length) Z.style.color=colours[i%2?colour[N]:M];
      else if (M<2*colours.length) Z.style.color=colours[colour[N]];
      else Z.style.color=colours[i%colours.length];
      Z.style.fontSize="13px";
      Z.style.visibility="visible";
    }
    bang(N);
    launch(N);
  }
  stars[N+"r"].style.left=oldx+"px";
  stars[N+"r"].style.top=oldy+"px";
} 

window.onresize=set_width;
function set_width() {
  var sw_min=999999;
  var sh_min=999999;
  if (document.documentElement && document.documentElement.clientWidth) {
    if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth;
    if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight;
  }
  if (typeof(self.innerWidth)!="undefined" && self.innerWidth) {
    if (self.innerWidth>0 && self.innerWidth<sw_min) sw_min=self.innerWidth;
    if (self.innerHeight>0 && self.innerHeight<sh_min) sh_min=self.innerHeight;
  }
  if (document.body.clientWidth) {
    if (document.body.clientWidth>0 && document.body.clientWidth<sw_min) sw_min=document.body.clientWidth;
    if (document.body.clientHeight>0 && document.body.clientHeight<sh_min) sh_min=document.body.clientHeight;
  }
  if (sw_min==999999 || sh_min==999999) {
    sw_min=800;
    sh_min=600;
  }
  swide=sw_min;
  shigh=sh_min;
}
// ]]>

 

Bước 2: Chèn đoạn code dưới đây vào dưới thẻ <body> của trang Web

Lưu ý: src="https://websitecuaban.com/phaohoa.js"đây là đường dẫn của file phaohoa.js mà bạn up lên Website, nhớ thay đường dẫn cho đúng nhé.

<script src="https://websitecuaban.com/phaohoa.js"></script>
<script type="text/javascript">
var bgBegin = 22;
var bgEnd = 31;
var bgTetId = 31;
var bgTetUrl = '/banner/';
document.body.style.backgroundImage = 'url(' + bgTetUrl + bgTetId + '.jpg)';
document.body.style.backgroundAttachment = 'fixed';
document.body.style.backgroundSize = 'cover';
setInterval(function(){
	if (bgTetId == bgEnd) bgTetId = bgBegin;
	document.body.style.backgroundImage = 'url(' + bgTetUrl + bgTetId + '.jpg)';
	document.body.style.backgroundAttachment = 'fixed';
	document.body.style.backgroundSize = 'cover';
	bgTetId++;
}, 15000);
</script>

Bây giờ bạn có thể mở lại Website và nhấn F5 để refresh và thưởng thức nhé

Bạn có thể xem làm Website có ruồi chạy tại bài này

Tags: codejavascriptmãpháo hoa
AnonyViet

AnonyViet

20 năm kinh nghiệm trong lĩnh vực Security, các chứng chỉ:OSCP, CCNA, CCNP, CISSP. Kiến thức như một ngọn lửa, càng chia sẽ nó sẽ càng bùng cháy!

Related Posts

Security Audit Skill
Code

Quét lỗ hổng bảo mật cho Vide Coding bằng Security Audit Skill

27/10/2026
cách nhận gói Booster trị giá 100$ trên Rocket
Kiến thức

Nhận gói 100$ trên Rocket để Vide Coding – Tạo Website bằng AI

14/03/2026
lovable pro 3 thang code
Mẹo Vặt Máy Tính

Cách nhận Lovable Pro 3 tháng miễn phí – Tạo Website bằng AI

29/12/2025
cdoe tuyet trang trang tri website
Code

Chia sẻ Code tuyết rơi cho Website đón Giáng Sinh

16/12/2025
Cách Active Key Sublime Text 4 - Tải Sublime Text 4 Full Key 1
Phần mềm máy tính

Cách Active Key Sublime Text 4 – Tải Sublime Text 4 Full Key

23/05/2025 - Updated on 25/07/2025
vibde coding là gì
Kiến thức

Vibe Coding là gì?

14/05/2025 - Updated on 25/07/2025
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

6 Comments
oldest
newest
Lâm Trung Tính
Lâm Trung Tính
9 years ago

Hay lắm luôn Ad..Thanks nhé 😉

Reply
Nguyễn Lam
Nguyễn Lam
9 years ago

hay lắm ad :))

Reply
Blacknet
Blacknet
9 years ago

Hay lắm luôn Ad..Thanks nhé ?

Reply
Lâm Trung Tính
Lâm Trung Tính
9 years ago

Tết này sẽ sử dụng code của ad 🙂

Reply
NguyenHaSon-2006
NguyenHaSon-2006
9 years ago

hay lắm, thanks ad

Reply
Ryzen Threadripper
Ryzen Threadripper
6 years ago

Cảm ơn Admin rất nhiều~~~~

Reply
wpdiscuz   wpDiscuz

Liên hệ Quảng Cáo

Lien he AnonyViet

Bài viết mới

extension tìm vietsub trên Youtube

SubPeek – Extension tìm vietsub trên Youtube ngay trên thumbnail

by Thanh Kim
19/11/2026
0

Bé Vui Học

Bé Vui Học: Ứng dụng học chữ và toán lớp 1 cực hay cho bé

by Thanh Kim
18/11/2026
0

Google AI Ultra miễn phí

Hướng dẫn đăng ký Google AI Ultra miễn phí + Youtube Premium

by Thanh Kim
18/11/2026
0

cách tạo điện thoại Android ảo IP Mỹ

Cách tạo điện thoại Android ảo IP Mỹ miễn phí vĩnh viển

by Thanh Kim
17/11/2026
0

Bình luận gần đây

  • Thắng trong Hướng dẫn mua tên miền .com miễn phí trên Checkdomain
  • online photo storage services trong Hướng dẫn kiếm tiền từ Affiliate Temu đơn giản nhất
  • Alex trong Hướng dẫn mua tên miền .com miễn phí trên Checkdomain
  • Nam trong Cách cài đặt và kích hoạt Office 2024 LTSC miễn phí vĩnh viễn
  • Duc trong Trưa nay ăn gì: Web gợi ý món ăn cho dân văn phòng phong cách CS2
  • đạt trong [Update] Cách nhận Google AI Pro 1 năm miễn phí bằng Telegram
  • teo trong MiniTool Partition Wizard 12.6 Full Key – Phần mềm Quản lý Phân vùng tốt nhất
  • le trong MiniTool Partition Wizard 12.6 Full Key – Phần mềm Quản lý Phân vùng tốt nhất
  • Garbanta trong Hướng dẫn cách nhận 1 tỷ token Muse AI
  • Phúc an trong Cách tạo Pet ảo, nhân vật ảo chạy lung tung trên Desktop để thư giản
  • Hieu IT trong Hướng dẫn đăng ký tên miền .tech miễn phí 1 năm
  • Viet Dao Quoc trong Hướng dẫn nhận 3 tháng Shopee VIP từ Vinaphone giá 0 đồng
  • AnonyViet trong Hướng dẫn cách nhận 1 tỷ token Muse AI
  • Minh Cần trong Hướng dẫn cách nhận 1 tỷ token Muse AI
  • TextToSong trong Cách dùng Suno AI tạo bài hát hoàn chỉnh từ A đến Z chỉ trong 5 phút
  • Phương Phan trong Hướng dẫn dùng Uneed.vn để đánh giá kiến thức Online cho học sinh
  • Phạm Nhật trong Hướng dẫn dùng Uneed.vn để đánh giá kiến thức Online cho học sinh
  • tuan trong Share key Driver Booster 13 Pro miễn phí 2026
  • loc trong Hack Game & App trên Iphone với TutuApp
  • lâm trong Share key Advanced SystemCare 19 Pro 6 tháng mới nhất

Giới thiệu

AnonyViet

AnonyViet

Nơi chia sẻ những kiến thức mà bạn chưa từng được học trên ghế nhà trường!

Chúng tôi sẵn sàng đón những ý kiến đóng góp, cũng như bài viết của các bạn gửi đến AnonyViet.

Hãy cùng AnonyViet xây dựng một cộng đồng CNTT lớn mạnh nhất!

Liên hệ

Email: support[@]anonyviet.com

1409 Hill Street #01-01A
Old Hill Street Police Station
Singapore 179369

 

DMCA.com Protection Status

Giới thiệu

AnonyViet là Website chia sẻ miễn phí tất cả các kiến thức về công nghệ thông tin. AnonyViet cung cấp mọi giải pháp về mạng máy tính, phần mềm, đồ họa và MMO.

kết quả xổ số hôm nay đọc truyện dandadan online Xoilac TV bóng đá trực tiếp bóng đá trực tiếp cakhia tv trực tiếp bóng đá tối nay tải ebook free tỷ lệ nhà cái XOSO66 https://tylekeonhacai.me/ https://keonhacai.org.vc/ https://keonhacai88.tv/ https://keonhacai.loans/ https://keonhacai.kiwi/ xx88 Sun52 soxo66 nổ hũ uy tín https://pgp88.org/ luck8 luck8 58WIN Thabet 789club go88 vip66 xoso66 8day https://keonhacaitop.com/ kèo nhà cái 12bet Hitclub nhà cái MB66 Kèo nhà cái Rikvip Good88 GK88 6623 cakhiatv Fun88 Việt game nổ hũ JBO 789win tải sunwin thapcamtv Nohu90 trang chủ MB66 gowin xoilactv game bài https://f168.news/ https://keonhacai.cool/ V9bet xoilac truc tiep bong da twin68 kèo nhà cái 5 EE88 gowin https://tylekeonhacai.energy/ gavangtv xoilactv cakhiatv

©2026 AnonyViet - Chúng tôi mang đến cho bạn những kiến thức bổ ích về CNTT

No Result
View All Result
  • Tin tức
  • Network
    • Mạng cơ bản
    • Hyper-V
    • Linux
    • Windown Server 2012
  • Security
    • Basic Hacking
    • Deface
    • Kali Linux / Parrot
    • SQL Injection
  • Thủ thuật
    • Khóa Học Miễn Phí
    • Code
    • Mẹo Vặt Máy Tính
    • Facebook
    • Windows 7/8/10/11
    • Đồ Họa
    • Video
  • Software
    • Phần mềm máy tính
    • Phần mềm điện thoại
  • Tin học văn phòng
  • Kiến thức
  • MMO
    • Advertisers – Publishers
    • Affiliate Program
    • Kiếm tiền bằng điện thoại
    • Pay Per Click – PPC

©2026 AnonyViet - Chúng tôi mang đến cho bạn những kiến thức bổ ích về CNTT

wpDiscuz