Dumay Community


Komunitas Progaming, Software, Perbaikan Komputer, Gaming, Musik, dll
 
IndeksCalendarFAQPencarianAnggotaGroupPendaftaranLogin
Like Page
Tinggalkan Jempol Kalian di Forum INI


Login
Username:
Password:
Login otomatis: 
:: Lupa password?
User Yang Sedang Online
Total 1 user online :: 0 Terdaftar, 0 Tersembunyi dan 1 Tamu

Tidak ada

User online terbanyak adalah 10 pada Fri Aug 26, 2016 7:04 pm
Clock
Top posters
Admin
 
buginese
 
harex
 
suliswanto
 
Prisa
 
alijenggot
 
XXX
 
joecow
 
safana
 
ilmu komputer
 
Latest topics
» Kenalan Yuk Semua...
Wed Apr 30, 2014 10:33 am by Bagus Rio Dwi Mayvando

» Aplikasi Program TU Sekolah
Mon Apr 07, 2014 9:35 am by Admin

» ESET NOD32 Antivirus 5 Full Crak
Mon Apr 07, 2014 7:55 am by Admin

» Cara Install Anti Virus NOD32 Full Crak
Mon Apr 07, 2014 12:07 am by Admin

» Menampilkan File Flasdisk yang Terhiden
Sun Apr 06, 2014 8:53 pm by Admin

» bahasa pemprogaman Pascal
Thu Dec 19, 2013 11:13 pm by julpiyanur

» bahasa pemprogaman Pascal
Thu Dec 19, 2013 11:08 pm by julpiyanur

» bahasa pemprogaman Pascal
Thu Dec 19, 2013 11:06 pm by julpiyanur

» Membuat Folder Lock Sederhana
Sat Jun 22, 2013 10:12 am by DK.pujangga

My Banner
Kolom blog tutorial
Tukeran link yuuk..
Silahkan copas code dibawah ini,,



Share | 
 

 Membuat Kembang Api

Topik sebelumnya Topik selanjutnya Go down 
PengirimMessage
Admin
Admin
Admin
avatar

Posts : 179
Join date : 01.04.09
Age : 29
Location : Bumiku tercinta

PostSubyek: Membuat Kembang Api   Sun May 10, 2009 1:18 pm

////////////////////////////////////////////////////////////////
// Javascript made by Rasmus - http://www.peters1.dk //
////////////////////////////////////////////////////////////////

var FIRE_Path = "http://www.geocities.com/prywdy/sound/firework/"; // Path to the directory containing the firework-pictures
var FIRE_no = 10; // Numbers of Rockets in one firework
var FIRE_Pause = 5; // Pause between the fireworks in seconds
var FIRE_SameColor = false; // If true = The rockets have the same color in one firework

var FIRE_Time, FIRE_Bang, FIRE_Vindue_Width, FIRE_Vindue_Height;
var FIRE_PosLeft, FIRE_PosTop, FIRE_PosVenAfv, FIRE_PosTopAfv;
var i;
var FIRE_j = 0;

var FIRE_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
var FYR_browser_IE_SCM = (document.documentElement.clientHeight) ? 1 : 0;
var FIRE_browser_MOZ = (self.innerWidth) ? 1 : 0;

if (FIRE_browser_IE_NS)
{
FIRE_Vindue_Width = document.body.clientWidth;
FIRE_Vindue_Height = document.body.clientHeight;
}
else if (FYR_browser_IE_SCM)
{
FIRE_Vindue_Width = document.documentElement.clientWidth;
FIRE_Vindue_Height = document.documentElement.clientHeight;
}
else
{
FIRE_Vindue_Width = self.innerWidth - 20;
FIRE_Vindue_Height = self.innerHeight;
}

var FIRE_Top = 10;
var FIRE_Bot = FIRE_Vindue_Height - 40;
var FIRE_Mid = FIRE_Vindue_Width/2;

