// // Skupne funkcije spletle modela yzxModXZ.jsc // // dajBP() barvna paleta // dajKB() tipkovnica // dajGB() gumb za div{Gib} // jeMobi()je mobilnik // // globalne spremenljivke, nastavljive Zagon() // // $ls = ''; // localStorage.name // $bw = '560px'; // širina spletke // $bp = true; // barvna paleta // $bi = 5; // # izbrana, -1 naključna // $bc = []; // ! izbrana paleta // $kb = true; // tipkovnica // $gb = false; // gumb lS$ = []; // localStorage var _bp = '#000,#446A46,#E4AEC5,#82A284,#FFC4DD,#ecd, #000,#000,#000,¤' // 0 zel-vio #BB95B9,#1B513A,#7D5D7B,#003B22 + '#000,#4E944F,#B4E197,#83BD75,#E9EFC0,#efc, #000,#000,#000,¤' // 1 zel #B16BB0,#4B1E68,#7C428A,#16103F + '#000,#876445,#EEC373,#CA965C,#F4DFBA,#eeb, #000,#000,#000,¤' // 2 rja #789BBA,#113C8C,#3569A3,#0B2045 + '#000,#CDBBA7,#F4DFD0,#DAD0C2,#FDEFEF,#324458,#000,#000,#000,¤' // 3 roz-vio #324458,#0B202F,#252F3D,#021010 + '#000,#FF8C94,#DCEDC2,#FFAAA6,#FFD3B5,#00736B,#000,#000,#000,¤' // 4 roz-siv #00736B,#23123D,#005559,#002C4A + '#000,#E36387,#F2AAAA,#A6DCEF,#DDF3F5,#eff, #000,#000,#000,¤' // 5 roz+sin #1C9C78,#0D5555,#592310,#220C0A + '#007,#82954B,#FFEF82,#BABD42,#EFD345,#fd4, #007,#007,#007,¤' // 6 zel-rum #7D6AB4,#00107D,#4542BD,#102CBA + '#000,#82954B,#EFD345,#BABD42,#FFEF82,#ff8, #000,#000,#000,¤' // 7 zel-rum #7D6AB4,#102CBA,#4542BD,#00107D + '#000,#557174,#C7CFB7,#9DAD7F,#F7F7E8,#ffb, #000,#000,#000,¤' // 8 mod #AA8E8B,#383048,#625280,#080817 + '#000,#EEBB4D,#FFEF82,#9BB67C,#E3DFC8,#1144B2,#000,#000,#000,¤' // 9 okr+siv #1144B2,#00107D,#644983,#1C2037 ; // localStorage if ( typeof $ls === 'undefined') $ls = ''; if ($ls != '' && localStorage.getItem($ls) != null) { lS$ = localStorage.getItem($ls).split('//'); $bi = parseInt(lS$[3]); } if ($ls != '' && localStorage.getItem($ls) == null) { localStorage.setItem($ls,'//.__//__//-1//__//__//'); lS$ = localStorage.getItem($ls).split('//'); } //console.log('mod21: '+lS$); // barvna paleta wbp = _bp.split('¤'); $bi = ( $bi > wbp.length-2 ) ? -1 : $bi; $bi = ( $bi == -1) ? parseInt(Math.floor(Math.random() * (wbp.length-1))) : $bi; $bc = wbp[$bi].split(','); function dajBP(p) // barvna paleta { if ( !$bp ) return false; if ( typeof p == 'undefined') { p = $bi; } if ( !$bc[0] ) { wbp = _bp.split('¤'); wpi = (p == -1) ? parseInt(Math.floor(Math.random() * (wbp.length-1))) : p; $bc = wbp[wpi].split(','); } Vse.style.color = $bc[0]; Gor.style.backgroundColor = $bc[1]; Med.style.backgroundColor = $bc[2]; Dol.style.backgroundColor = $bc[3]; Gib.style.backgroundColor = $bc[4]; return false; } function jscOB() // objekti { Vse = document.getElementById("vse"); Gor = document.getElementById("gor"); Med = document.getElementById("med"); Dol = document.getElementById("dol"); Gib = document.getElementById("gib"); Gmb = document.getElementById("gmb"); Vzz = document.querySelector(':root'); Vzz.style.setProperty('--bdw', $bw); Vzz.style.setProperty('--co0', $bc[0]); Vzz.style.setProperty('--bc1', $bc[1]); Vzz.style.setProperty('--bc2', $bc[2]); Vzz.style.setProperty('--bc3', $bc[3]); Vzz.style.setProperty('--bc4', $bc[4]); Vzz.style.setProperty('--co1', $bc[5]); Vzz.style.setProperty('--co2', $bc[6]); Vzz.style.setProperty('--co3', $bc[7]); Vzz.style.setProperty('--co4', $bc[8]); Vzz.style.setProperty('--cb1', getCC($bc[1])); Vzz.style.setProperty('--cb2', getCC($bc[2])); Vzz.style.setProperty('--cb3', getCC($bc[3])); Vzz.style.setProperty('--cb4', getCC($bc[4])); return false; } function dajKB(p,q) // tipkovnica p - start 0,2 q izpusti -1, 11 { return false; } function dajGB(p) // gumb div{Gor} { $gb = !$gb; if ( $gb ) {Gib.style.visibility = 'hidden' ; Gmb.className="_bg";} else {Gib.style.visibility = 'visible'; Gmb.className="-bg";} dajBP($bi); return false; } function gorBP(p) // BP priprava za prikaz { msg = '
'; tx1 = '
'; tx2 = '
 
