Dragonfly CMS - German Community  
Toggle Content
Toggle Content Navigation

Toggle Content Wer ist wo
 Bots:
1: Google > Forum 9.x
2: Majestic-12 > Forum 9.x
 Visitors:
1: Forum 9.x
2: Downloads
3: Forum 9.x
4: Forum 9.x

Toggle Content Languages

Toggle Content Design
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.

Toggle Content Downloads (Top)

Forum 9.x > > Dragonfly CMS 9.x > > HowTo & Allgemeine Fragen > > Schneeflocken einfügen ?
Schneeflocken einfügen ?
Fragen und Diskussionen zur aktuellen Version
Post new topic   Reply to topic   Printer Friendly Page    Forum Index > > HowTo & Allgemeine Fragen

View previous topic :: View next topic  
Author Message
TachyonX
Investigator
Investigator


Joined: Nov 20, 2005
Posts: 6

PostPosted: 18.12.2005 02:27    Post subject: Schneeflocken einfügen ? Reply with quote

kann mir vlt jemand erklären wie ich dieses script in cpg 9 zum laufen bekomme ?


danke !!!


TachyonX's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/4.4.1/4.0.24-Max-log/9.0.6.1
Back to top
View user's profile
Ertan
Webmaster
Webmaster


Joined: Mar 19, 2004
Posts: 1247
Location: Germany

PostPosted: 18.12.2005 13:29    Post subject: Re: Schneeflocken einfügen ? Reply with quote

grundsätzlich :

datei erstellen z.b. schnee.js ( mit scriptinhalt )

in includes/javascript reinkopieren

in header.php aufrufen

$header .="<script .....

Wink

_________________
.: USE THE FORCE :.
Helft mit ! Keine Unbeantworteten Beiträge mehr

Ertan's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Send e-mail Visit poster's website Photo Gallery
TachyonX
Investigator
Investigator


Joined: Nov 20, 2005
Posts: 6

PostPosted: 18.12.2005 16:16    Post subject: Re: Schneeflocken einfügen ? Reply with quote

vlt sowas in der art ?

Code::
$header .= '<script language="JavaScript" type="text/javascript" src="includes/javascript/schnee.js"></script>'."\n";
[/code]

und wo genau hin damit in der header.php *g* ?


hab jetzt genau das in die schnee.js gepackt :

Code::
<!-- präsentiert von kostenlose-javascripts.de -->
<script type='text/javascript'>
<!--
// Anzahl der Schneeflocken (mehr als 30 - 40 nicht empfehlenswert)
var snowmax=35

// Farben der Schneeflocken. Es können beliebig viele Farben angegeben werden
var snowcolor=new Array("#AAAACC","#DDDDFF","#CCCCDD","#F3F3F3","#F0FFFF")

// Fonts, welche die Schneeflocken erzeugen. Beliebig viele Fonts ergänzbar
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")

// Zeichen für die Schneeflocke (empfohlen: * )
var snowletter="*"

// Fallgeschwindigkeit (empfohlen sind Werte zwischen 0.3 bis 2)
var sinkspeed=0.6

// Maximale Größe der Schneeflocken
var snowmaxsize=22

// Minimale Größe der Schneeflocken
var snowminsize=8

/*  Schnee-Zone:
** 1 für überall, 2 für Schneefall nur auf der linken Seite
** 3 für Schneefall in der Mitte, 4 für Schneefall nur auf der rechten Seite */
var snowingzone=1

/*
* Ab hier nichts mehr ändern *
*/

var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent 
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/)  
var browserok=ie5||ns6||opera

function randommaker(range) {		
	rand=Math.floor(range*Math.random())
    return rand
}

function initsnow() {
	if (ie5 || opera) {
		marginbottom = document.body.clientHeight
		marginright = document.body.clientWidth
	}
	else if (ns6) {
		marginbottom = window.innerHeight
		marginright = window.innerWidth
	}
	var snowsizerange=snowmaxsize-snowminsize
	for (i=0;i<=snowmax;i++) {
		crds[i] = 0;                      
    	lftrght[i] = Math.random()*15;         
    	x_mv[i] = 0.03 + Math.random()/10;
		snow[i]=document.getElementById("s"+i)
		snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
		snow[i].size=randommaker(snowsizerange)+snowminsize
		snow[i].style.fontSize=snow[i].size
		snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
		snow[i].sink=sinkspeed*snow[i].size/5
		if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
		if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
		if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
		if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
		snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
		snow[i].style.left=snow[i].posx
		snow[i].style.top=snow[i].posy
	}
	movesnow()
}

