// JavaScript Document //wersja developerska dla sylwester.friko.net/odliczanie var cc_ans; var cc_id; function cc_edit(event,id){ //z pola typu input o id=id, w nim wartosc bez # defc=document.getElementById(id).value; cc_id=id; if( defc ){ a=parseInt(defc,16); if( a.toString(16).toUpperCase()==defc ) defc="#"+defc; cc_show(event,defc); } else cc_show(event); } function cc_show(e,defc){ if( !e )var e=window.event; if( e.pageX || e.pageY ) {px=e.pageX;py=e.pageY;} else { px = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; py = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } o=document.getElementById('cc_lay'); o.style.left=px; o.style.top=py; o.style.display="block"; if( defc )cc_wiev(defc); //o.focus(); } function cc_hide(){ o=document.getElementById('cc_lay'); o.style.display="none"; } function cc_create(w,h,bkg,id){ ans=document.createElement("DIV"); st=ans.style; st.position="absolute"; st.width=w; st.height=h; st.background=bkg; if( id )ans.id=id; return ans; } function cc_pos(obj,x,y){ obj.style.left=x; obj.style.top=y; } function cc_font(obj,size){ obj.style.fontFamily="tahoma"; obj.style.textAlign="center"; obj.style.fontSize=size; } function cc_build(){ lay=cc_create("227px","245px","#EEEEEE","cc_lay"); st=lay.style; st.borderStyle="solid"; st.borderWidth="1"; st.borderColor="black"; st.display="none"; lay.onblur=cc_hide; document.body.appendChild(lay); cobj=lay; fd=cc_create("200px","15px","none","cc_show"); cc_pos(fd,"5px","5px"); cc_font(fd,"12px"); xd=cc_create("15px","15px","none"); cc_pos(xd,"211px","3px"); cc_font(xd,"14px"); xd.onclick=cc_hide; st=xd.style; st.cursor="pointer"; st.fontWeight="bold"; xd.innerText="X"; xd.textContent="X"; cobj.appendChild( fd ); cobj.appendChild( xd ); count=0; for(r=0;r<12;r++){ for(c=0;c<18;c++){ c_r=parseInt(count/6)*51; c_g=parseInt(r/2)*51; c_b=(c%6)*51; count++; if( count>35)count=0; tit="#"+d2h(c_r)+d2h(c_g)+d2h(c_b); cc=cc_create("12px","18px",tit); cc_pos(cc,5+c*12+"px",20+r*18+"px"); cc.onmouseover=ccmo; cc.onclick=cccl; cc.title=tit; cobj.appendChild( cc ); } } } function ccmo(){ cc_wiev(this.title); } function cc_wiev(col) { //ustawia podglad koloru col="#......" cs=document.getElementById('cc_show'); cs.style.background=col; cs.style.color=cc_neg(col); cs.innerText=col; cs.textContent=col; } function cccl(){ cc_ans=this.title; if( cc_id ) { cc_obj=document.getElementById(cc_id); cc_obj.value=cc_ans.substr(1); des_chg(cc_obj); } cc_hide(); } function cc_neg(col){ r=cc_exc(col,1); g=cc_exc(col,1); b=cc_exc(col,1); mi = Math.min(r,g); mi = Math.min(mi,b); ma = Math.max(r,g); ma = Math.max(ma,b); if( ((ma+mi)/5) < 50 ) return "#FFFFFF"; else return "#000000"; } function d2h(d) {a=d.toString(16);if( a.length==1 )a="0"+a;return a.toUpperCase();} //extract color z d=#RRGGBB function cc_exc(d,c){ return parseInt(d.substr(2*c+1,16));}
|
Strona Główna
Dodaj Ofertę/Login
Kontakt
Katalog
Mapy Sylwestrowe
Domek Na Sylwestra
O której Nowy Rok
Pogoda w Sylwestra
Filmy
Kamery
Ciekawostki
Kalendarz 2012
Kalendarz Świąt
Gadżety
Tapety
Zegary/Liczniki
Reklama w serwisie Inne Święta
Walentynki
Rok 2012
Kalendarz Online
Imieniny
|
// JavaScript Document
//wersja developerska dla sylwester.friko.net/odliczanie
var cc_ans;
var cc_id;
function cc_edit(event,id){ //z pola typu input o id=id, w nim wartosc bez #
defc=document.getElementById(id).value;
cc_id=id;
if( defc ){
a=parseInt(defc,16);
if( a.toString(16).toUpperCase()==defc )
defc="#"+defc;
cc_show(event,defc);
}
else cc_show(event);
}
function cc_show(e,defc){
if( !e )var e=window.event;
if( e.pageX || e.pageY )
{px=e.pageX;py=e.pageY;}
else
{
px = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
py = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
o=document.getElementById('cc_lay');
o.style.left=px;
o.style.top=py;
o.style.display="block";
if( defc )cc_wiev(defc);
//o.focus();
}
function cc_hide(){
o=document.getElementById('cc_lay');
o.style.display="none";
}
function cc_create(w,h,bkg,id){
ans=document.createElement("DIV");
st=ans.style;
st.position="absolute";
st.width=w;
st.height=h;
st.background=bkg;
if( id )ans.id=id;
return ans;
}
function cc_pos(obj,x,y){
obj.style.left=x;
obj.style.top=y;
}
function cc_font(obj,size){
obj.style.fontFamily="tahoma";
obj.style.textAlign="center";
obj.style.fontSize=size;
}
function cc_build(){
lay=cc_create("227px","245px","#EEEEEE","cc_lay");
st=lay.style;
st.borderStyle="solid";
st.borderWidth="1";
st.borderColor="black";
st.display="none";
lay.onblur=cc_hide;
document.body.appendChild(lay);
cobj=lay;
fd=cc_create("200px","15px","none","cc_show");
cc_pos(fd,"5px","5px");
cc_font(fd,"12px");
xd=cc_create("15px","15px","none");
cc_pos(xd,"211px","3px");
cc_font(xd,"14px");
xd.onclick=cc_hide;
st=xd.style;
st.cursor="pointer";
st.fontWeight="bold";
xd.innerText="X";
xd.textContent="X";
cobj.appendChild( fd );
cobj.appendChild( xd );
count=0;
for(r=0;r<12;r++){
for(c=0;c<18;c++){
c_r=parseInt(count/6)*51;
c_g=parseInt(r/2)*51;
c_b=(c%6)*51;
count++;
if( count>35)count=0;
tit="#"+d2h(c_r)+d2h(c_g)+d2h(c_b);
cc=cc_create("12px","18px",tit);
cc_pos(cc,5+c*12+"px",20+r*18+"px");
cc.onmouseover=ccmo;
cc.onclick=cccl;
cc.title=tit;
cobj.appendChild( cc );
}
}
}
function ccmo(){
cc_wiev(this.title);
}
function cc_wiev(col) { //ustawia podglad koloru col="#......"
cs=document.getElementById('cc_show');
cs.style.background=col;
cs.style.color=cc_neg(col);
cs.innerText=col;
cs.textContent=col;
}
function cccl(){
cc_ans=this.title;
if( cc_id )
{
cc_obj=document.getElementById(cc_id);
cc_obj.value=cc_ans.substr(1);
des_chg(cc_obj);
}
cc_hide();
}
function cc_neg(col){
r=cc_exc(col,1);
g=cc_exc(col,1);
b=cc_exc(col,1);
mi = Math.min(r,g);
mi = Math.min(mi,b);
ma = Math.max(r,g);
ma = Math.max(ma,b);
if( ((ma+mi)/5) < 50 )
return "#FFFFFF";
else
return "#000000";
}
function d2h(d) {a=d.toString(16);if( a.length==1 )a="0"+a;return a.toUpperCase();}
//extract color z d=#RRGGBB
function cc_exc(d,c){ return parseInt(d.substr(2*c+1,16));}
Ostatnio dodane oferty |
Masz konto na Facebook'u? Daj się powiadomić o imprezach sylwestrowych.
|