'; tx4 = '
'; _bp = '#000,#ffffff,#0000aa,#aa0000,#FFC4DD,#ecd,#000,#000,#000,¤' + _bp; wbp = _bp.split('¤'); for (var i = 0 ; i < wbp.length-1; i++ ) { wbg = wbp[i].split(','); msg += tx1.replace(/#/gi,i-1); msg += tx2 + wbg[1] +tx3; msg += tx2 + wbg[2] +tx3; msg += tx2 + wbg[3] +tx3; msg += tx4; } msg += tx4; return msg; } function newBP(p) // sprememba BP iz nastavitev !!!! začasno { localStorage.setItem($ls,'//.Parametri//__//'+p+'//'); window.location.reload(true); return; } function sprLS(p,q,r) // sprememba v localStorage { lS$[p] = q; pod = lS$[0]; for ( var i = 1 ; i < lS$.length; i++ ) { pod += '//' + lS$[i]; } localStorage.setItem($ls,pod); if (r == 1) window.location.reload(true); return; } // function jeMobi() { // return ( 'ontouchstart' in window ) || // ( navigator.maxTouchPoints > 0 ) || // ( navigator.msMaxTouchPoints > 0 ) ||; // return window.matchMedia("only screen and (max-width: 480px)").matches; return (screen.width < screen.height ); } // Tiskanje function PriLS() // tiskanje iz LS { _ls = $ls; $ls = 'vzzPrint'; _re =/\/\//gi; sprLS(1,'.'+document.title,0); sprLS(2,'.'); gla = (document.getElementById("gla") == null) ? '***' : document.getElementById("gla").innerHTML; sprLS(3,gla,0); sprLS(4,Med.innerHTML.replace(_re,'÷'),0); sprLS(5,Gib.innerHTML.replace(_re,'÷'),0); sprLS(6,window.location.pathname,0); $ls = _ls; window.open("../__abc/vzzPrint.htm",'_blank'); } function Print() // tiskanje oblike { Vse.style.margin = '0% 0% 0% 5%'; Vse.style.border = '1px dotted'; Med.style.border = '1px dotted'; Gib.style.border = '1px dotted'; Gib.style.height = '96vh'; Gib.style.top = '0%'; Gib.style.right = '-100%'; return false; } // komplementarna barva function getCC(color) { var c = color.slice(1), i = parseInt(c, 16), v = ((1 << 4 * c.length) - 1 - i).toString(16); while (v.length < c.length) { v = '0' + v; } return '#' + v.toUpperCase(); } // swipe med : gib GB var sX, sY, mX, mY; //here clientX, and clientY means X and Y coordinates function swpSt(e){ sX = e.touches[0].clientX ; sY = e.touches[0].clientY ; } function swpMv(e){ mX = e.touches[0].clientX ; mY = e.touches[0].clientY ; } function swpGB(){ if(sX+100 < mX){ dajGB(); }else if(sX-100 > mX){ dajGB(); } if(sY+100 < mY){ }else if(sY-100 > mY){ } }