[Programming Game] presents a gift at the age of a new year. (Ignition of the lshdic fireworks on the first floor of the 1949th floor)

Source: Internet
Author: User
[Programming Game] presents a gift at the age of a new year. (The first prize is 10000 available points)
Author:
Ignition[Ctrl + A select all tips: you can modify some code and then press run]

<HTML> <pead> <meta http-equiv = 'content-type' content = 'text/html; charset = utf8'> <br/> <title> one of the most popular JS fireworks, anonymous, 5 effect, non-filter. </title> <br/> <style> font {position: absolute; Z-index: 10 }</style> <br/> </pead> <body bgcolor = "black" text = "white" style = "overflow: hidden; "> <br/> <Div id =" A "style =" width: 100%; Height: 100%; Background-color: Black ";> </div> <br/> <SCRIPT> <br/>/* <br/> I was proud of it? Grievance, don't say this, don't you? It really attracts the better work of the ox, and it will not be left blank with [one] ^-^! <Br/> In addition, everyone is truly satisfied, and this is my real purpose :) <br/> the competition is actually 2nd, while colleagues pay more attention to their different coding habits, work Style, fun, and better writing for each other. <br/> I 'd like to test to what extent I can play in a 8000-word JS program. </P> <p> I will upgrade my work next time. I will not have the title of [the best JS fireworks]. This time, I still want to stir up more bulls/more fireworks and prepare for collection! ^-^/<Br/> Original: fengyunwu blog: http://blog.sina.com.cn/shenmoduijue <br/> */<br/> var xall = screen. availwidth, yall = screen. availHeight-180, $ = math. random <br/> function gcor () {return ($ () * 4096 ). tostring (16)} <br/> onload = function () {var I = 0; while (I ++ <8) p. add () ;}< br/> var P ={< br/> Add: function () {<br/> var size1 = 6 + math. floor ($ () * 25), x = math. floor ($ () * xall) <br/> var d = document. createelement ("font"), Ad = math. ceil ($ () * 4), t = "●" <br/> D. color = gcor (); D. DX = size1; with (D. style) {fontsize = size1; left = x; Top = yall ;}< br/> If (AD = 2) {T ="★"} Else if (AD = 3) {T =" * "} else if (AD = 4) {T =" · "}; <br/> D. innertext = T; D. AD = aD; D. go = setinterval (function () {P. go (d)}, 30);. appendchild (d) <br/>}, <br/> go: function (OBJ) {<br/> var y = obj. offsettop, dx = obj. DX; obj. style. top = Y-(dx/5) <br/> If (Y <yall-(dx * 15) return p. bao (OBJ) <br/>}, <br/> BaO: function (OBJ) {<br/> var x = obj. offsetleft, y = obj. offsettop, AD = obj. ad <br/> clearinterval (obj. go); <br/> If (ad! = 3) {. removechild (OBJ); p. add ()} <br/> If (AD = 1) {for (VAR I = 0; I <($ () * 12) + 6; I ++) {flash1.add (X, Y, obj. style. fontsize, obj. color) }}< br/> else if (AD = 2) {for (VAR I = 0; I <($ () * 10) + 15; I ++) {flash2.add (x, y, I + 6, obj. style. fontsize) }}< br/> else if (AD = 3) {<br/> var SZ = parseint (obj. style. fontsize) <br/> obj. face = "_ gb2312"; obj. jia = 0; obj. innertext = "Gong/n Xi" <br/> obj. style. fontsize = SZ * 3; obj. style. left = obj. offsetleft-(SZ * 2); obj. style. top = obj. offsettop-(SZ * 2); <br/> clearinterval (obj. go); obj. go = setinterval (function () {P. flash3_go2 (OBJ)}, 30); <br/> var I = 0; while (I ++ <5) {setTimeout (function () {flash3.add (X, parseint (obj. style. fontsize)/3)}, I * 350)} <br/>} else if (AD = 4) {flash4.add (X, Y, obj. style. fontsize, obj. color) }< br/>}, <br/> flash3_go2: function (OBJ) {// color calculation/Alpha simulation idea sharing. <br/> var c = obj. color. substr (1), r = C. substr (0, 2), G = C. substr (2, 2), B = C. substr (4, 2), dx = 3, Jia = obj. jia <br/> r = math. floor ("0x" + r ). tostring (10); G = math. floor ("0x" + G ). tostring (10); B = math. floor ("0x" + B ). tostring (10); <br/> If (Jia = 0) {R + = DX; G + = DX; B + = DX; obj. color = "RGB (" + R + "," + G + "," + B + ")"} <br/> else if (Jia = 30) {r-= DX; G-= DX; B-= DX; obj. color = "RGB (" + R + "," + G + "," + B + ")"} <br/> else {obj. color = gcor (); Jia ++; obj. jia = Jia; If (Jia = 30) obj. innertext = "fat/n Cai"} <br/> If (r> 255 | G> 255 | B> 255) {obj. jia = 1; obj. innertext = "/N years"} <br/> If (R + G + B <0) {clearinterval (obj. go);. removechild (OBJ); p. add ()} <br/>}// end </P> <p> var flash1 ={< br/> Add: function (X, Y, size1, color1) {<br/> var dx = math. round ($ () * 40)-20, dy = math. round ($ () * 40)-20 <br/> If (math. ABS (dx) <2) dx = 5; If (math. ABS (dy) <2) dy =-5; <br/> var d = document. createelement ("font"); <br/> with (D. style) {fontsize = size1; left = x; Top = y ;}< br/> D. color = color1; D. oldx = x; D. oldy = y; D. DX = DX; D. DY = Dy; <br/> D. innertext = "●"; D. go = setinterval (function () {flash1.go (d)}, 30);. appendchild (d) <br/>}, <br/> go: function (OBJ) {<br/> var x = obj. oldx, y = obj. oldy, X2 = obj. offsetleft, y2 = obj. offsettop <br/> If (math. ABS (x-x2) <125 & math. ABS (y-y2) <125) {obj. style. left = x2 + math. floor (obj. DX); obj. style. top = y2 + math. floor (obj. dy);} else {clearinterval (obj. go);. removechild (OBJ) ;}< br/>}// end </P> <p> var flash2 ={</P> <p> Add: function (X, y, POs, size1) {<br/> var d = document. createelement ("font"); <br/> with (D. style) {fontsize = size1; left = x; Top = y ;}< br/> D. color = gcor (); D. oldx = x; D. oldy = y; D. pos = Pos; D. innertext ="★"; <Br/> D. go = setinterval (function () {flash2.go (d)}, 30);. appendchild (d) <br/>}, <br/> go: function (OBJ) {<br/> var x = obj. oldx, y = obj. oldy, X2 = obj. offsetleft, y2 = obj. offsettop, P = obj. pos; <br/> If (math. ABS (x-x2) <100 & math. ABS (y-y2) <100) {obj. style. left = x2 + (p * Math. cos (p); obj. style. top = y2 + (p * Math. sin (p);} else {clearinterval (obj. go);. removechild (OBJ) ;}< br/>}// end </P> <p> var flash3 ={< br/> Add: function (x, size1) {<Br/> var arr = [], size2 = parsefloat (size1) + 2, X2 = math. round ($ () * 100)-50 + x, D = document. createelement ("Div"); <br/> with (D. style) {position = "absolute"; zindex = 5; left = x2; Top = yall ;}< br/> for (VAR I = 0; I ++ <5 ;) {var OS = size2-(I * 2); If (OS <= 0) OS = 1; arr [I] = "<font color = '" + gcor () + "'style = 'font-size:" + OS + "'> * </font> <br>"} <br/> D. innerhtml = arr. join (""); D. go = setinterval (function () {flash3.go (d)}, 30);. appendchild (d); <br />}, <Br/> go: function (OBJ) {<br/> var top1 = obj. offsettop; obj. style. top = top1-30; If (top1 <-50) {clearinterval (obj. go);. removechild (OBJ) }< br/>}// end </P> <p> var flash4 ={< br/> Add: function (X, Y, size1, color1) {<br/> var arr = [], D = document. createelement ("Div"); D. ci = 1; <br/> with (D. style) {position = "absolute"; left = x; Top = y; fontsize = size1; color = color1 ;}< br/> for (VAR I = 0; I ++ <($ () * 60) + 40;) {<br/> var GX = parsefloat (Size1) * 12, SX = math. ceil ($ () * Gx)-(GX/2), Sy = math. ceil ($ () * Gx)-(GX/2 ); <br/> arr [I] = "<font color = '" + color1 + "'style = 'left:" + SX + "; top: "+ Sy +" '>. </font> "<br/>}< br/> D. innerhtml = arr. join (""); D. go = setinterval (function () {flash4.go (d)}, 70);. appendchild (d); <br/>}, <br/> go: function (OBJ) {<br/> var CI = obj. CI; CI ++; If (CI = 35) {clearinterval (obj. go); return. removechild (OBJ)} obj. ci = CI; <br/> If (Ci/2 ). tostring (). I Ndexof (". ") =-1) {obj. style. visibility = "visible"} else {obj. style. visibility = "hidden"} <br/>}// end <br/> // honestly, FF is too restrictive, and it is difficult to write attention to the effect and efficiency of ghost animation, we are very grateful to the veteran ieonly for their outstanding performance! <Br/> </SCRIPT> </body> </ptml>
Ignition[Ctrl + A select all tips: you can modify some code and then press run]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.