GoPro Hero 9 (Black) | Combo 4 | Chính hãng
            
        
        
        Giá giao động:
                 12,480,000đ
        
        
            
        
     
 
    
    
        
            
Camera Insta360 GO 3 | Chính hãng (128GB)
            
        
        
        Giá giao động:
                 11,520,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 ONE R Aerial Edition for Mavic Pro | Chính hãng
            
        
        
        Giá giao động:
                 12,689,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 ONE R Aerial Edition for Mavic 2 | Chính hãng
            
        
        
        Giá giao động:
                 12,689,000đ
        
        
            
        
     
 
    
    
        
            
DJI OSMO POCKET 2 COMBO
            
        
        
        Giá giao động:
                 11,700,000đ
        
        
            
        
     
 
    
    
        
            
GoPro Hero 11 Black Combo 1 Chính Hãng
            
        
        
        Giá giao động:
                 15,880,000đ
        
        
            
        
     
 
    
    
        
            
DJI Pocket 2 Combo | Chính hãng
            
        
        
        Giá giao động:
                 12,380,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 ONE RS Twin Edition
            
        
        
        Giá giao động:
                 13,890,000đ
        
        
            
        
     
 
    
    
        
            
DJI RoboMaster S1 | Chính Hãng
            
        
        
        Giá giao động:
                 14,980,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 ONE RS 1-Inch 360 Edition
            
        
        
        Giá giao động:
                 20,550,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 ONE R 1-Inch Edition | Chính hãng
            
        
        
        Giá giao động:
                 12,380,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 X4 (One X4)
            
        
        
        Giá giao động:
                 13,290,000đ
        
        
            
        
     
 
    
    
        
            
DJI OSMO POCKET 3 COMBO
            
        
        
        Giá giao động:
                 15,790,000đ
        
        
            
        
     
 
    
    
 
    
    
        
            
CAMERA INSTA360 GO 3S 128GB (MIDNIGHT BLACK)
            
        
        
        Giá giao động:
                 11,590,000đ
        
        
            
        
     
 
    
    
        
            
Insta360 ONE R 4K Edition | Chính hãng
            
        
        
        Giá giao động:
                 6,989,000đ
        
        
            
        
     
 
    
    
        
            
Camera GoPro Hero 10 Black (Basic)
            
        
        
        Giá giao động:
                 8,680,000đ
        
        
            
        
     
 
    
    
        
            
GoPro Hero 9 (Black) | Combo 3 | Chính hãng
            
        
        
        Giá giao động:
                 11,740,000đ
        
        
            
        
     
 
    
    
        
            
GoPro Hero 9 (Black) | Combo 5 | Chính hãng
            
        
        
        Giá giao động:
                 14,780,000đ
        
        
            
        
     
 
    
    
        
            
Camera Insta360 GO 2 | Chính hãng (32GB)
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
GOPRO MAX 360
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
GOPRO HERO 6 BLACK
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
GOPRO HERO 5 BLACK
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
Insta360 Flow Standalone (Gray)
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
CAMERA HÀNH TRÌNH SONY HDR-X1000V
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
Máy Quay Sony Action Cam HDR-AS300R
            
        
        
         Giá từ: 
                             2,990,000đ
        
        
            
        
     
 
    
    
        
            
MÁY QUAY NIKON KEYMISSION 360
            
        
        
         Giá từ: 
                             2,990,000đ
        
        
            
        
     
 
    
    
        
            