function movesnow() {
	for (i=0;i<=snowmax;i++) {
		crds[i] += x_mv[i];
		snow[i].posy+=snow[i].sink
		snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]);
		snow[i].style.top=snow[i].posy
		
		if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
			if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
			if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
			if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
			if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
			snow[i].posy=0
		}
	}
	var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
	document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
//-->
</script>
<br />
<div id="kostenlosejavascripts" align="center"><a href="http://www.kostenlose-javascripts.de/javascripts/verschiedenes/schneeflocken-ohne-bilder.html" title="Schneeflocken" target="_blank">Schneeflocken auf der Homepage?</a></div>
<br />
<script type="text/javascript" src="http://www.kostenlose-javascripts.de/startScript.php?id=254"></script>
<!-- präsentiert von kostenlose-javascripts.de -->



TachyonX's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/4.4.1/4.0.24-Max-log/9.0.6.1
Back to top
View user's profile
TachyonX
Investigator
Investigator


Joined: Nov 20, 2005
Posts: 6

PostPosted: 18.12.2005 16:18    Post subject: Re: Schneeflocken einfügen ? Reply with quote

sry dopplepost


TachyonX's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/4.4.1/4.0.24-Max-log/9.0.6.1
Back to top
View user's profile
Ertan
Webmaster
Webmaster


Joined: Mar 19, 2004
Posts: 1247
Location: Germany

PostPosted: 18.12.2005 17:17    Post subject: Re: Schneeflocken einfügen ? Reply with quote

teste mal das hier

habe ich gerade hier installiert
header zeile 92 :
PHP:
	$header .= '<script language="JavaScript" type="text/javascript" src="includes/javascript/snow.js"></script>'."\n";

Code::
<!-- Source of "snow.js" -->

//Snow - http://www.btinternet.com/~kurt.grigg/javascript
//Script featured on Dynamic Drive: http://www.dynamicdrive.com

