You are not logged in.

Sollte es probleme mit eurem passwortern geben dann nutzt bitte die Passwort vergessen funktion MFG Saugjunkie

Thunder™

Developer

  • "Thunder™" is male
  • "Thunder™" started this thread

Posts: 538

wcf.user.option.userOption52: deutsch

Location: /dev/null

Hobbies: iTT

  • Send private message

1

Sunday, December 16th 2018, 9:34pm

Schneeflocken...

Wollt ihr auch ein bisschen Schnee für eure Source? Geht ganz einfach und schnell.. :thumbup:

Das in die bittorrent.php im <head> Bereich....
(bei einigen Sourcen muss das doppelt sofern man es auch im Login Bereich nutzen möchte.)


PHP Source code

1
<script type="text/javascript" src="/js/snowflakes.js"></script>

erstellt eine snowflakes.js mit diesem Inhalt und speichern diese im js ordner sofern vorhanden:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
////////////////////////////////////////////////////////////////////////// SnowFlakes-Script (c) 2017, Dominik Scholz / go4u.de Webdesign
////////////////////////////////////////////////////////////////////////

var snowflakes = {

	///////////////////////////// configuration ////////////////////////////
	
	// amout of flakes
	_amount: 40,
	// random colors
	_color: ['#AAAACC', '#DDDDFF', '#CCCCDD', '#F3F3F3', '#F0FFFF'],
	// random fonts
	_type: ['Arial Black', 'Arial Narrow', 'Times', 'Comic Sans MS'],
	// char used for flake
	_flakeChar: '*',
	// speed of flakes
	_speed: .05,
	// minimum flake font size
	_minSize: 8,
	// maximum flake font size
	_maxSize: 22,
	// horizontal drift
	_drift: 15,
	// zIndex of flakes
	_zIndex: 20000,

	
	
	///////////////////////////// private vars /////////////////////////////
	
	_flakes: [],
	_bodyWidth: 0,
	_bodyHeight: 0,
	_range: null,
	_count: 0,
	_lastInterval: 0,

	

	////////////////////////////// functions ///////////////////////////////

	// init snow
	init: function()
	{
    	this._addEventListener(window, 'resize', function() { return snowflakes.resize.apply(snowflakes); });
    	this._addEventListener(window, 'load', function() { return snowflakes.start.apply(snowflakes); });
	},
	
	
	// add an event listener
	_addEventListener: function(el, name, handler)
	{
    	if (el.addEventListener)
        	el.addEventListener(name, handler, false); 
    	else if (el.attachEvent)
        	el.attachEvent('on' + name, handler);
	},
	
	
	// start snow
	start: function()
	{
    	// calculate range
    	this._range = this._maxSize - this._minSize;

    	// init window size
    	this.resize();

    	// add new flakes
    	while (this._amount > this._flakes.length)
        	this._createFlake(this._flakes.length);
        	
    	// start to move snow
    	this._animFn = function() {snowflakes._move();};
    	this._lastInterval = this._time();
    	requestAnimFrame(snowflakes._animFn);

	},
	
	
	// get current time
	_time: function()
	{
    	return +new Date();
	},
	
	
	// return a random integer
	_randomInt: function(value)
	{
    	return Math.floor(
        	Math.random() * value
    	);
	},
	

	// return a random array element
	_randomArray: function(arr)
	{
    	return arr[
        	Math.floor(
            	Math.random() * (arr.length)
        	)
    	];
	},

	
	// creates a new snowflake
	_createFlake: function(i)
	{
    	var newEl = !this._flakes[i],
        	el, f;
    	
    	if (newEl)
    	{
        	// create new dom el
        	el = document.createElement('div');
        	el.style.position 	= 'absolute';
        	el.style.zIndex   	= this._zIndex;
        	el.innerHTML      	= this._flakeChar;
        	f = {
            	el: el,
            	x: 0,
            	y: 0,
            	size: 0,
            	count: 0
        	};
        	this._flakes[i] = f;
        	document.getElementsByTagName('body')[0].appendChild(el);
    	}
    	else
    	{
        	// use existing dom el
        	f = this._flakes[i];
        	el = f.el;
    	}

    	// init flake
    	el.style.left     	= '0px';
    	el.style.top      	= '-' + this._maxSize + 'px';
    	el.style.color    	= this._randomArray(this._color);
    	el.style.family   	= this._randomArray(this._type);
    	el.style.fontSize 	= (this._randomInt(this._range) + this._minSize) + 'px';

    	// create flake object
    	f.x = this._randomInt(this._bodyWidth - this._drift - this._maxSize - 3) + this._drift + 1;
    	f.y = -this._maxSize - this._randomInt(this._bodyHeight);
    	f.size = this._randomInt(this._range) + this._minSize;
    	f.count = this._randomInt(10000);
	},

	
	// move existing flakes
	_move: function()
	{
    	requestAnimFrame(snowflakes._animFn);
    	
    	// calculate movement factor
    	var dif = this._time() - this._lastInterval,
        	l = this._flakes.length,
        	d = dif * this._speed * this._maxSize,
        	i, flake, flakeDiv;
        	
    	this._lastInterval = this._time();
    	this._count += dif * this._speed / 20;
    	
    	for (i = 0; i < l; i++)
    	{
        	flake = this._flakes[i];
        	flake.y += d / flake.size;
        	
        	// restart existing flake
        	if (flake.y + flake.size >= this._bodyHeight)
        	{
            	this._createFlake(i);
            	continue;
        	}
        	
        	flake.el.style.left = Math.floor(flake.x + Math.sin(flake.count + this._count) * this._drift) + 'px';
        	flake.el.style.top  = Math.floor(flake.y) + 'px';
    	}
	},
	

	// calculate new positions for all flakes
	resize: function()
	{
    	// save old width
    	var oldWidth = this._bodyWidth;

    	// get new width and height
    	this._bodyWidth = this._getWindowWidth() - this._maxSize;
    	this._bodyHeight = this._getWindowHeight() - this._maxSize;
    	
    	// calculate correction ratio
    	var ratio = this._bodyWidth / oldWidth;
        	
    	// for all flakes
    	for (var i = 0, l = this._flakes.length, flake; i < l; i++)
    	{
        	flake = this._flakes[i];

        	// do width correction
        	flake.x *= ratio;
        	
        	// restart existing flake
        	if ((flake.y + flake.size) >= this._bodyHeight)
            	this._createFlake(i);
    	}
	},
	
	
	// get window width
	_getWindowWidth: function()
	{
    	var w = Math.max(self.innerWidth || 0, window.innerWidth || 0);
    	
    	if (document.documentElement)
        	w = Math.max(w, document.documentElement.clientWidth || 0);
    	if (document.body)
    	{
        	w = Math.max(w, document.body.clientWidth || 0);
        	w = Math.max(w, document.body.scrollWidth || 0);
        	w = Math.max(w, document.body.offsetWidth || 0);
    	}
    	
    	return w;
	},

	
	// get window height
	_getWindowHeight: function()
	{
    	var h = Math.max(self.innerHeight || 0, window.innerHeight || 0);
    	
    	if (document.documentElement)
        	h = Math.max(h, document.documentElement.clientHeight || 0);
    	if (document.body)
    	{
        	h = Math.max(h, document.body.clientHeight || 0);
        	h = Math.max(h, document.body.scrollHeight || 0);
        	h = Math.max(h, document.body.offsetHeight || 0);
    	}
    	
    	return h;
	}

};

// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
  return  window.requestAnimationFrame   	|| 
      	window.webkitRequestAnimationFrame || 
      	window.mozRequestAnimationFrame	|| 
      	window.oRequestAnimationFrame  	|| 
      	window.msRequestAnimationFrame 	|| 
      	function (cb){
        	window.setTimeout(CB , 1000 / 60);
      	};
})();

snowflakes.init();
Oben in der .js könnt ihr das ganze etwas steuern..

Quelle wo ich es her habe: go4u.de

have fun..
Thunder™ has attached the following file:
  • snowflakes.rar (1.98 kB - 1 times downloaded - latest: Jan 6th 2019, 3:44pm)
Überlege einmal, bevor du gibst, zweimal, bevor du annimmst, und tausendmal, bevor du verlangst!

Similar threads