html5背景 <br> *{margin:0;padding:0;list-style-type:none;}<br> a,img{border:0;}<br> <br>$(function () {<br> if (!window.ActiveXObject && !!document.createElement("canvas" .getContext) {<br> $.getScript("http://im-img.qq.com/pcqq/js/200/cav.js?_=1428576021379",<br> function () {<br> var t = {<br> Breite: 1,5, <br> Höhe: 1,5, <br> Tiefe: 10, <br> Segmente: 12, <br> Slices: 6, <br> xrange: 0,8, <br> yrange : 0,1,<br> zRange: 1,<br> ambient: "#525252",<br> diffuse: "#FFFFFF",<br> Geschwindigkeit: 0,0002<br> };<br> var G = {<br> Anzahl: 2, <br> xyScalar: 1, <br> zoffset: 100, <br> Umgebung : 1200, <br> Dämpfung: 0,95, <br> minlimit: 10, <br> maxlimit: null, <br> mindistance: 20, <br> maxDistance: 400, <br> autopilot: false, <br> zeichnen: false,<br> Grenzen: CAV.Vector3.create(),<br> Schritt: CAV.Vector3.create(Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1))<br> };<br> var m = "canvas"; <br> var E = "svg";<br> var x = {<br> Renderer: m };<br> var i, n = Date.now();<br> var L = CAV. Vector3.create();<br> var k = CAV.Vector3.create(); ElementById("anitOut"); <br> var D, I, h, q, y;<br> var g;<br> function C() {<br> F();<br> p() ;<br> s();<br> B();<br> . v();<br> K(z.offsetWidth, z.offsetHeight);<br> o()<br> }<br><br> function F() {<br> }<br><br> Funktion H(N) {<br> if (D ) {<br> W case m:<br> D.setSize(z.offsetWidth, z.offsetHeight);<br> w.appendChild(D.element)<br> }<br><br> function p() {<br> I = new CAV.Scene()<br> function s() {<br> I.remove(h);<br> D .clear() t.ambient, t.diffuse);<br> h = new CAV.Mesh(q, y);<br> N, O;<br> für (N = q .vertices.length - 1; N >= 0; N--) {<br> 🎜 > O.step = CAV.Vector3.create(Math.randomInRange(0,2, 1), Math.randomInRange(0,2, 1), Math.randomInRange(0,2, 1)); O.time = Math.randomInRange( 0, Math.PIM2)<br> }<br> var O, N;<br> for (O = I.lights.length - 1; O >= 0; O--) {<br> N = I.lights[O];<br> I.remove(N)<br> D.clear();<br> 🎜> N = neues CAV.Light(G. ambient, G.diffuse);<br> N.ambientHex = N.ambient.format();<br> I.add(N);<br> N.mass = Math.randomInRange(0.5, 1);<br> N.velocity = CAV.Vector3.create();<br> 🎜> N.force = CAV.Vector3.create()<br> D.setSize(O, N);<br> CAV.Vector3.set( L, D.halfWidth, D.halfHeight);<br> s() i = Date.now() - n;<br> u( );<br> M();<br> function u() {<br> var Q, P, O, R, T, V, U, S = t.tiefe / 2;<br> CAV.Vector3.copy(G.bounds, L);<br> CAV.Vector3.multiplyScalar(G.bounds, G.xyScalar);<br> CAV.Vector3.setZ(k, G.zOffset);<br> for (R = I.lights.length - 1; R >= 0; R--) {<br> ;<br> CAV.Vector3.setZ(T.position, G.zOffset);<br> .maxDistance) ;<br> var W = G.gravity * T.mass / N;<br> CAV.Vector3.subtractVectors(T.force, k, T.position);<br> CAV.Vector3.normalise(T.force) ;<br> CAV.Vector3.multiplyScalar(T.force, W);<br> . CAV.Vector3.set(T.acceleration); CAV.Vector3.add(T.acceleration, T.force);<br> CAV.Vector3.add(T.velocity, T.acceleration);<br> CAV.Vector3.multiplyScalar(T.velocity, G.dampening);<br> CAV.Vector3.limit(T.velocity, G. minLimit, G.maxLimit);<br> CAV.Vector3.add(T.position, T.velocity)<br> (V = q.vertices.length - 1; V >= 0; V--) {<br> U = q.vertices[V];<br> P = Mathe .cos(U.time + U.step[1] * i * t.speed);<br> O = Math.sin(U.time + U.step[2] * i * t.speed);<br> CAV.Vector3.set(U.position, t.xRange * q.segmentWidth * Q, t.yRange * q.sliceHeight * P, t.zRange * S * O - S);<br> . CAV .Vector3.add (U.position, U.anchor)<br> }<br> q.dirty = true<br> }<br><br> function M() {<br> }<br><br> Funktion J(O) {<br> var Q , N, S = O;<br> var P = Funktion (T) {<br> für (Q = 0, l = I.lights.length; Q < l; Q++) {<br/> N = I. Lichter[Q];<br/> N.ambient.set(T);<br/> }<br/> };<br/> var R = Funktion (T) {<br/> für (Q = 0, l = I.lights.length; Q < l; Q++) {<br/> N.diffuse.set(T); <br/> 🎜> return {<br/> set: function () {<br/> P(S[0]);<br/> R(S[1])<br/> }<br/> }<br/><br/> Funktion v() {<br/> window.addEventListener("resize", j)<br/> - N.y);<br/> CAV .Vector3.subtract(k, L)<br/> </ 🎜> M()<br/> }<br/> 🎜 );<br/></ script><br></body><br></html><br></p>