FIRE_PosLeft = new Array();
FIRE_PosTop = new Array();
FIRE_PosVenAfv = new Array();
FIRE_PosTopAfv = new Array();
FIRE_Time = new Array();
FIRE_TopBang = new Array();
FIRE_Billede = new Array();
FIRE_Farve = new Array("orange","blue","yellow","red","green");
FIRE_Pause = FIRE_Pause*1000;

for (i = 0; i < FIRE_no; ++ i)
{
FIRE_TopBang[i] = FIRE_Top + Math.random()*200;
FIRE_PosTop[i] = FIRE_Bot;
FIRE_PosTopAfv[i] = 0;
FIRE_PosLeft[i] = FIRE_Mid;
if (i % 2 == 0) FIRE_PosVenAfv[i] = 4*Math.random();
else FIRE_PosVenAfv[i] = Math.random()*(-4);
document.write("<\div id=\"FIRE_no"+ i +"\" style=\"position: absolute; font-size: 15px; z-index: "+ i +"; visibility: visible; top: "+FIRE_PosTop[i]+"px; left: "+FIRE_PosLeft[i]+"px;\">.<\/div>");
}


function FIRE_Op(FIRE_number)
{
if (FIRE_PosTop[FIRE_number] > (FIRE_Top + FIRE_TopBang[FIRE_number]))
{
FIRE_PosTop[FIRE_number] = FIRE_PosTop[FIRE_number] - FIRE_PosTopAfv[FIRE_number];
FIRE_PosLeft[FIRE_number] = FIRE_PosLeft[FIRE_number] + FIRE_PosVenAfv[FIRE_number];
FIRE_PosTopAfv[FIRE_number] = (FIRE_PosTop[FIRE_number]/40);
document.getElementById("FIRE_no"+FIRE_number).style.top=FIRE_PosTop[FIRE_number]+"px";
document.getElementById("FIRE_no"+FIRE_number).style.left=FIRE_PosLeft[FIRE_number]+"px";
FIRE_Time[i] = setTimeout("FIRE_Op("+FIRE_number+")",10);
}
else
{
clearTimeout("FIRE_Time["+FIRE_number+"]");
FIRE_ShowBang(FIRE_number);
}
}

function FIRE_Start()
{

if (FIRE_SameColor)
{
if (FIRE_j == 4) FIRE_j = 0;
else FIRE_j = FIRE_j + 1;
}

for (i = 0; i < FIRE_no; i++)
{
if (!FIRE_SameColor)
{
FIRE_j = Math.round(Math.random() * 4);
}
FIRE_Billede[i] = FIRE_Path+FIRE_Farve[FIRE_j]+".gif";
document.getElementById("FIRE_no"+i).innerHTML = "*";
document.getElementById("FIRE_no"+i).style.color=FIRE_Farve[FIRE_j];
setTimeout("FIRE_Op("+i+")",(1500*Math.random()));
}
}

function FIRE_ShowBang(FIRE_number)
{
if (FIRE_number == 0) document.getElementById("FIRE_no"+FIRE_number).innerHTML = "<\img src=\""+FIRE_Billede[FIRE_number]+"\" border=\"0\" />";
else document.getElementById("FIRE_no"+FIRE_number).innerHTML = "<\img src=\""+FIRE_Billede[FIRE_number]+"\" border=\"0\" />";
document.getElementById("FIRE_no"+FIRE_number).style.top=(FIRE_PosTop[FIRE_number] - 20)+"px";
document.getElementById("FIRE_no"+FIRE_number).style.left=(FIRE_PosLeft[FIRE_number] - 40)+"px";
setTimeout("FIRE_Reset("+FIRE_number+")",1000)
}