DJI OSMO POCKET 3
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
DJI Osmo 360 Adventure Combo - Chính Hãng
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
    
    
        
            
Camera Insta360 ONE X2 | Chính hãng
            
        
        
        
                
                    Vui lòng gọi
                
        
        
            
        
     
 
             
            
                
            
         
        
        
     
    
    
    
	GoPro Hero 11 Black Chính Hãng
	Sony RX0 | Chính hãng
	Camera Insta360 GO 2 | Chính hãng (64GB)
	DJI Osmo Pocket Gimbal - Refurbished | Chính hãng
	Combo GoPro Max 360 | Chính hãng FPT
	GoPro Hero 7 Sliver | Chính Hãng
	Hero 10 Black Bones | Chính hãng
	GoPro Hero 7 Black Chính Hãng
	GoPro Hero 7 Bundle | Chính hãng FPT
	GoPro Hero 7 Black kèm thẻ nhớ 64gb 160Mb/s | Chính hãng FPT
	Gopro Hero 8 Black | Chính hãng FPT
	Insta360 GO Ultra Creator Bundle ( Arctic White )
	Insta360 GO Ultra Creator Bundle ( Midnight Black )
	DJI ACTION 2 (POWER COMBO)
	GoPro Hero 11 Black Mini
	Action Camera Insta360 GO 3S Standalone Camera Arctic White 64GB
	Action Camera Insta360 GO 3S Standalone Camera Midnight Black 64GB
	DJI Osmo Action 4 Standard Combo
	Action Camera Insta360 GO 3S Standalone Camera Arctic White 128GB
	Action Camera Insta360 GO 3S Standalone Camera Midnight Black 128GB
	GOPRO HERO 12 BLACK
	DJI Osmo Action 3 Standard Combo
	DJI Osmo Action 4 Adventure Combo
	DJI Osmo Nano Standard Combo (64GB) | Chính hãng
	Máy ảnh 360 Ricoh THETA SC2 4K (White) | Chính hãng
	DJI Pocket 2 | Chính hãng
	Insta360 Ace Pro Standalone
	DJI Action 2 Dual-Screen Combo
	Camera GoPro Hero 10 Black (Combo 1)
	DJI Osmo Action 5 Pro Standard Combo
	Insta360 Ace Standalone
	DJI Osmo Nano Standard Combo (128GB) | Chính hãng
	Insta360 ONE R 360° Edition | Chính hãng
	GoPro Hero 13 Black
	Insta360 X3 (One X3)
	DJI Osmo Action 3 Adventure Combo
	GoPro HERO 9 Black | Chính hãng
	Action Camera Insta360 Ace Pro 2
	Camera Insta360 GO 3 | Chính hãng (64GB)
	Action Camera Insta360 GO 3S Standard Edition Arctic White 64GB
	Action Camera Insta360 GO 3S Standard Edition Midnight Black 64GB
	Camera Insta360 Sphere
	DJI Pocket 2 Exclusive Combo Sunset White
	Action Camera Insta360 Ace Pro 2 Dual Battery Standard Bundle
	Action Camera Insta360 GO 3S Standard Edition Arctic White 128GB
	Action Camera Insta360 GO 3S Standard Edition Midnight Black 128GB
	Gopro Hero 11 Black Nhập Khẩu
	Osmo Action 5 Pro Adventure Combo
	Action Camera Insta360 GO Ultra Standard Bundle (Arctic White)
	Action Camera Insta360 GO Ultra Standard Bundle (Midnight Black)
	Insta360 ONE R Twin Edition | Chính hãng
	Action Camera Insta360 X4 Standard Bundle
	Action Camera Insta360 X5 Standard Bundle
	Insta360 X5 Satin White Limited Edition
	Insta360 Ace Pro 2 MM93 Edition
	Insta360 X5 BMW Motorrad Edition
	Action Camera Insta360 X5 Essentials Bundle
	Insta360 Pro 2 | Chính hãng
	Camera Insta360 Titan 11K Cinematic 360/VR | Chính Hãng
	DJI Action 2 Power Combo
    (function () {
        const requestAnimFrame = (function () {
            return window.requestAnimationFrame ||
                window.webkitRequestAnimationFrame ||
                window.mozRequestAnimationFrame ||
                function (callback) {
                    window.setTimeout(callback, 1000 / 60);
                };
        })();
        const hieuUngPhaoHoa = {
            canvas: document.getElementById('hieuUngPhaoHoa__canvas'),
            ctx: null,
            cw: window.innerWidth,
            ch: window.innerHeight,
            fireworks: [],
            particles: [],
            colors: [0, 60, 300], // Mảng các màu
            hue: 0,
            timerTotal: 30, // Giảm thời gian giữa các lần bắn
            timerTick: 0,
            isActive: true, // Biến để kiểm soát trạng thái hoạt động
            init: function () {
                this.ctx = this.canvas.getContext('2d');
                this.canvas.width = this.cw;
                this.canvas.height = this.ch;
                this.loop();
                // Tự động dừng sau 5 giây
                setTimeout(() => {
                    this.isActive = false;
                }, 5000);
            },
            calculateDistance: function (p1x, p1y, p2x, p2y) {
                const xDistance = p1x - p2x;
                const yDistance = p1y - p2y;
                return Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));
            },
            random: function (min, max) {
                return Math.random() * (max - min) + min;
            },
            createParticles: function (x, y) {
                let particleCount = 30;
                // Chọn màu ngẫu nhiên từ mảng
                this.hue = this.colors[Math.floor(Math.random() * this.colors.length)];
                while (particleCount--) {
                    this.particles.push(new Particle(x, y, this));
                }
            },
            // Main loop
            loop: function () {
                if (!this.isActive && this.fireworks.length === 0 && this.particles.length === 0) {
                    return; // Dừng animation khi hết pháo hoa
                }
                requestAnimFrame(this.loop.bind(this));
                this.hue += 0.5;
                this.ctx.globalCompositeOperation = 'destination-out';
                this.ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
                this.ctx.fillRect(0, 0, this.cw, this.ch);
                this.ctx.globalCompositeOperation = 'lighter';
                let i = this.fireworks.length;
                while (i--) {
                    this.fireworks[i].draw();
                    this.fireworks[i].update(i);
                }
                i = this.particles.length;
                while (i--) {
                    this.particles[i].draw();
                    this.particles[i].update(i);
                }
                // Tự động bắn pháo hoa nếu đang hoạt động
                if (this.isActive && this.timerTick >= this.timerTotal) {
                    this.fireworks.push(new Firework(
                        this.cw / 2, this.ch,
                        this.random(0, this.cw),
                        this.random(0, this.ch / 2),
                        this
                    ));
                    this.timerTick = 0;
                } else {
                    this.timerTick++;
                }
            }
        };
        // Firework class
        class Firework {
            constructor(sx, sy, tx, ty, main) {
                this.main = main;
                this.x = sx;
                this.y = sy;
                this.sx = sx;
                this.sy = sy;
                this.tx = tx;
                this.ty = ty;
                this.distanceToTarget = main.calculateDistance(sx, sy, tx, ty);
                this.distanceTraveled = 0;
                this.coordinates = [];
                this.coordinateCount = 3;
                while (this.coordinateCount--) {
                    this.coordinates.push([this.x, this.y]);
                }
                this.angle = Math.atan2(ty - sy, tx - sx);
                this.speed = 2;
                this.acceleration = 1.05;
                this.brightness = main.random(50, 70);
                this.targetRadius = 1;
            }
            update(index) {
                this.coordinates.pop();
                this.coordinates.unshift([this.x, this.y]);
                if (this.targetRadius < 8) {
                    this.targetRadius += 0.3;
                } else {
                    this.targetRadius = 1;
                }
                this.speed *= this.acceleration;
                const vx = Math.cos(this.angle) * this.speed;
                const vy = Math.sin(this.angle) * this.speed;
                this.distanceTraveled = this.main.calculateDistance(
                    this.sx, this.sy, this.x + vx, this.y + vy
                );
                if (this.distanceTraveled >= this.distanceToTarget) {
                    this.main.createParticles(this.tx, this.ty);
                    this.main.fireworks.splice(index, 1);
                } else {
                    this.x += vx;
                    this.y += vy;
                }
            }
            draw() {
                this.main.ctx.beginPath();
                this.main.ctx.moveTo(
                    this.coordinates[this.coordinates.length - 1][0],
                    this.coordinates[this.coordinates.length - 1][1]
                );
                this.main.ctx.lineTo(this.x, this.y);
                this.main.ctx.strokeStyle = `hsl(${this.main.hue}, 100%, ${this.brightness}%)`;
                this.main.ctx.stroke();
            }
        }
        // Particle class
        class Particle {
            constructor(x, y, main) {
                this.main = main;
                this.x = x;
                this.y = y;
                this.coordinates = [];
                this.coordinateCount = 5;
                while (this.coordinateCount--) {
                    this.coordinates.push([this.x, this.y]);
                }
                this.angle = main.random(0, Math.PI * 2);
                this.speed = main.random(1, 10);
                this.friction = 0.95;
                this.gravity = 1;
                this.hue = main.random(main.hue - 20, main.hue + 20);
                this.brightness = main.random(50, 80);
                this.alpha = 1;
                this.decay = main.random(0.015, 0.03);
            }
            update(index) {
                this.coordinates.pop();
                this.coordinates.unshift([this.x, this.y]);
                this.speed *= this.friction;
                this.x += Math.cos(this.angle) * this.speed;
                this.y += Math.sin(this.angle) * this.speed + this.gravity;
                this.alpha -= this.decay;
                if (this.alpha <= this.decay) {
                    this.main.particles.splice(index, 1);
                }
            }
            draw() {
                this.main.ctx.beginPath();
                this.main.ctx.moveTo(
                    this.coordinates[this.coordinates.length - 1][0],
                    this.coordinates[this.coordinates.length - 1][1]
                );
                this.main.ctx.lineTo(this.x, this.y);
                this.main.ctx.strokeStyle = `hsla(${this.hue}, 100%, ${this.brightness}%, ${this.alpha})`;
                this.main.ctx.stroke();
            }
        }
        // Khởi chạy khi trang load xong
        //window.addEventListener('load', () => hieuUngPhaoHoa.init());
    })();