if ((document.getElementById) &&
window.addEventListener || window.attachEvent){

(function(){

//Configure here.

var num = 30; //Number of flakes
var timer = 30; //setTimeout speed. Varies on different comps
var enableinNS6 = 1 //Enable script in NS6/Mozilla? Snow animation could be slow in those browsers. (1=yes, 0=no).

//End.

var y = [];
var x = [];
var fall = [];
var theFlakes = [];
var sfs = [];
var step = [];
var currStep = [];
var h,w,r;
var d = document;
var pix = "px";
var domWw = (typeof window.innerWidth == "number");
var domSy = (typeof window.pageYOffset == "number");
var idx = d.getElementsByTagName('div').length;

if (d.documentElement.style &&
typeof d.documentElement.style.MozOpacity == "string")
num = 12;

for (i = 0; i < num; i++){
sfs[i] = Math.round(1 + Math.random() * 1);

document.write('<div id="flake'+(idx+i)+'" style="position:absolute;top:0px;left:0px;width:'
+sfs[i]+'px;height:'+sfs[i]+'px;background-color:#ffffff;font-size:'+sfs[i]+'px"><\/div>');

currStep[i] = 0;
fall[i] = (sfs[i] == 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] = (sfs[i] == 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
}


if (domWw) r = window;
else{
if (d.documentElement &&
typeof d.documentElement.clientWidth == "number" &&
d.documentElement.clientWidth != 0)
r = d.documentElement;
else{
if (d.body &&
typeof d.body.clientWidth == "number")
r = d.body;
}
}


function winsize(){
var oh,sy,ow,sx,rh,rw;
if (domWw){
if (d.documentElement && d.defaultView &&
typeof d.defaultView.scrollMaxY == "number"){
oh = d.documentElement.offsetHeight;
sy = d.defaultView.scrollMaxY;
ow = d.documentElement.offsetWidth;
sx = d.defaultView.scrollMaxX;
rh = oh-sy;
rw = ow-sx;
}
else{
rh = r.innerHeight;
rw = r.innerWidth;
}
h = rh - 2;
w = rw - 2;
}
else{
h = r.clientHeight - 2;
w = r.clientWidth - 2;
}
}


function scrl(yx){
var y,x;
if (domSy){
y = r.pageYOffset;
x = r.pageXOffset;
}
else{
y = r.scrollTop;
x = r.scrollLeft;
}
return (yx == 0)?y:x;
}


function snow(){
var dy,dx;

for (i = 0; i < num; i++){
dy = fall[i];
dx = fall[i] * Math.cos(currStep[i]);

y[i]+=dy;
x[i]+=dx;

if (x[i] >= w || y[i] >= h){
y[i] = -10;
x[i] = Math.round(Math.random() * w);
fall[i] = (sfs[i] == 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] = (sfs[i] == 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
}

theFlakes[i].top = y[i] + scrl(0) + pix;
theFlakes[i].left = x[i] + scrl(1) + pix;

currStep[i]+=step[i];
}
setTimeout(snow,timer);
}


function init(){
winsize();
for (i = 0; i < num; i++){
theFlakes[i] = document.getElementById("flake"+(idx+i)).style;
y[i] = Math.round(Math.random()*h);
x[i] = Math.round(Math.random()*w);
}
snow();
}


if (window.addEventListener && enableinNS6){
window.addEventListener("resize",winsize,false);
window.addEventListener("load",init,false);
}
else if (window.attachEvent){
window.attachEvent("onresize",winsize);
window.attachEvent("onload",init);
}

})();
}//End.

_________________
.: USE THE FORCE :.
Helft mit ! Keine Unbeantworteten Beiträge mehr

Ertan's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Send e-mail Visit poster's website Photo Gallery
TachyonX
Investigator
Investigator


Joined: Nov 20, 2005
Posts: 6

PostPosted: 18.12.2005 17:29    Post subject: Re: Schneeflocken einfügen ? Reply with quote

funktioniert ! (die flocken könnten etwas größer seinaber so sieht es auch schon gut aus )

danke dir Smile


TachyonX's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/4.4.1/4.0.24-Max-log/9.0.6.1
Back to top
View user's profile
Ertan
Webmaster
Webmaster


Joined: Mar 19, 2004
Posts: 1247
Location: Germany

PostPosted: 18.12.2005 18:06    Post subject: Re: Schneeflocken einfügen ? Reply with quote

zeile 38 :

ersetzen mit :

Code::
document.write('<div id="flake'+(idx+i)+'" style="position:absolute;top:0px;left:0px;width:'
+sfs[i]+'px;height:'+sfs[i]+'px;font-size:'+sfs[i]+'px"><img src="/includes/javascript/snow.gif" border="0"><\/div>');

und nun mit grafik Wink

src="/includes/javascript/snow.gif" anpassen wo grafik liegt
Grafik :

_________________
.: USE THE FORCE :.
Helft mit ! Keine Unbeantworteten Beiträge mehr

Ertan's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Send e-mail Visit poster's website Photo Gallery
TachyonX
Investigator
Investigator


Joined: Nov 20, 2005
Posts: 6

PostPosted: 18.12.2005 19:21    Post subject: Re: Schneeflocken einfügen ? Reply with quote

jetzt ist es perfekt Smile
danke


TachyonX's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/4.4.1/4.0.24-Max-log/9.0.6.1
Back to top
View user's profile
clubhouse
Special-Agent
Special-Agent


Joined: Nov 04, 2004
Posts: 478
Location: Eine Insel mit 2 Bergen

PostPosted: 21.12.2005 09:46    Post subject: Re: Schneeflocken einfügen ? Reply with quote

cool Wink Kann man das auch mit nem kleinen feuerwerk machen? das die nach oben gehen? *gg*

_________________


clubhouse's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux Debian 4.0 / PHP 5.2.0-8+etch13 / SQL 5.0.32 / CMS 9.2.1
Back to top
View user's profile Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page    Forum Index > > HowTo & Allgemeine Fragen
Page 1 of 1
All times are GMT + 1 Hour



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



Interactive software released under GNU GPL, Code Credits, Privacy Policy