function FIRE_Reset(FIRE_number)
{
FIRE_TopBang[FIRE_number] = FIRE_Top + Math.random()*100;
FIRE_PosTop[FIRE_number] = FIRE_Bot;
FIRE_PosTopAfv[FIRE_number] = 4;
FIRE_PosLeft[FIRE_number] = FIRE_Mid;
if (FIRE_number % 2 == 0) FIRE_PosVenAfv[FIRE_number] = 4*Math.random();
else FIRE_PosVenAfv[FIRE_number] = Math.random()*(-4);

document.getElementById("FIRE_no"+FIRE_number).innerHTML = "";
document.getElementById("FIRE_no"+FIRE_number).style.top=FIRE_PosTop[FIRE_number]+"px";
document.getElementById("FIRE_no"+FIRE_number).style.left=FIRE_PosLeft[FIRE_number]+"px";

if (FIRE_number == FIRE_no-1) setTimeout("FIRE_Start()",FIRE_Pause);
}

FIRE_Start();

_________________
Sesuatu Akan Terasa Sangat Berharga, Apabila Sesuatu Itu Telah Pergi Dari Hidup Kita. Kesempurnaan Hanya Milik ALLAH Semata

Kembali Ke Atas Go down
Lihat profil user http://dumay.forum.st
hydays
Members
Members


Posts : 3
Join date : 02.11.09

PostSubyek: mbak q mau tanya nih. java scrips sama j2se tuh sama gak ya   Mon Nov 09, 2009 5:45 pm

Admin wrote:
////////////////////////////////////////////////////////////////
// Javascript made by Rasmus - http://www.peters1.dk //
////////////////////////////////////////////////////////////////

var FIRE_Path = "http://www.geocities.com/prywdy/sound/firework/"; // Path to the directory containing the firework-pictures
var FIRE_no = 10; // Numbers of Rockets in one firework
var FIRE_Pause = 5; // Pause between the fireworks in seconds
var FIRE_SameColor = false; // If true = The rockets have the same color in one firework

var FIRE_Time, FIRE_Bang, FIRE_Vindue_Width, FIRE_Vindue_Height;
var FIRE_PosLeft, FIRE_PosTop, FIRE_PosVenAfv, FIRE_PosTopAfv;
var i;
var FIRE_j = 0;

var FIRE_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
var FYR_browser_IE_SCM = (document.documentElement.clientHeight) ? 1 : 0;
var FIRE_browser_MOZ = (self.innerWidth) ? 1 : 0;

if (FIRE_browser_IE_NS)
{
FIRE_Vindue_Width = document.body.clientWidth;
FIRE_Vindue_Height = document.body.clientHeight;
}
else if (FYR_browser_IE_SCM)
{
FIRE_Vindue_Width = document.documentElement.clientWidth;
FIRE_Vindue_Height = document.documentElement.clientHeight;
}
else
{
FIRE_Vindue_Width = self.innerWidth - 20;
FIRE_Vindue_Height = self.innerHeight;
}

var FIRE_Top = 10;
var FIRE_Bot = FIRE_Vindue_Height - 40;
var FIRE_Mid = FIRE_Vindue_Width/2;

FIRE_PosLeft = new Array();
FIRE_PosTop = new Array();
FIRE_PosVenAfv = new Array();
FIRE_PosTopAfv = new Array();
FIRE_Time = new Array();
FIRE_TopBang = new Array();
FIRE_Billede = new Array();
FIRE_Farve = new Array("orange","blue","yellow","red","green");
FIRE_Pause = FIRE_Pause*1000;

for (i = 0; i < FIRE_no; ++ i)
{
FIRE_TopBang[i] = FIRE_Top + Math.random()*200;
FIRE_PosTop[i] = FIRE_Bot;
FIRE_PosTopAfv[i] = 0;
FIRE_PosLeft[i] = FIRE_Mid;
if (i % 2 == 0) FIRE_PosVenAfv[i] = 4*Math.random();
else FIRE_PosVenAfv[i] = Math.random()*(-4);
document.write("<\div id=\"FIRE_no"+ i +"\" style=\"position: absolute; font-size: 15px; z-index: "+ i +"; visibility: visible; top: "+FIRE_PosTop[i]+"px; left: "+FIRE_PosLeft[i]+"px;\">.<\/div>");
}


function FIRE_Op(FIRE_number)
{
if (FIRE_PosTop[FIRE_number] > (FIRE_Top + FIRE_TopBang[FIRE_number]))
{
FIRE_PosTop[FIRE_number] = FIRE_PosTop[FIRE_number] - FIRE_PosTopAfv[FIRE_number];
FIRE_PosLeft[FIRE_number] = FIRE_PosLeft[FIRE_number] + FIRE_PosVenAfv[FIRE_number];
FIRE_PosTopAfv[FIRE_number] = (FIRE_PosTop[FIRE_number]/40);
document.getElementById("FIRE_no"+FIRE_number).style.top=FIRE_PosTop[FIRE_number]+"px";
document.getElementById("FIRE_no"+FIRE_number).style.left=FIRE_PosLeft[FIRE_number]+"px";
FIRE_Time[i] = setTimeout("FIRE_Op("+FIRE_number+")",10);
}
else
{
clearTimeout("FIRE_Time["+FIRE_number+"]");
FIRE_ShowBang(FIRE_number);
}
}

function FIRE_Start()
{

if (FIRE_SameColor)
{
if (FIRE_j == 4) FIRE_j = 0;
else FIRE_j = FIRE_j + 1;
}

for (i = 0; i < FIRE_no; i++)
{
if (!FIRE_SameColor)
{
FIRE_j = Math.round(Math.random() * 4);
}
FIRE_Billede[i] = FIRE_Path+FIRE_Farve[FIRE_j]+".gif";
document.getElementById("FIRE_no"+i).innerHTML = "*";
document.getElementById("FIRE_no"+i).style.color=FIRE_Farve[FIRE_j];
setTimeout("FIRE_Op("+i+")",(1500*Math.random()));
}
}

function FIRE_ShowBang(FIRE_number)
{
if (FIRE_number == 0) document.getElementById("FIRE_no"+FIRE_number).innerHTML = "<\img src=\""+FIRE_Billede[FIRE_number]+"\" border=\"0\" />";
else document.getElementById("FIRE_no"+FIRE_number).innerHTML = "<\img src=\""+FIRE_Billede[FIRE_number]+"\" border=\"0\" />";
document.getElementById("FIRE_no"+FIRE_number).style.top=(FIRE_PosTop[FIRE_number] - 20)+"px";
document.getElementById("FIRE_no"+FIRE_number).style.left=(FIRE_PosLeft[FIRE_number] - 40)+"px";
setTimeout("FIRE_Reset("+FIRE_number+")",1000)
}

function FIRE_Reset(FIRE_number)
{
FIRE_TopBang[FIRE_number] = FIRE_Top + Math.random()*100;
FIRE_PosTop[FIRE_number] = FIRE_Bot;
FIRE_PosTopAfv[FIRE_number] = 4;
FIRE_PosLeft[FIRE_number] = FIRE_Mid;
if (FIRE_number % 2 == 0) FIRE_PosVenAfv[FIRE_number] = 4*Math.random();
else FIRE_PosVenAfv[FIRE_number] = Math.random()*(-4);

document.getElementById("FIRE_no"+FIRE_number).innerHTML = "";
document.getElementById("FIRE_no"+FIRE_number).style.top=FIRE_PosTop[FIRE_number]+"px";
document.getElementById("FIRE_no"+FIRE_number).style.left=FIRE_PosLeft[FIRE_number]+"px";

if (FIRE_number == FIRE_no-1) setTimeout("FIRE_Start()",FIRE_Pause);
}

FIRE_Start();
Kembali Ke Atas Go down
Lihat profil user
 
Membuat Kembang Api
Topik sebelumnya Topik selanjutnya Kembali Ke Atas 
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
Dumay Community :: FORUM TEKNIK INFORMATIKA :: Forum Membahas Semua Jenis Programming :: Forum Membahas JavaScript-
Navigasi: