Changeset 2719585
- Timestamp:
- 05/06/2022 06:56:36 PM (4 years ago)
- Location:
- genolve-toolkit
- Files:
-
- 9 added
- 10 edited
-
assets/banner-1544x500.jpg (modified) (previous)
-
assets/banner-772x250.jpg (modified) (previous)
-
assets/screenshot-2.jpg (added)
-
assets/screenshot-3.jpg (added)
-
assets/screenshot-4.jpg (added)
-
trunk/genolve-toolkit.php (modified) (3 diffs)
-
trunk/img/genolveDNA7transparent.png (modified) (previous)
-
trunk/img/playbtn.svg (added)
-
trunk/img/timer_bar.png (added)
-
trunk/img/timer_bar2.png (added)
-
trunk/img/tip-bg.svg (added)
-
trunk/inc/functions.php (modified) (9 diffs)
-
trunk/inc/settings.php (modified) (4 diffs)
-
trunk/js/d3.min.js (added)
-
trunk/js/genolve-3rdparty.js (added)
-
trunk/js/genolve-getsvg.js (modified) (21 diffs)
-
trunk/js/genolve-scroll.js (modified) (1 diff)
-
trunk/js/genolve-sound.js (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genolve-toolkit/trunk/genolve-toolkit.php
r2693883 r2719585 1 1 <?php 2 2 /* 3 * Plugin Name: Genolve Music VideoToolkit4 * Version: 2.0.63 * Plugin Name: Genolve Slideshow Maker Toolkit 4 * Version: 3.0.0 5 5 * Plugin URI: https://www.genolve.com/ 6 * Description: Make music videos with music driven animations that perfectly synchronize movement to music.6 * Description: Create artistic slideshows freely mixing images, video, SVG or text with animations choreographed to a soundtrack. 7 7 * Author: Genolve 8 8 * Author URI: https://www.genolve.com/ … … 12 12 ?> 13 13 <?php 14 defined( 'ABSPATH' ) or die( 'No ABSPATH!' );14 defined( 'ABSPATH' ) || exit; 15 15 define( 'GENOLVE_PLUGIN_DIR', plugin_dir_url( __FILE__ )); 16 16 // production: functions.php … … 22 22 add_action( 'wp_ajax_genolve_add2list' , 'genolve_add2list' ); 23 23 add_action( 'wp_ajax_genolve_setOpt' , 'genolve_setOpt' ); 24 add_action( 'wp_ajax_genolve_delit' , 'genolve_delit' ); 24 25 // THE BAD REQUEST error was: 25 26 // NEED BOTH OF THESE -
genolve-toolkit/trunk/inc/functions.php
r2693883 r2719585 1 1 <?php 2 defined( 'ABSPATH' ) or die( 'No ABSPATH!' );2 defined( 'ABSPATH' ) || exit; 3 3 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 4 4 DEFINES … … 21 21 define( 'GENOLVE_ACTION_URL', 'https://www.genolve.com/'); 22 22 define( 'GENOLVE_JS_URL', 'https://www.genolve.com/js/' ); 23 define( 'GENOLVE_VER', '- 2.0.6' );23 define( 'GENOLVE_VER', '-3.0.0' ); 24 24 25 25 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * … … 107 107 } 108 108 //echo "genolve_img_sel_hash:type:".gettype($genolve_img_sel_hash)." size:".count($genolve_img_sel_hash); 109 wp_localize_script('genolve_getsvg', 'genolve_img_sel_hash', count($genolve_img_sel_hash)>0?$genolve_img_sel_hash: "{}"); // LOCALIZE IMG JS VARS109 wp_localize_script('genolve_getsvg', 'genolve_img_sel_hash', count($genolve_img_sel_hash)>0?$genolve_img_sel_hash:array("{}") ); // LOCALIZE IMG JS VARS 110 110 111 111 //localize GENERAL … … 121 121 $genolve_gen_sel_hash[ $genolve_gen_sel[$ii] ]=array('val'=>$genolve_gen_val[$ii],'par'=>$genolve_gen_par[$ii]);; 122 122 } 123 wp_localize_script('genolve_getsvg', 'genolve_gen_sel_hash', count($genolve_gen_sel_hash)>0?$genolve_gen_sel_hash: "{}"); // LOCALIZE TAG JS VARS123 wp_localize_script('genolve_getsvg', 'genolve_gen_sel_hash', count($genolve_gen_sel_hash)>0?$genolve_gen_sel_hash:array("{}") ); // LOCALIZE TAG JS VARS 124 124 125 125 /* JS vars getsvg customize*/ … … 143 143 wp_localize_script('genolve_customize', 'genolveO', $genolveO); 144 144 wp_localize_script('genolve_getsvg', 'genolveO', $genolveO); 145 /*wp_localize_script('genolve_customize', 'jsbasedir', array(GENOLVE_JS_URL) ); // LOCALIZE URL JS VARS 146 wp_localize_script('genolve_getsvg', 'genolve_enabled', array(get_option("genolve_enabled")) ); 147 wp_localize_script('genolve_getsvg', 'genolve_membership', array(get_option("genolve_membership")) ); 148 wp_localize_script('genolve_getsvg', 'wpajaxurl', array(admin_url( 'admin-ajax.php' ) )); 149 wp_localize_script('genolve_getsvg', 'wptheme', array(wp_get_theme()->get('Name') )); 150 wp_localize_script('genolve_getsvg', 'beyonce_getsvg', array(wp_create_nonce( 'beyonce_getsvg' )) ); 151 wp_localize_script('genolve_customize', 'wpajaxurl', array(admin_url( 'admin-ajax.php' ) )); 152 wp_localize_script('genolve_customize', 'GENOLVE_VER', array($genolve_ver )); 153 wp_localize_script('genolve_customize', 'vv', array('true' ) ); 154 wp_localize_script('genolve_customize', 'genolve_color_bg', array(get_option("genolve_color_bg") ?get_option("genolve_color_bg"):'none' )); 155 wp_localize_script('genolve_customize', 'genolve_color_txt', array(get_option("genolve_color_txt")?get_option("genolve_color_txt"):'none' ) ); 156 wp_localize_script('genolve_customize', 'genolve_color_brdr', array(get_option("genolve_color_brdr")?get_option("genolve_color_brdr"):'none' ) ); 157 wp_localize_script('genolve_customize', 'beyonce_customize', array(wp_create_nonce( 'beyonce_customize' ) )); 158 */ 145 159 146 } // end genolve enabled 160 147 } … … 478 465 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 479 466 genolve_add2list - wp_ajax post : add on to genolve_gen_sel 480 expecting POSTvars thesel,thesvg,themem467 expecting POSTvars: thesel,thesvg,thepar,themem 481 468 */ 482 469 function genolve_add2list(){ … … 524 511 } // end add2list 525 512 513 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 514 genolve_delit - wp_ajax post : delete from genolve_img_sel 515 expecting: DEX to delete 516 */ 517 function genolve_delit($postO=null){ 518 $message = "notset"; 519 if($postO==null) 520 $postO = $_POST; 521 $retval=check_ajax_referer('beyonce_customize','beyonce_customize',false); 522 if( !current_user_can('edit_posts') || !$retval || $postO==null ) 523 genolve_send_json_error("Error:delit: user lacks permissions:".current_user_can('edit_posts')." or nonce fail:".$retval." or no arg:".$postO); 524 $code = sanitize_text_field($postO['code']); 525 // get current lists 526 $genolve_img_sel=get_option("genolve_img_sel"); 527 $genolve_img_val=get_option("genolve_img_val"); 528 $genolve_img_par=get_option("genolve_img_par"); 529 if (gettype($genolve_img_sel) != "array" || count($genolve_img_sel)<1) 530 genolve_send_json_error("Error:delit: nothing in genolve_img_sel:".gettype($genolve_img_sel) ); 531 $index = array_search($code, $genolve_img_val); 532 if($index===false) 533 $message = "Notice:delit: did not find:".$code; 534 else{ 535 array_splice($genolve_img_sel, $index, 1); 536 array_splice($genolve_img_val, $index, 1); 537 array_splice($genolve_img_par, $index, 1); 538 update_option("genolve_img_sel",$genolve_img_sel); 539 update_option("genolve_img_val",$genolve_img_val); 540 update_option("genolve_img_par",$genolve_img_par); 541 $message = "Notice:delit found and removed:".$code; 542 } 543 $jsonRespA=array('result' => 'success', 544 'message' => $message, 545 'success' => true, 546 'beyonce_customize' => wp_create_nonce( 'beyonce_customize' ) ); 547 genolve_send_json( $jsonRespA ); 548 }// end delit 526 549 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 527 550 genolve_savefile - wp_ajax post : save remote genolve image/video and store in Media … … 575 598 $randname = $nam; 576 599 else 577 $randname = "genolve". date("YmdHis").".".$ext; 600 //$randname = "genolve". date("YmdHis").".".$ext; 601 $randname = "genolve-". $nam; 578 602 579 603 //$validLink = $this->checkValidLink( $url ); … … 659 683 array_push($genolve_img_sel,$local_fname); // image name 660 684 array_push($genolve_img_val,$cod); // the "code" 661 array_push($genolve_img_par, ''); // blank685 array_push($genolve_img_par,wp_json_encode(array('date'=>date("Ymd")))); // only db entries after SEO update have date for path in media lib 662 686 $dmsg .=" genolve_img_sel type:".gettype($genolve_img_sel)." val:".implode(",",$genolve_img_sel)." genolve_img_val:".implode(",",$genolve_img_val); 663 687 update_option("genolve_img_sel",$genolve_img_sel); -
genolve-toolkit/trunk/inc/settings.php
r2693883 r2719585 1 1 <?php 2 defined( 'ABSPATH' ) or die( 'No ABSPATH!' );2 defined( 'ABSPATH' ) || exit; 3 3 //require_once( 'wp_autoupdate.php' ); 4 4 … … 179 179 <div id="gnlv-sideBanner-container" class="gnlv-sideBanner-tips" ><div class="gnlv-tip-text"> <?php echo $mytip ?> 180 180 </div></div> 181 <?php } else { ?> 182 <div id="gnlv-sideBanner-container" class="gnlv-sideBanner" onClick="window.location='<?php print $loginurl?>&redir=https://www.genolve.com/svg/en/genolve-wordpress-plugin-premium.php'"> 181 <?php } else { 182 $theurl = 'https://www.genolve.com/svg/en/genolve-wordpress-plugin-premium.php'; 183 if($loginurl!='') 184 $theurl = $loginurl."&redir=".$theurl; 185 ?> 186 <div id="gnlv-sideBanner-container" class="gnlv-sideBanner" onClick="window.location='<?php print $theurl ?>'"> 183 187 </div> 184 188 <?php } ?> … … 328 332 329 333 <div class="card border-secondary mb-3" style="max-width: 750px;"> 330 <div class="card-header">Manage Custom Images</div>334 <div class="card-header">Manage Slideshows (Advanced)</div> 331 335 <div class="card-body text-secondary"> 332 <p class="card-text"> To create a custom image, click the tab above "Design Editor". Wherever you use the image, it is automatically replaced with in-line SVG. To temporarily disable in-line replacement, add"XXX" to the start of the selector (e.g. genolve20180520101412.jpg -> XXXgenolve20180520101412.jpg). Permanently stop the in-line replacement with the delete button.<br>336 <p class="card-text">Slideshows are created and managed under the "Design Editor" tab. <br> Only use this area to temporarily disable image-to-slideshow replacement by adding "XXX" to the start of the selector (e.g. genolve20180520101412.jpg -> XXXgenolve20180520101412.jpg). Permanently stop the in-line replacement with the delete button.<br> 333 337 v---- if the image is missing, it is safe to delete</p> 334 338 </div> … … 357 361 for($ii=0;$ii<count($genolve_img_sel);$ii++){ 358 362 $zdate = str_replace("genolve","",$genolve_img_sel[$ii]); 363 //use json date if there 364 if($genolve_img_par[$ii]!='' && $genolve_img_par[$ii]!=null){ 365 $respA =json_decode($genolve_img_par[$ii],true); 366 if( array_key_exists('date', $respA)) 367 $zdate = $respA['date']; 368 } 369 359 370 $yy= substr($zdate,0,4); 360 371 $mm= substr($zdate,4,2); -
genolve-toolkit/trunk/js/genolve-getsvg.js
r2693883 r2719585 3 3 var PAR = String(genolve_gen_sel_hash[key].par); 4 4 var VAL = String(genolve_gen_sel_hash[key].val); 5 vpr.vprint("eloop","genolve-getsvg: replac "+kk+"["+key+"]: par:"+PAR+" with:"+VAL); 5 var rsvg=null; 6 vpr.vprint("gwpt","genolve-getsvg: replac "+kk+"["+key+"]: par:"+PAR+" with:"+VAL); 6 7 // 7 8 // coverNshow JSON data … … 16 17 } 17 18 } catch (e) { 18 vpr.vprint(" eloop", "JSON parse error on["+key+"]:"+e);19 vpr.vprint("gwpt", "JSON parse error on["+key+"]:"+e); 19 20 }; 20 21 } // end had params … … 66 67 }//end snow 67 68 else if (paramO!=null && paramO.origarea=="coverNshow"){//CoverNshow 68 vpr.vprint(" eloop",'setupHtmlTemplate start mode: '+paramO.origarea+" all params:"+JSON.stringify(paramO));69 vpr.vprint("gwpt",'setupHtmlTemplate start mode: '+paramO.origarea+" all params:"+JSON.stringify(paramO)); 69 70 // load all divs in body 70 71 $('body').append(String(VAL).replace(/\\"/g,'"') ); … … 72 73 $(paramO.selector).each(function() {// reposition each buttonset 73 74 el=$(this); 74 vpr.vprint(" eloop",'setupHtmlTemplate NUM['+bb+'] el:'+el.length+' id:'+el.prop('id')+' class:'+this.className+' w:'+el.width()+' h:'+el.height()+' x:"'+el.offset().left+' y:'+el.offset().top);75 vpr.vprint("gwpt",'setupHtmlTemplate NUM['+bb+'] el:'+el.length+' id:'+el.prop('id')+' class:'+this.className+' w:'+el.width()+' h:'+el.height()+' x:"'+el.offset().left+' y:'+el.offset().top); 75 76 // set all of class gnlv-todo[bb] top left to this el 76 77 $("."+paramO.coverclass+bb).css({left:el.offset().left+"px",top:el.offset().top+"px"}); … … 82 83 $(key).css({'background-image':'url( \''+VAL+'\')'}); 83 84 if(paramO && typeof(paramO.divstyle)=="object"){// add duration 84 vpr.vprint(" eloop",'setupHtmlTemplate['+key+'] apply additional styles:'+vpr.dumpvar(paramO.divstyle));85 vpr.vprint("gwpt",'setupHtmlTemplate['+key+'] apply additional styles:'+vpr.dumpvar(paramO.divstyle)); 85 86 $(key).css(paramO.divstyle); 86 87 } … … 102 103 var paramO = null; 103 104 this.verbose=false;//production 104 var vpr={name:'getsvg-stub',vprint:function(tag,stuff){if(self.verbose)console.log(tag+" "+stuff);} ,dumpvar:function(inval){return JSON.stringify(inval)} 105 // This stub just for prints, better stub in gnlv-scroll once created dont document.vpr = vpr; 106 var vpr={name:'getsvg-vpr-stub',vprint:function(tag,stuff){if(self.verbose)console.log(tag+" "+stuff);} , 107 dumpvar:function(inval){return JSON.stringify(inval)} 105 108 }; 109 106 110 if(typeof eloop!='undefined' && eloop.version!='stub'){// NOTE MOSTLY eloop is not defined! do not use eloop 107 111 vpr=eloop.pvpr; 108 vpr.vprint(" eloop","genolve eloop defined!, membership:"+eloop.Membership);112 vpr.vprint("gwpt","genolve eloop defined!, membership:"+eloop.Membership); 109 113 } 110 114 this.actionhost="https://www.genolve.com"; … … 165 169 $('img').each(function() { 166 170 // match? 167 // typical wordpress image with a name like genolve20180520111333-1024x538.jpg 171 // typical wordpress image with a name like genolve20180520111333-1024x538.jpg NEW 2022/05/genolve-Happy-Mom-Day-1024x548.jpg 168 172 vpr.vprint("gwpt","genolve-getsvg id:"+$(this).prop('id')); 169 173 thename = $(this).prop('src'); 170 if(thename!=null) 171 thename = thename.replace(/.*\//,"").replace(/-.*/,"").replace(/\..*/,""); 174 if(thename!=null)// grab genolve20180520111333 175 //thename = thename.replace(/.*\//,"").replace(/-.*/,"").replace(/\..*/,""); 176 thename = thename.replace(/.*\//,"").replace(/-\d+x\d+\.jpg/,"").replace(/\..*/,""); 172 177 173 178 if ( thename!=null && thename!='' && genolve_img_sel_hash[thename] !=null ) { 174 179 kk++; 175 vpr.vprint("gwpt","genolve-getsvg found img match "+kk+":"+thename);176 180 PAR = genolve_img_sel_hash[thename].par; 177 181 VAL = genolve_img_sel_hash[thename].val; 182 vpr.vprint("gwpt","genolve-getsvg found img match - = [ "+kk+":"+thename+" val:"+VAL+"] "+typeof($(this) )+" = -"); 178 183 if(batchFetch[VAL]==null){ 179 184 batchFetch [ VAL ] = 'nada'; // filled in later, svg code … … 192 197 // find a video element 193 198 thevideowrapper = $(this); 194 vpr.vprint(" eloop","genolve-getsvg: found wp-video div width:"+thevideowrapper.width());199 vpr.vprint("gwpt","genolve-getsvg: found wp-video div width:"+thevideowrapper.width()); 195 200 thevideo = $(this).find('video'); 196 201 if(thevideo==null || thevideo.length!=1) 197 vpr.vprint(" eloop","genolve-getsvg: did not find video tag or more than one:"+thevideo.length);202 vpr.vprint("gwpt","genolve-getsvg: did not find video tag or more than one:"+thevideo.length); 198 203 else{ 199 204 thename = $(this).attr('src'); … … 204 209 } 205 210 if(thename==null ) 206 vpr.vprint(" eloop","genolve-getsvg: found video tag but no source");211 vpr.vprint("gwpt","genolve-getsvg: found video tag but no source"); 207 212 else { 208 213 // typical wordpress image with a name like genolve20180520111333-1024x538.jpg 209 214 // dubug: not finding it? if a new extenstion was it stripped in genolve_addHeaderCode 210 215 thename = thename.replace(/.*\//,"").replace(/-.*/,"").replace(/\..*/,""); 211 vpr.vprint(" eloop","genolve-getsvg: found video looking for name:"+thename);216 vpr.vprint("gwpt","genolve-getsvg: found video looking for name:"+thename); 212 217 if ( genolve_img_sel_hash[thename] !=null ) { 213 218 vpr.vprint("gwpt","genolve-getsvg found vid match:"+thename); … … 227 232 thename = backgroundtarget.css('background-image'); 228 233 if(thename==null || backgroundtarget.length !=1) 229 vpr.vprint(" eloop","Twenty Seventeen:genolve-getsvg: select .panel-image:first not found:"+backgroundtarget.length+" OR no background source");234 vpr.vprint("gwpt","Twenty Seventeen:genolve-getsvg: select .panel-image:first not found:"+backgroundtarget.length+" OR no background source"); 230 235 else { 231 236 // typical wordpress image with a name like genolve20180520111333-1024x538.jpg 232 237 // dubug: not finding it? if a new extenstion was it stripped in genolve_addHeaderCode 233 238 thename = thename.replace(/.*\//,"").replace(/-.*/,"").replace(/\..*/,""); 234 vpr.vprint(" eloop","Twenty Seventeen:genolve-getsvg: found background, looking for name:"+thename);239 vpr.vprint("gwpt","Twenty Seventeen:genolve-getsvg: found background, looking for name:"+thename); 235 240 if ( genolve_img_sel_hash[thename] !=null ) { 236 241 vpr.vprint("gwpt","Twenty Seventeen:genolve-getsvg found background match:"+thename); … … 279 284 // modal dialog must have div called "message" 280 285 var newdiv,themusic={}; 281 vpr.vprint(" eloop","genolve-getsvg: = = = CALLBACK = = =had reponse?["+response+"]");286 vpr.vprint("gwpt","genolve-getsvg: = = = CALLBACK = = =had reponse?["+response+"]"); 282 287 payload=response; 283 288 if(payload != null && payload.number>0){ … … 286 291 thisel=payload.shapes[ii]; 287 292 if(thisel==null) 288 vpr.vprint(" eloop","genolve-getsvg: = = = CALLBACK["+ii+"]null");293 vpr.vprint("gwpt","genolve-getsvg: = = = CALLBACK["+ii+"]null"); 289 294 else{ 290 295 uuid = String(thisel.uuid);// keep case .toLowerCase() … … 298 303 } 299 304 } 300 vpr.vprint(" eloop","genolve-getsvg: = = = CALLBACK["+ii+"] packed up:"+uuid+" anitype:"+thisel.anitype+" music?"+typeof(themusic)+" pheno:"+thesvg );305 vpr.vprint("gwpt","genolve-getsvg: = = = CALLBACK["+ii+"] packed up:"+uuid+" anitype:"+thisel.anitype+" music?"+typeof(themusic)+" pheno:"+thesvg ); 301 306 batchFetch[ uuid ] = {svg:thesvg,anitype:thisel.anitype,music:themusic}; 302 307 } … … 325 330 propO.height='auto';//$img.height(); 326 331 } 327 svg= batchFetch[key].svg;328 if($img!=null && $img.length==1 && svg!=null &&svg!="nada"){329 vpr.vprint(" eloop","genolve-getsvg: = = = CALLBACK = = =doing replace on key["+key+"] el:"+el.tagName+" id:"+$img.id+" width:"+$img.width()+" height:"+$img.height());332 rsvg= batchFetch[key].svg; 333 if($img!=null && $img.length==1 && rsvg!=null && rsvg!="nada"){ 334 vpr.vprint("gwpt","genolve-getsvg: = = = CALLBACK = = =doing replace on key["+key+"] el:"+el.tagName+" id:"+$img.id+" width:"+$img.width()+" height:"+$img.height()+" anitype:"+batchFetch[key].anitype+" mp3?"+(batchFetch[key].music?batchFetch[key].music.mp3:'none')); 330 335 //transform FONTS for html 331 336 // have verifyied the <? is intact comming out of GETSVG but transformed somewhere: guessing putting it in html itself does it 332 337 // NOT <!--?xml-stylesheet type="text/css" 333 338 // BUT <?xml-stylesheet 334 svg =svg.replace(/repeatDur="\d+s"/g,'repeatDur="indefinite"');335 svg =svg.replace(/xMinYMin meet/,'xMidYMid slice'); // most useful for all sizes339 rsvg = rsvg.replace(/repeatDur="\d+s"/g,'repeatDur="indefinite"'); 340 rsvg = rsvg.replace(/xMinYMin meet/,'xMidYMid slice'); // most useful for all sizes 336 341 //svg = svg.replace(/<svg /,'<svg class="gnlv-svg" '); // animation speed hack 337 342 myp = $img.parent(); … … 341 346 myclasses = mypclasses; 342 347 } 343 vpr.vprint(" eloop","genolve-getsvg: on["+el.tagName+"] id:"+$img.prop('id')+" width/h!"+$img.css('width')+","+$img.css('height')+" display:"+$img.css('display') +" parent:"+myp.prop('id')+" classes:"+mypclasses);348 vpr.vprint("gwpt","genolve-getsvg: on["+el.tagName+"] id:"+$img.prop('id')+" width/h!"+$img.css('width')+","+$img.css('height')+" display:"+$img.css('display') +" parent:"+myp.prop('id')+" classes:"+mypclasses); 344 349 if(el.tagName.toLowerCase()=="div" && false){// NOT img, Div use bg, abandon: fonts/images go missing and no way to load 345 svg =svg.replace(/\n/g,"").replace(/.*<svg/g,"<svg");346 $img.css('background-image', 'url(\'data:image/svg+xml;base64,' + btoa( svg)+'\')' );350 rsvg = rsvg.replace(/\n/g,"").replace(/.*<svg/g,"<svg"); 351 $img.css('background-image', 'url(\'data:image/svg+xml;base64,' + btoa(rsvg)+'\')' ); 347 352 } 348 353 else{ 349 svg =svg.replace(/<.xml-stylesheet type=.text.css./,"<link rel='stylesheet' ").replace(/ \?>/,">");350 batchFetch[key].svg= svg;354 rsvg = rsvg.replace(/<.xml-stylesheet type=.text.css./,"<link rel='stylesheet' ").replace(/ \?>/,">"); 355 batchFetch[key].svg=rsvg; 351 356 newdiv = $('<div ></div>').prop(propO).addClass(myclasses); 352 357 //hover/click to play … … 359 364 // if > MUSIC < music-driven 360 365 if(batchFetch[key].anitype=="music"){ 361 vpr.vprint(" eloop","genolve-getsvg: MUZ place div ["+playmode+"], preloading mp3: "+batchFetch[key].music.mp3+" gnlvSound:"+typeof(gnlvSound)+" GenolveSound:"+typeof(GenolveSound));366 vpr.vprint("gwpt","genolve-getsvg: MUZ place div ["+playmode+"], preloading mp3: "+batchFetch[key].music.mp3+" gnlvSound:"+typeof(gnlvSound)+" GenolveSound:"+typeof(GenolveSound)); 362 367 //20210528 disable, ref: bV,p28 363 368 //newdiv.css({'width':$img.width()+'px','height':'auto'});// becuase div empty set exact w/h as image$img.height() 364 vpr.vprint(" eloop","genolve-getsvg: MUZ place div with width/h!"+newdiv.css('width')+","+newdiv.css('height')+" class list:"+myclasses+" theme:"+genolveO.wptheme);369 vpr.vprint("gwpt","genolve-getsvg: MUZ place div with width/h!"+newdiv.css('width')+","+newdiv.css('height')+" class list:"+myclasses+" theme:"+genolveO.wptheme); 365 370 //gnlvSound.preload({batchFetch[key].music.mp3}); 366 371 // if(static2play) … … 369 374 newdiv.on('click',function(){ 370 375 myid=$(this).prop('id'); 371 vpr.vprint(" eloop","genolve-getsvg["+key+"]: show SVG *click* on:"+myid+" scroll?"+typeof(gnlvScroll));376 vpr.vprint("gwpt","genolve-getsvg["+key+"]: show SVG *click* on:"+myid+" scroll?"+typeof(gnlvScroll)); 372 377 if(batchFetch[myid].svg!=null){//first click 373 378 $(this).html(batchFetch[myid].svg); … … 383 388 }// end static2play 384 389 else { //idle2play 385 vpr.vprint(" eloop","genolve-getsvg["+key+"]: MUZ place div ["+playmode+"], preloading mp3: "+batchFetch[key].music.mp3+" gnlvSound:"+typeof(gnlvSound)+" GenolveSound:"+typeof(GenolveSound));386 newdiv.html( svg);390 vpr.vprint("gwpt","genolve-getsvg["+key+"]: MUZ place div ["+playmode+"], preloading mp3: "+batchFetch[key].music.mp3+" gnlvSound:"+typeof(gnlvSound)+" GenolveSound:"+typeof(GenolveSound)); 391 newdiv.html(rsvg); 387 392 $img.replaceWith(newdiv); 388 393 gnlvScroll.doSetup({fromdiv:divid,usemode:'idle2play'}); // setup 2 of 3 … … 390 395 // not music, load svg and replace image 391 396 }else{ 392 newdiv.html( svg);397 newdiv.html(rsvg); 393 398 $img.replaceWith(newdiv);// < < -- replace image with svg 394 vpr.vprint(" eloop","genolve-getsvg["+key+"]: STD place div with width/h!"+newdiv.css('width')+","+newdiv.css('height')+" class list:"+myclasses+" theme:"+genolveO.wptheme+" anitype:"+batchFetch[key].anitype);399 vpr.vprint("gwpt","genolve-getsvg["+key+"]: STD place div with width/h!"+newdiv.css('width')+","+newdiv.css('height')+" class list:"+myclasses+" theme:"+genolveO.wptheme+" anitype:"+batchFetch[key].anitype); 395 400 // if > SCROLL < 396 401 if(batchFetch[key].anitype=="scroll" || batchFetch[key].anitype=="mouse"){ … … 412 417 || genolveO.wptheme=="Twenty Nineteen") 413 418 ){// try the styles 414 vpr.vprint(" eloop","genolve-getsvg: X div smaller than image X, trying computed styles:"+mystyles+" for div:"+newdiv.prop('id'));419 vpr.vprint("gwpt","genolve-getsvg: X div smaller than image X, trying computed styles:"+mystyles+" for div:"+newdiv.prop('id')); 415 420 newdiv.removeClass(myclasses);//.css(mystyles); 416 421 Object.assign(newdiv.get(0),mystyles);// < not working 417 422 for(prop in mystyles){ 418 423 if(mystyles[prop]!==null && mystyles[prop]!=""){ 419 //vpr.vprint(" eloop","genolve-getsvg:["+prop+"]="+mystyles[prop]);424 //vpr.vprint("gwpt","genolve-getsvg:["+prop+"]="+mystyles[prop]); 420 425 newdiv.get(0).style[prop]=mystyles[prop]; 421 426 } … … 428 433 }// end EXACTLY one img 429 434 else { 430 vpr.vprint(" gwpt","genolve-getsvg get key["+key+"] * FAIL * because img lost:"+$img.length+" or no svg:"+svg+" dump all keys:"+"skip"); // no longer have iteratevpr.iterate(batchFetchel,null,"getkeys")435 vpr.vprint("warn","genolve-getsvg get key["+key+"] * FAIL * because img lost:"+$img.length+" or no svg:"+rsvg+" have keys:"+Object.keys(batchFetchel)+" and "+Object.keys(batchFetch)); // no longer have iteratevpr.iterate(batchFetchel,null,"getkeys") 431 436 if($img.length>1) 432 vpr.vprint(" eloop","genolve-getsvg: dump:"+vpr.dumpvar($img));437 vpr.vprint("gwpt","genolve-getsvg: dump:"+vpr.dumpvar($img)); 433 438 } 434 439 } // end loop images -
genolve-toolkit/trunk/js/genolve-scroll.js
r2693883 r2719585 1 GenolveScroll=function( H){function pa(d,h){R="mouse";X=window.scrollY;da=d.pageX;ma=d.pageY;Y(d,h)}function qa(d,h){R="tilt";X=window.scrollY;Z=d.gamma;Z=d.accelerationIncludingGravity?d.accelerationIncludingGravity.x:0;ea=d.beta;d.data={};d.data.value=f;Y(d,h)}function ra(d,h){R="scroll";X=window.scrollY;Y(d,h)}function sa(d,h){R="music";if(d=gnlvSound.getAna())aa=d.data.freq,latestT=d.data.time,N=d.data.size,na=d.data.metro,d.data.value=f,Y(d,h)}function Y(d,h){fa||(f=d.data.value,requestAnimationFrame(ta),2 ha++);fa=!0}var L=this;this.ver="2.0.0";var ba=[],z={}, m={},C={},S,da=0,ma=0,Z=0,ea=0,aa=0,N=0,na=0,v=0,U,I,f,R,ha=0,ia=!1,ja,D="notset",ka=!1,la=!0,W={};this.ani_start_timestamp=Date.now();this.muzlock="none";"object"!=typeof window.gnlv_start_time&&(window.gnlv_start_time={"default":L.ani_start_timestamp});null==$&&($=jQuery);if(H&&H.vpr)var a=H.vpr;var O=H&&H.usemode?H.usemode:"edit",T=H&&H.atime?H.atime:15;null==a&&(a={name:"scroll-stub",vprint:function(d,h){vv||console.log(h)},dumpvar:function(d){return JSON.stringify(d)},3 d0:function(d){d=String(d).replace(/[^0-9\-\.]/g,"");return Math.round(parseFloat(d))},dd:function(d){return Math.round(100*parseFloat(d))/100},d 4:function(d){return Math.round(1E4*parseFloat(d))/1E4},keeptime:function(d){var h="default";d&&d.getAttribute("data-target")&&(h=d.getAttribute("data-target"));"object"!=typeof window.gnlv_start_time&&(window.gnlv_start_time={});window.gnlv_start_time[h]=Date.now()},parsejson:function(d){try{return JSON.parse(d.replace(/'/g,'"'))}catch(h){alert("JSON parse error on["+4 d+"]:"+h)}},getBrowser:function(){var d=!1,h=navigator.userAgent||navigator.vendor||window.opera;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(h)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(h.substr(0,5 4)))d=!0;return d},setValMode:{LOOP:"LOOP",LOOPz:"LOOPz",LOOPtoBOUND:"LOOPtoBOUND",LIMIT:"LIMIT",RANDOM:"RANDOM",MIDNORM:"MIDNORM",LOWNORM:"LOWNORM",HINORM:"HINORM"},setVal:function(d, h,b,n,g){if(isNaN(d)||!isFinite(d))return n;b=parseFloat(b);n=parseFloat(n);if(b>n){var k=n;n=b;b=k}k=n-b;k=g==this.setValMode.LOOPz?k+1:k;d=isNaN(d)?0:parseFloat(d);h=isNaN(h)?1:parseFloat(h);d+=h;if(d>n)if(g==this.setValMode.LIMIT)d=n;else if(g==this.setValMode.LOOPtoBOUND)d=b;else if(g==this.setValMode.LOOP||g==this.setValMode.LOOPz)for(;d>6 n;)d-= k;else console.warn("GNLV_UTILS.setVal invalid setValMode:"+g+" must be LOOP/LIMIT/RANDOM");else if(d<b)if(g==this.setValMode.LIMIT)d=b;else if(g==this.setValMode.LOOPtoBOUND)d=n;else if(g==this.setValMode.LOOP||g==this.setValMode.LOOPz)for(;d<b;)d+=k;else console.warn("GNLV_UTILS.setVal invalid setValMode:"+g+" must be LOOP/LIMIT/RANDOM");return d}});a.vprint("scrl"," - = ");a.vprint("scrl"," - = CREATE gnlvScroll = - usemode:"+O+" vpr:"+a.name+" eloop:"+eloop.version);"stub"==eloop.version&&7 a.keeptime&&(eloop.keeptime=a.keeptime);"function"==typeof GNLV_3RDPARTY&&null==eloop.tpr&&(a.vprint("scrl"," - = CREATE 3rdparty"),eloop.tpr=new GNLV_3RDPARTY(a,{name:"vekstub"},$));var X=0,fa=!1;this.changeDiv=function(d, h){if(null==d)return f;a.vprint("scrl",vv?"":" - = changeDiv "+f+" -> "+d+" muz:"+h);null==W[f]?a.vprint("scrl",vv?"":" - = changeDiv XXXX lookup fail"):(f=d,null!=h&&(L.muzlock="vol_on"==h?f:"none"))};var ua=function(d,h){a.vprint("scrl",vv?"":" - = onBeat = - got event:"+8 d.type+","+d.keyoff+" num ani:"+m[ f].gnlvaniA.length);ia=!0;gnlvSound.volColor()};this.toggleMuzPlay=function(){oa("play")};this.toggleMuzPause=function(){oa("pause")};var oa=function(d){var h;a.vprint("scrl",vv?"":"- = toggleMuz("+d+") for num ani:"+m[f].gnlvaniA.length);for(h=0;h<m[f].gnlvaniA.length;h++){paramO=m[f].gnlvaniA[h];var b=paramO.myself;"pause"==d?(b.attr("repeatDur","indefinite"),b.node.setAttribute("fill","remove")):b.attr("repeatDur",1E-6)}},ta=function(d,h){a.vprint("anmt",vv?"":9 "- - - - - - - - - - - - - aniOnScrollWrap event:"+ R);for(I in W)if(0===String(z[I]).indexOf(R))if("none"!=L.muzlock&&L.muzlock!=I)a.vprint("anmt",vv?"":"- - - - - - - - - - - - - aniOnScrollWrap skip:"+I+" "+R+" for muzlock:"+L.muzlock);else{f=I;a.vprint("anmt",vv?"":"- - - - - - - - - - - - - aniOnScrollWrap on:"+I+" "+R);var b=void 0,n=void 0,g=void 0,k=void 0,y=void 0,F=void 0,A=void 0,J=void 0,E=void 0,p=void 0,M=void 0;var l=[];var r=[],w=[],c={},B=$.extend({},m[f].numAbyTarget),t={},G={};var e=10 0;null== C[f]&&(C[f]={lastime:(new Date).getTime(),tiltG:0,tiltB:0,gpa:.5,num_group_mode:0});var x=X;if(null==z[f]||"scroll"==z[f]||"scroll_standard"==z[f]||"scroll_near_top"==z[f]){var u=$("#"+f.replace(/_svg$/,""));1>u.length&&a.vprint("warn",vv?"":"aniOnScroll did not find div:"+f.replace(/_svg$/,""));J=parseInt(u.offset().top);A=parseInt(u.height());F=parseInt($(window).height());y=parseInt($(window).width());k=J-x;g=F-k}var q=(new Date).getTime();u=q-C[f].lastime;C[f].lastime=q;if(null==z[f]||11 "scroll"==z[ f])J<F/2?(z[f]="scroll_near_top",e=0):(z[f]="scroll_standard",e=.2*A);if("scroll_standard"==z[f])p=a.d4(Math.min(1,(g-e)/F));else if("scroll_near_top"==z[f])p=a.d4(Math.min(1,x/(k+.6*A)));else if("mouse"==z[f])p=a.d4((g-e)/F),1.5>p&&0<p&&(p=a.d4(Math.min(1,da/y)));else if("tilt"==z[f])p=a.d4((g-e)/F),1.5>p&&0<p&&(window.matchMedia("only screen and (orientation:portrait)").matches?C[f].gpa=a.setVal(C[f].gpa,Z*Math.PI/180,0,1,a.setValMode.LIMIT):C[f].gpa=a.setVal(C[f].gpa,ea*Math.PI/180,12 0,1,a.setValMode.LIMIT),p=C[f].gpa);else if("music"==z[f]){var P=y=q=p=0,Q=0,K=!1,V=0,va=Math.max(15,C[f].num_group_mode);M=na;for(e=0;e<N;e++)255>aa[e]&&!K&&(K=!0,n=e),e>va+n&&15>aa[e]&&V++,l[e]=a.setVal(aa[e]/255,0,0,1,a.setValMode.LIMIT),r[e]=a.setVal(latestT[e]/255,0,0,1,a.setValMode.LIMIT),K&&3>V&&w.push(l[e]),Q=Math.max(Q,l[e]),p+=l[e],e<N/3?P+=l[e]:e<N/3+N/3?y+=l[e]:q+=l[e];c.ave=p/=N;c.max=Q;c.bass=P/(N/3);c.mid=y/(N/3);c.treb=q/(N/3);c["group mode"]=l}a.vprint("scrl",vv?"":"aniOnScroll - - - - "); 13 a.vprint("scrl",vv?"":"aniOnScroll - - - - START[ divid "+f+" ] event:"+R+" calc: "+z[f]+" found svgA?"+typeof svgA+" svgH.id:"+typeof W[f]);if("undefined"!=typeof gnlvSound&&gnlvSound.muted&&"music"==z[f])a.vprint("scrl",vv?"":"aniOnScroll MUTE abort");else{cur_t=eloop.anielapsed?eloop.anielapsed():L.anielapsed();for(b in m[f].slot)isVis=!0,e=m[f].slot[b],e.transO&&e.transO.slide&&e.transO.slide.startDelay&&e.transO.slide.duration&&("none"!=e.transO.slide.animateIn||10==e.transO.slide.addFade)?(a.vprint("scrl", 14 vv?"":"aniOnScroll slot["+b+"]transO?"+e.transO),start_t=e.transO.slide.startDelay,gofor="none"!=e.transO.slide.animateOut?e.transO.slide.animateOutPause+2*e.transO.slide.duration:T-start_t,m[f].slot[b].isVis=cur_t>start_t&&cur_t<start_t+gofor?!0:!1,a.vprint("scrl",vv?"":"aniOnScroll slot["+b+"]vis?"+m[f].slot[b].isVis)):a.vprint("scrl",vv?"":"aniOnScroll["+f+"] slot["+b+"] no trasO or not faded");a.vprint("scrl",vv?"":"aniOnScroll - - - - START[ divid "+f+" , "+z[f]+"] dt:"+u+" - - - divscroll:"+15 J+" h:"+A+" winscroll:"+x+" h:"+F+" x:"+da+" y:"+ma+" g:"+Z+" b:"+ea+"->"+k+" inverse:"+g+" %:"+p+" num ani:"+m[f].gnlvaniA.length);if(1>p&&0<p)for(e=J=0;e<m[f].gnlvaniA.length;e++){b=m[f].gnlvaniA[e];x=b.valsA.length;n=1;u=p;D="notsound";if("music"==z[f]&&b.music&&b.music.enable){if(b.music.keyoff&&c[b.music.keyoff]&&(u=c[b.music.keyoff],b.slot&&m[f].slot[b.slot]&&!1===m[f].slot[b.slot].isVis)){a.vprint("scrl",vv?"":"aniOnScroll skip ani:"+e);continue}D=b.music.drivemode;1<b.music.beatMultiple?k=16 a.setVal(M*b.music.beatMultiple,0,0,1,a.setValMode.LOOP):-1>=b.music.beatMultiple?(k=M/Math.abs(b.music.beatMultiple),ia&&(b.gpb+=b.mpAlongPrev),k=b.gpb+k,1<k&&(k=b.gpb=0)):k=M;k<b.mpAlongPrev?(b.mpPulse=.002*9,a.vprint("scrl",vv?"":"aniOnScroll * Pulse *")):b.mpPulse*=.6;b.mpAlongPrev=k;g=u>b.threshold?1:0;b.threshold=u>b.threshold?b.threshold+.005:b.threshold-.005;E=1*Math.cos(k*Math.PI*2)+1.2;"freqbar"==D?k=u:"waveform"==D?k=r[0]:"beat"!=D&&("beat with flow"==D?k=a.setVal(b.gpa, 17 b.mpPulse+.002,0,1,a.setValMode.LOOP):"beat against flow"==D?k=a.setVal(b.gpa,b.mpPulse+-.002,0,1,a.setValMode.LOOP):"freqbar with easeback"==D?k=a.setVal(Math.max(u,b.gpa),-.002,0,1,a.setValMode.LIMIT):"advance jumpy"==D?k=a.setVal(b.gpa,.002*g,0,1,a.setValMode.LOOP):"advance"==D?k=a.setVal(b.gpa,.002*u,0,1,a.setValMode.LOOP):"advance with easeback"==D&&(k=a.setVal(b.gpa,.006*g-.002,0,1,a.setValMode.LOOP)));if("group mode"==b.music.keyoff){g="freqbar"==D?w.length:N;F=C[f].num_group_mode<g?Math.round(g/ 18 C[f].num_group_mode):1;A=a.setVal(J*F,0,0,g,a.setValMode.LOOP);if("freqbar"==D)k=w[A];else if("waveform"==D)k=r[A];else{if(0==J){ba=[];for(u=C[f].num_group_mode-1;0<u;u--)m[f].gnlvaniA[e+u].twa=m[f].gnlvaniA[e+u-1].twa,ba[e+u]=m[f].gnlvaniA[e+u].twa;m[f].gnlvaniA[e].twa=a.d4(c.mid);m[f].gnlvaniA[e].twa=r[3];ba[e]=m[f].gnlvaniA[e].twa;a.vprint("scrl",vv?"":"aniOnScrol set T T T at ii="+e+" beat/pulse val:"+m[f].gnlvaniA[e].twa+" TWA "+a.dumpvar(ba))}k=m[f].gnlvaniA[e].twa}u=k;a.vprint("scrl", 19 vv?"":"aniOnScroll div:"+f+" GROUPMODE[ "+J+" of "+C[f].num_group_mode+" ] * binstep:"+F+" of max:"+g+"->dex"+A+" extracted gpA of:"+k);J++}a.vprint("scrl",vv?"":"aniOnScroll div:"+f+" MUSIC keyoff["+b.music.keyoff+"] % "+u+" drivemode["+D+"] durm?"+b.durm+" beatM:"+b.music.beatMultiple+" %> "+k);u=b.gpa=k}for(u=a.setVal(u*b.durm,0,0,1,a.setValMode.LOOP);b.timsA[n]<u&&n<x;)n++;k=b.timsA[n]-b.timsA[n-1];g=u-b.timsA[n-1];A=a.d4(g/k);g=b.type;F=b.valsA[n-1];k=b.valsA[n];q=F;y=k;P=A;Q=[];if("number"== 20 typeof q)q+=(y-q)*P;else if("object"==typeof q){q.length!=y.length&&a.vprint("scrl",vv?"":"X X X X X X X interpolate beg end LENGTH mismatch:"+q.join("|")+":"+y.join("|"));for(l=0;l<q.length;l++)"number"==typeof q[l]?Q.push(q[l]+(y[l]-q[l])*P):(q[l]!=y[l]&&a.vprint("scrl",vv?"":"X X X X X X X interpolate beg end mismatch:"+q[l]+":"+y[l]),Q.push(q[l]));q=Q.join(",")}else a.vprint("warn","interpolate bad type:"+typeof q),q=void 0;l=b.mytargetid;a.vprint("scrl",vv?"":"aniOnScroll["+e+"] [type: "+g+" ][drive: "+ 21 D+" ] numvals:"+x+" aBYtran["+l+"]:"+(B[l]-1)+" "+m[f].gnlvaniA[e].attributeName+" gpAlongS:"+p+" gpAlong:"+u+" lpAlong:"+A+" times:"+b.timsA+" vals:"+b.valsA+" dex:"+n+",beg,end:"+F+"|"+k+" now:"+q);if(null!=b.keyPoints)point=Snap.path.getPointAtLength(b.pathd,q*b.zlen),"auto"!=b.rotate&&"auto-reverse"!=b.rotate||null==b.prevpoint?b.prevpoint=point:(theta=Math.atan2(point.y-b.prevpoint.y,point.x-b.prevpoint.x),G[l]=180*theta/Math.PI,"auto-reverse"==b.rotate&&(G[l]+=180)),a.vprint("scrl",vv?"":"aniOnScroll["+ 22 e+"] for keyPoint:"+q+" got:"+point.x+","+point.y+" add2rotate:"+G[l]),q=point.x+","+point.y;else if(null!=G[l]&&"rotate"==g)a.vprint("scrl",vv?"":"aniOnScroll["+e+"] combine rotate:"+q+" and autorotate:"+G[l]),q+=G[l];else if("d"==b.attributeName)q=q.replace(/,?([a-zA-Z]),?/g," $1 "),a.vprint("scrl",vv?"":"aniOnScroll["+e+"] - - - - CLEANED - - - - up d valstr:"+q);else if(!b.attributeName.match(/(stroke-|fill-)/))if(b.attributeName.match(/(stop-color|fill|stroke|flood-color)/)){valstrA=q.split(/,/); 23 for(hh=0;3>hh;hh++)x=Number(a.setVal(Math.round(valstrA[hh]),0,0,255,a.setValMode.LIMIT)).toString(16),valstrA[hh]=2==x.length?x:"0"+x;q="#"+valstrA.join("");a.vprint("scrl",vv?"":"aniOnScroll["+e+"] cleaned up color valstr:"+q)}else"string"==typeof q&&(q=q.replace(/,([%])/g,"$1"));if("transform"==b.attributeName)if(B[l]--,ja.transform(g+"("+q+")"),x=ja.transform().localMatrix,null==t[l]&&(t[l]=[]),0==B[l]){t[l].push(x);"sum"==b.additive&&t[l].push(b.lmatrix.clone());a.vprint("scrl",vv?"":"aniOnScroll["+ 24 e+"] - APPLY - matrix["+l+"]: num"+t[l].length+" slot:"+b.slot+" kind:"+b.kind+" type:"+b.type);if("path"!=b.kind)if("slide"==b.kind)"scale"==b.type||"rotate"==b.type&&3>t[l].length||"rotate"==b.type&&3>=t[l].length&&b.slot.match(/^image/)?t[l]=t[l].reverse():2<t[l].length&&(first1=t[l].shift(),t[l]=t[l].reverse(),t[l].unshift(first1));else if("patternTransform"==b.realattributeName||"intrinsic"==b.kind&&"rotate"==b.type)t[l]=t[l].reverse();x=new Snap.Matrix;for(n=0;n<t[l].length;n++)x.add(t[l][n]);25 b.mytarget.transform( x)}else t[l].push(x);else"currentTime"==b.attributeName?0==ha%5&&(a.vprint("scrl",vv?"":"aniOnScroll["+e+"]["+ha+"] V I D E O [ "+m[f].gnlvaniA[e].attributeName+" ]-> "+q+" cpAlong:"+E),la?b.mytarget.node.fastSeek?b.mytarget.node.fastSeek(q):(la=!1,b.mytarget.node.play()):b.mytarget.node.playbackRate=E):"gradientTransform"==b.attributeName?(x=m[f].gnlvaniA[e].type+"("+q+")",b.mytarget.attr(x),a.vprint("scrl",vv?"":"aniOnScroll["+e+"] [ "+m[f].gnlvaniA[e].attributeName+26 " type:"+m[ f].gnlvaniA[e].type+" ]-> "+x)):(b.mytarget.attr(b.attributeName,q),a.vprint("scrl",vv?"":"aniOnScroll["+e+"] [ "+m[f].gnlvaniA[e].attributeName+" ]-> "+q));"patternTransform"==b.realattributeName&&(a.vprint("scrl",vv?"":"aniOnScroll["+e+"] patternTransform updated id:"+b.realtarget.attr("id")+" with val:"+q),b.realtarget.transform(b.mytarget.transform().localMatrix))}ia=!1}}fa=!1};this.anielapsed=function(d){var h="default";"undefined"!=typeof gnlvScroll&&(h=gnlvScroll.changeDiv());27 var b=window.gnlv_start_time&&null!=window.gnlv_start_time[ h]?window.gnlv_start_time[h]:L.ani_start_timestamp,n=(Date.now()-b)/1E3;if("absolute"==d)return n;d=a.setVal(n,0,0,T,a.setValMode.LOOP);a.vprint("scrl",vv?"":"anielapsed["+h+"] atime:"+T+" starttimestamp:"+b+" delta:"+n+" return:"+d);return d};this.resetTransforms=function(d){var h=0;null!=d&&L.changeDiv(d);a.vprint("scrl",vv?"":"resetTransforms start on["+f+"] "+(null!=m[f]));for(d=0;d<m[f].gnlvaniA.length;d++){var b=m[f].gnlvaniA[d];a.vprint("scrl",28 vv?"":"resetTransforms ["+d+"] id:"+b.id+" type:"+b.type+" have orig tran?"+b.origtransform+" target?"+(null!=b.mytarget));b.origtransform&&b.mytarget&&( h++,b.mytarget.transform(b.origtransform))}a.vprint("scrl",vv?"":"resetTransforms checking reset "+h+" of "+m[f].gnlvaniA.length)};var ca=function(d,h){for(var b,n,g,k=d.split(h),y=0;y<k.length;y++)b=k[y].match(/(,\s*|\s+)/),n=k[y].match(/[a-zA-Z%]/),g=k[y].match(/#/),b?k[y]=ca(k[y],b[0]):g?(diskula=k[y].replace(/#/,""),k[y]=[parseInt(diskula.substr(0,29 2),16),parseInt(diskula.substr(2,2),16),parseInt(diskula.substr(4,2),16)]):n||( k[y]=a.d4(k[y]));return k},wa=function(d){a.vprint("scrl",vv?"":"parseSplines starting on:"+a.dumpvar(d));d.valsA=ca(d.values,/\s*;\s*/);var h=d.valsA.length;if(null!=d.keyTimes)var b=ca(d.keyTimes,/\s*;\s*/);else{var n=[0];for(b=1;b<h;b++)n[b]=Math.min(1,n[b-1]+1/(h-1));b=n}d.timsA=b;if(null!=d.keySplines)h=ca(d.keySplines,/\s*;\s*/);else{n=[];var g=[0,0,1,1];for(b=1;b<h;b++)n.push(g);h=n}d.splsA=h;return d};this.doSetup=30 function(d){var h="FROMDIV .gnlv-scroll, FROMDIV .gnlv-mouse, FROMDIV .gnlv-music",b="id attributeName values type dur xlink:href calcMode repeatDur keyTimes keySplines keyPoints rotate additive".split(" "),n={};null==d&&(d={},z={},m={},C={});O=d.usemode?d.usemode:O;h=null==d.fromdiv?h.replace(/FROMDIV/g,""):h.replace(/FROMDIV/g,"#"+d.fromdiv);var g=Snap.selectAll(h);a.vprint("scrl",vv?"":"scrollSetup - - - -doSetup - - - - START usemode:"+O+" - - -fromdiv?"+d.fromdiv+" on num:"+g.length);for(v=0;v<31 g.length;v++){var k={};h=!1;var y,F;if("edit"==O)mydivid="default";else if(mydivid=g[v].attr("id"),null==mydivid||null!=W[mydivid])mydivid=null==d.fromdiv?"svg"+v:d.fromdiv+"_svg",a.vprint("scrl",vv?"":"scrollSetup - - - -id missing or not unique, newid > "+mydivid+" <"),g[v].attr("id",mydivid);m[mydivid]={};m[mydivid].slot={};m[mydivid].gnlvaniA=[];m[mydivid].numAbyTarget={};g[v].started=!1;g[v].hasClass("gnlv-scroll")?S="scroll":g[v].hasClass("gnlv-mouse")?S="mouse":g[v].hasClass("gnlv-music")&&32 ( S="music");a.vprint("scrl",vv?"":"scrollSetup - - - -doSetup - - - - START svgA["+v+"] divid[ "+mydivid+" ] ,anitype:"+S);null==C[mydivid]&&(C[mydivid]={lastime:(new Date).getTime(),tiltG:0,tiltB:0,gpa:.5});C[mydivid].num_group_mode=0;var A=!1;if(g[v].hasClass("gnlv-music")){A=!0;"undefined"==typeof eloop&&(eloop={});eloop.templatediv=g[v].parent().attr("id");eloop.templatediv||(eloop.templatediv="tempid"+Math.floor(1E4*Math.random()),a.vprint("scrl",vv?"":"scrollSetup no id on templatediv, setting now"),33 g[v].parent().attr("id",eloop.templatediv));var J=g[v].select(".gnlv-slot-template");if(J&&J.attr){var E=J.attr("gnlv-data");a.vprint("scrl",vv?"":"TEMPLATE DATA:"+E);E=a.parsejson(E);E.music&&E.music.mp3?g[v].tlmusic=E.music.mp3:a.vprint("warn","scrollSetup found no mp3!");T!=E.atime&&(a.vprint("warn","scrollSetup found atime missmatch!"+T+"< going with:>"+E.atime),T=E.atime?E.atime:T)}a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching MUSIC | | | | | | | | |divid: "+mydivid+" templatediv:"+34 eloop.templatediv+" tlmusic:"+g[v].tlmusic);"undefined"==typeof gnlvSound&&"undefined"!=typeof GenolveSound?(a.vprint("scrl",vv?"":"scrollSetup X X X NO snd gnlvSound but had CLAS, instantiate now"),gnlvSound=new GenolveSound({vpr:a}),document.gnlvSound=gnlvSound,volControl=document.gnlvSound.addVol(J)):H&&H.volel&&(a.vprint("scrl",vv?"":"scrollSetup registro vol:"+H.volel),volControl=gnlvSound.registerVol(H.volel));z[mydivid]="music";eloop.autoResize=eloop.autoResizeSnd?eloop.autoResizeSnd:function(){console.log("gnlvScroll X X X non eloop autoResizeSnd ")}; 35 eloop.autoResize() }a.vprint("scrl",vv?"":"scrollSetup START with num SVG["+v+"] tag >"+mydivid+"< of "+g.length+" -------------------------------------------------vv--------------------");var p=g[v].selectAll("g[id=hiddenslotsubnode]");1>p.length?a.vprint("warn","scrollSetup did not find hiddenslotsubnode for:"+mydivid):ja=p[0];g[v].selectAll(".gnlv-slot-eloop").forEach(function(P,Q){var K=P.attr("id");E=P.attr("gnlv-data");if(K.match(/.*hidden.*/)||null==E)a.vprint("scrl",vv?"":"scrollSetup skip datagnlv for slot["+36 K+"] ");else{a.vprint("scrl",vv?"":"SLOT [ "+K+" ] DATA:"+E);r=a.parsejson(E);if(null!=r.usetagID)for(I in r.usetagID){var V=r.usetagID[I];k[V]=K;V.match(/\d$/)&&(k[V.replace(/\d+$/,"N")]=K);("imgcorner"==I||"imgmask"==I)&&(y=g[v].select("#"+V))&&y.parent()&&y.parent().parent()&&(F="imgcorner"==I?y.parent().parent().attr("id"):y.parent().attr("id"),a.vprint("scrl",vv?"":"["+I+"] tagged:"+F),k[F]=K)}null==m[mydivid].slot[K]?m[mydivid].slot[K]=r:a.vprint("warn","scrollSetup slot["+K+"] not empty! mydata already logged??????")}});37 var M=g[v].select("#theoverlayVid");"undefined"!=typeof eloop&&eloop.rmVidTimer?eloop.rmVidTimer(J):M&&M.remove();M=g[v].selectAll("animate,animateTransform,animateMotion");a.vprint("scrl",vv?"":"scrollSetup START looping animations["+mydivid+"] -- - - -- "+M.length);for(var l in m[mydivid].slot){var r=m[mydivid].slot[l];if(r.transO&&r.transO.music&&r.transO.music.enable&&"video"==r.transO.music.whichani)for(videlA=g[v].selectAll("#"+l+" video"),a.vprint("scrl",vv?"":"scrollSetup > videojog < for slot["+38 l+"] numel:"+videlA.length),p=0;p<videlA.length;p++)videlA[p].attr("id","anivid"+Math.floor(1E4*Math.random())),M.push(videlA[p])}for(U=0;U<M.length;U++){var w=M[U],c={};var B=w.parent();p=w.attr("id");null==p&&(p="anmttemp"+Math.floor(1E4*Math.random()),w.attr("id",p));var t=p.match(/^aniusr/)?"slide":p.match(/^anipth/)?"path":p.match(/^anmt/)?"intrinsic":p.match(/^anifal/)?"fallingeffect":p.match(/^anivid/)?"video":"unknown";a.vprint("scrl",vv?"":"scrollSetup ======== start["+U+"]["+p+"]"+t);var G=39 B.attr("id")?B.attr("id"):"none",e=x,x=B,u=x.attr?x.attr("id"):"nada";if("vidtimer"!=p&&"marqSOani"!=p&&"timekeeperani"!=p){for(;x.parent()&&x.parent().attr&&!x.hasClass("gnlv-slot-eloop")&&!x.hasClass("gnlv-svg");)e=x,x=x.parent(),u=x.attr("id")?x.attr("id"):"nada";if("hiddenslot"==u||x.hasClass("gnlv-svg"))a.vprint("scrl",vv?"":"scrollSetup found hidden, SKIP:"+p+":");else{if("hiddenslotdefs"==u){e=e.attr("id");if(k[e])u=k[e];else if(k[e.replace(/\d+$/,"N")])u=k[e.replace(/\d+$/,"N")];else{a.vprint("scrl",40 vv?"":"X SKIP X hiddenslot lookup fail on key:"+ e+" for hsd2slot hash:"+a.dumpvar(k));continue}r=m[mydivid].slot[u];a.vprint("scrl",vv?"":"scrollSetup hiddenslotdefs translate for["+e+"]->"+u)}else m[mydivid].slot[u]?r=m[mydivid].slot[u]:a.vprint("scrl",vv?"":"scrollSetup X X X X X X no slot data/mydata for "+u);e=r&&r.transO&&r.transO.music&&r.transO.music.whichani?r.transO.music.whichani:"all";var q=r&&r.transO&&r.transO.music&&r.transO.music.enable?r.transO.music.enable:!1;a.vprint("scrl",vv?41 "":"scrollSetup ======== start["+U+"]["+ p+"]["+u+"] enabled?"+q+" have parent?"+(null!=B)+" id:"+G+" type:"+B.node.localName+" > "+w.node.tagName);if(null!=w.attr("begin")&&!w.attr("begin").match(/theoverlayVid/))a.vprint("warn","scrollSetup skip element with begin, id:"+w.attr("id")+" attr:"+w.attr("attributeName"));else if(null!=w.attr("from")&&null==w.attr("values"))a.vprint("warn","scrollSetup skip element with from to, id:"+w.attr("id")+" attr:"+w.attr("attributeName"));else if("handwave"!=42 G&&"helpinghand"!=G)if(B.attr("xlink:href")&&B.attr("xlink:href").match(/^#bird/))a.vprint("scrl",vv?"":"scrollSetup SKIP this xlink:"+B.attr("xlink:href"));else if(A&&("slide"==e&&"slide"!=t||"path"==e&&"path"!=t||"intrinsic"==e&&"intrinsic"!=t||"fallingeffect"==e&&"fallingeffect"!=t||"video"==e&&"video"!=t))a.vprint("scrl",vv?"":"scrollSetup SKIP, bad match with whichani:"+e+" me:"+t);else if(A&&!q)a.vprint("scrl",vv?"":"scrollSetup SKIP, music not enabled");else if(!A&&r.transO&&r.transO.sound&&43 0== r.transO.sound.enable&&"scroll"!=S)a.vprint("scrl",vv?"":"scrollSetup SKIP, sound not enabled");else if(A&&q&&"slide"==t&&r.transO.music.drivemode.match(/(freqbar|waveform)/)&&"group mode"==r.transO.music.keyoff&&"opacity"==w.attr("attributeName"))a.vprint("scrl",vv?"":"scrollSetup SKIP, opacity for slide freqbar group mode");else{c.slot=u;c.kind=t;A&&r.transO&&r.transO.music&&(c.music=$.extend({},r.transO.music),c.sound=$.extend({},r.transO.sound),c.gpa=0,c.twa=0,c.gpb=0,c.threshold=.5,c.mpPulse=44 0,c.order=-1); r.transO&&r.transO.group&&(c.apply2group=r.transO.group.apply2group);for(p=0;p<b.length;p++)c[b[p]]=w.attr(b[p]);"video"==c.kind&&(c.values=w.attr("data-vbeg")+";"+w.attr("data-vend"),c.dur=w.attr("data-vend")-w.attr("data-vbeg"),c.repeatDur="indefinite",c.kind="video",c.attributeName="currentTime",la&&(w.attr("data-vres","never"),w.node.pause()),a.vprint("scrl",vv?"":"scrollSetup videojog params now:"+a.dumpvar(c)));if(w.attr("origid")||B.attr("origid"))h=!0,c.order=w.attr("origid")||45 B.attr("origid");"feColorMatrix"==B.node.localName&&(c.type="feColorMatrix");if("rotate"==c.type||"d"==c.attributeName||"feColorMatrix"==c.type)c.values=c.values.replace(/\s*;\s*/g,";").replace(/\s+$/,"").replace(/([a-yA-Y])/g,"$1 ").replace(/\s+/g,",").replace(/,,/g,",").replace(/[,;]$/,""),a.vprint("scrl",vv?"":"scrollSetup CLEANED UP rotate/d values:"+c.values);"feColorMatrix"==c.type&&(c.values=c.values.replace(/\r\n/g,""));c.attributeName&&c.attributeName.match(/(stop-color|fill|stroke|flood-color|d)/)||46 !c.values||(c.values=c.values.replace(/([a-zA-Z%])/g,",$1"));null!=c.keyPoints&&(c.values=c.keyPoints,thepathid= w.select("mpath").attr("xlink:href"),pathd=g[v].select(thepathid),a.vprint("scrl",vv?"":"aniOnScroll aniMo pathid:"+thepathid+" found it?"+pathd),null!=pathd&&(c.pathd=pathd.attr("d"),c.zlen=Snap.path.getTotalLength(c.pathd),c.attributeName="transform",c.type="translate",c.kind="path"));c=wa(c);c.durm=T/parseFloat(c.dur);A&&(c.durm=1,r.transO&&r.transO.music&&r.transO.music.enable&&("slide"==47 t&&r.transO.music.drivemode.match(/(freqbar|waveform)/)&&"group mode"==r.transO.music.keyoff&&(c.skipPause=!0,junk=c.timsA.shift(),junk=c.valsA.shift(),1<c.timsA.length&&(junk=c.timsA.pop(),junk=c.valsA.pop()),c.timsA[0]=0,c.timsA[c.timsA.length-1]=1,a.vprint("scrl",vv?"":" drivemode freqbarmod valsA now:"+c.valsA+" timsA:"+c.timsA)),a.vprint("scrl",vv?"":" drivemode:"+D+","+r.transO.music.drivemode),r.transO.music.drivemode.match(/^beat/)&&(ka=!0),"group mode"==r.transO.music.keyoff&&C[mydivid].num_group_mode++,48 null==m[mydivid].slot[c.slot].started?( g[v].tlmusic?a.vprint("scrl",vv?"":"scrollSetup have tlmusic SKIP paramO file ["+c.sound.snd+"]!!!!!"):(a.vprint("scrl",vv?"":"scrollSetup START paramO music["+c.sound.snd+"] !!!!!"),gnlvSound.start(c.sound)),a.vprint("scrl",vv?"":"scrollSetup TODO beat or headless per sound"),m[mydivid].slot[c.slot].started=!0):a.vprint("scrl",vv?"":"scrollSetup sound["+c.sound.snd+"] already started")));a.vprint("scrl",vv?"":"scrollSetup paramO [ "+U+" ] : "+a.dumpvar(c));49 a.vprint("scrl",vv?"":"scrollSetup paramO------------------------------");c.mytarget=c["xlink:href"]? g[v].select(c["xlink:href"]):"video"==c.kind?w:B;t=c.mytargetid=c.mytarget.attr("id");null==t&&(t=c.mytargetid="temp"+Math.floor(1E4*Math.random()),a.vprint("scrl",vv?"":"scrollSetup no id for animate target! setting now:"+t),c.mytarget.attr?c.mytarget.attr("id",t):a.vprint("warn","scrollSetup failed to set id"));"transform"==c.attributeName&&(c.mytarget&&"function"==typeof c.mytarget.transform&&"symbol"!=50 B.node.localName?c.lmatrix=c.mytarget.transform().localMatrix:(a.vprint("scrl",vv?"":"scrollSetup X X X no transform off["+c.id+"]:target:"+c.mytarget+" fake it"),c.lmatrix=new Snap.Matrix),null!=c.keyPoints&&"matrix(1,0,0,1,0,0)"!=c.lmatrix.toString()&&(a.vprint("scrl",vv?"":"scrollSetup X X X aniMo initial transform NOT OK:"+c.lmatrix.toString()),c.mytarget.transform("matrix(1,0,0,1,0,0)")),m[mydivid].numAbyTarget[t]=null==m[mydivid].numAbyTarget[t]?1:m[mydivid].numAbyTarget[t]+1);"patternTransform"==51 c.attributeName&&( B=c.mytarget.attr("patternTransform"),a.vprint("scrl",vv?"":"scrollSetup patternTransform attr:"+c.mytarget.attr("patternTransform")+" parentid:"+G+" lmat:"+B+" type:"+c.type),c.realtarget=c.mytarget,p=g[v].selectAll("g[id=hiddenslotdefssubnode]"),1>p.length?a.vprint("warn","scrollSetup patternTransform did not find hiddenslotdefssubnode"):(c.mytarget=p[0],c.mytarget.transform(B),c.lmatrix=c.mytarget.transform().localMatrix.clone(),a.vprint("scrl",vv?"":"scrollSetup patternTransform proxy setup with transform:"+52 c.lmatrix),c.realattributeName=c.attributeName,c.attributeName="transform", t=G,m[mydivid].numAbyTarget[t]=null==m[mydivid].numAbyTarget[t]?1:m[mydivid].numAbyTarget[t]+1));null==n[t]&&(n[t]={});G=c.realattributeName?c.realattributeName:c.attributeName;"currentTime"!=G&&(n[t][G]=1,w.node.setAttribute("fill","remove"),"idle2play"==O?(w.attr("repeatDur","indefinite"),w.node.setAttribute("fill","remove")):w.attr("repeatDur",1E-6),c.lmatrix&&c.mytarget&&(c.origtransform=c.lmatrix.toString()+"",c.mytarget.attr("data-transform",53 c.origtransform)));c.myself= w;m[mydivid].gnlvaniA.push(c)}}}}1==h&&(a.vprint("scrl",vv?"":"scrollSetup SPECIAL SORT!"),m[mydivid].gnlvaniA.sort(function(P,Q){return parseFloat(P.order)-parseFloat(Q.order)}));a.vprint("scrl",vv?"":"scrollSetup ======== vv ============================== vv");a.vprint("scrl",vv?"":"scrollSetup ======== setup scroll for num animations:"+m[mydivid].gnlvaniA.length+" ID:"+mydivid);a.vprint("scrl",vv?"":"scrollSetup ======== last drivemode:"+D+" found_beat?"+ka);a.vprint("scrl",54 vv?"":"scrollSetup ======== willchange list:"+a.dumpvar(n)); g[v].tlmusic&&0==g[v].started?(gnlvSound.doplots=!1,D.match(/^beat/)||ka?gnlvSound.ana("onbeat"):gnlvSound.ana("headless"),h={enable:!0,snd:"tlmusic",pl:mydivid,playmode:"continuous",do3d:!1,file:g[v].tlmusic,usemode:O},myvol=g[v].select("#vol_on_off"),a.vprint("scrl",vv?"":"scrollSetup ======= M U S I C ======= PRELOAD top level music vol?"+typeof myvol+" file:"+a.dumpvar(h)+" ======== !!!!!"),myvol&&myvol.attr&&(volver=myvol.attr("data-ver"),55 myvol.attr("data- target",mydivid),h.volel=myvol,myvol.parent()&&myvol.parent().select("#timekeeperani")&&myvol.parent().select("#timekeeperani").attr("data-target",mydivid)),"idle2play"==O?gnlvSound.preload(h):gnlvSound.start(h),g[v].started=!0,gnlvSound.muteTrans=L.resetTransforms):a.vprint("scrl",vv?"":"scrollSetup ======== NO top level music defined");for(I in n)if(h=Object.keys(n[I]).join(","),A=g[v].select("#"+I))A.node.style.willChange=h;"scroll"==S?(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching SCROLL | | | | | | | | | "+56 mydivid),z[mydivid]="scroll",$(window).off("scroll.genolve"),$(window).on("scroll.genolve",{value:mydivid},ra)):"mouse"==S?a.getBrowser("isMobile")?(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching TILT | | | | | | | | | "+mydivid),z[mydivid]="tilt",f=mydivid,window.addEventListener("devicemotion",qa,!1)):(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching MOUSE | | | | | | | | | "+mydivid),z[mydivid]="mouse",$(window).off("mousemove.genolve"),$(window).on("mousemove.genolve", 57 {value:mydivid},pa)):"music"==S?(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching MUSIC | | | | | | | | | ID:"+mydivid+" interval->20"),z[mydivid]="music",f=mydivid,"idle2play"==O&&(gnlvSound.muteExtra&&a.vprint("warn",vv?"":"scrollSetup setting muteExtra toggleMuzPause but not null:"+gnlvSound.muteExtra),gnlvSound.muteExtra=L.toggleMuzPause,gnlvSound.playExtra&&a.vprint("warn",vv?"":"scrollSetup setting playExtra toggleMuzPlay but not null:"+gnlvSound.playExtra),gnlvSound.playExtra= 58 L.toggleMuzPlay),document.gnlv_ana_interval=window.setInterval(sa,20),$(window).off("beat"),$(window).on("beat",ua)):a.vprint("scrl",vv?"":"scrollSetup NO ANITYPE no scroll flages detected");W[mydivid]=g[v]}a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | setup done");a.vprint("scrl",vv?"":"scrollSetup | | | | |");"undefined"!=typeof eloop&&eloop.mkVidtimer&&"edit"==O&&(a.vprint("scrl",vv?"":"scrollSetup | | mkVidtimer"),eloop.mkVidtimer())};H&&"minimal"==H.usemode||L.doSetup();"stub"==eloop.version&& 59 null==eloop.anielapsed&&(eloop.anielapsed=this.anielapsed)};1 GenolveScroll=function(J){function qa(d,l){O="mouse";X=window.scrollY;da=d.pageX;ma=d.pageY;Y(d,l)}function ra(d,l){O="tilt";X=window.scrollY;Z=d.gamma;Z=d.accelerationIncludingGravity?d.accelerationIncludingGravity.x:0;ea=d.beta;d.data={};d.data.value=e;Y(d,l)}function sa(d,l){O="scroll";X=window.scrollY;Y(d,l)}function ta(d,l){O="music";if(d=gnlvSound.getAna())aa=d.data.freq,latestT=d.data.time,N=d.data.size,na=d.data.metro,d.data.value=e,Y(d,l)}function Y(d,l){fa||(e=d.data.value,requestAnimationFrame(ua), 2 ha++);fa=!0}var L=this;this.ver="2.0.0";var ba=[],z={},V={},m={},E={},P,da=0,ma=0,Z=0,ea=0,aa=0,N=0,na=0,r=0,U,K,e,O,ha=0,ia=!1,ja,F="notset",ka=!1,la=!0,W={};this.ani_start_timestamp=Date.now();this.muzlock="none";"object"!=typeof window.gnlv_start_time&&(window.gnlv_start_time={"default":L.ani_start_timestamp});null==$&&($=jQuery);if(J&&J.vpr)var a=J.vpr;var M=J&&J.usemode?J.usemode:"edit",Q=J&&J.atime?J.atime:15;null==a&&(a={name:"scroll-vpr-stub",vprint:function(d,l){vv||console.log(l)},dumpvar:function(d){return JSON.stringify(d)}, 3 d0:function(d){d=String(d).replace(/[^0-9\-\.]/g,"");return Math.round(parseFloat(d))},dd:function(d){return Math.round(100*parseFloat(d))/100},ddd:function(d){return Math.round(1E3*parseFloat(d))/1E3},d4:function(d){return Math.round(1E4*parseFloat(d))/1E4},keeptime:function(d){var l="default";d&&d.getAttribute("data-target")&&(l=d.getAttribute("data-target"));"object"!=typeof window.gnlv_start_time&&(window.gnlv_start_time={});window.gnlv_start_time[l]=Date.now()},parsejson:function(d){try{return JSON.parse(d.replace(/'/g, 4 '"'))}catch(l){alert("JSON parse error on["+d+"]:"+l)}},getBrowser:function(){var d=!1,l=navigator.userAgent||navigator.vendor||window.opera;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(l)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(l.substr(0, 5 4)))d=!0;return d},setValMode:{LOOP:"LOOP",LOOPz:"LOOPz",LOOPtoBOUND:"LOOPtoBOUND",LIMIT:"LIMIT",RANDOM:"RANDOM",MIDNORM:"MIDNORM",LOWNORM:"LOWNORM",HINORM:"HINORM"},setVal:function(d,l,b,n,k){if(isNaN(d)||!isFinite(d))return n;b=parseFloat(b);n=parseFloat(n);if(b>n){var g=n;n=b;b=g}g=n-b;g=k==this.setValMode.LOOPz?g+1:g;d=isNaN(d)?0:parseFloat(d);l=isNaN(l)?1:parseFloat(l);d+=l;if(d>n)if(k==this.setValMode.LIMIT)d=n;else if(k==this.setValMode.LOOPtoBOUND)d=b;else if(k==this.setValMode.LOOP||k==this.setValMode.LOOPz)for(;d> 6 n;)d-=g;else console.warn("GNLV_UTILS.setVal invalid setValMode:"+k+" must be LOOP/LIMIT/RANDOM");else if(d<b)if(k==this.setValMode.LIMIT)d=b;else if(k==this.setValMode.LOOPtoBOUND)d=n;else if(k==this.setValMode.LOOP||k==this.setValMode.LOOPz)for(;d<b;)d+=g;else console.warn("GNLV_UTILS.setVal invalid setValMode:"+k+" must be LOOP/LIMIT/RANDOM");return d}});a.vprint("scrl"," - = ");a.vprint("scrl"," - = CREATE gnlvScroll = - usemode:"+M+" vpr:"+a.name+" eloop:"+eloop.version);"stub"==eloop.version&& 7 a.keeptime&&(eloop.keeptime=a.keeptime);"function"==typeof GNLV_3RDPARTY&&null==eloop.tpr&&(a.vprint("scrl"," - = CREATE 3rdparty"),eloop.tpr=new GNLV_3RDPARTY(a,{name:"vekstub"},$));var X=0,fa=!1;this.changeDiv=function(d,l){if(null==d)return e;a.vprint("scrl",vv?"":" - = changeDiv "+e+" -> "+d+" muz:"+l);null==W[e]?a.vprint("scrl",vv?"":" - = changeDiv XXXX lookup fail"):(e=d,null!=l&&(L.muzlock="vol_on"==l?e:"none"))};var va=function(d,l){a.vprint("scrl",vv?"":" - = onBeat = - got event:"+ 8 d.type+","+d.keyoff+" num ani:"+m[e].gnlvaniA.length);ia=!0;gnlvSound.volColor()};this.toggleMuzPlay=function(){oa("play")};this.toggleMuzPause=function(){oa("pause")};var oa=function(d){var l;a.vprint("scrl",vv?"":"- = toggleMuz("+d+") for num ani:"+m[e].gnlvaniA.length);for(l=0;l<m[e].gnlvaniA.length;l++){paramO=m[e].gnlvaniA[l];var b=paramO.myself;"pause"==d?(b.attr("repeatDur","indefinite"),b.node.setAttribute("fill","remove")):b.attr("repeatDur",1E-6)}},ua=function(d,l){a.vprint("anmt",vv?"": 9 "- - - - - - - - - - - - - aniOnScrollWrap event:"+O);for(K in W)if(0===String(z[K]).indexOf(O))if("none"!=L.muzlock&&L.muzlock!=K)a.vprint("anmt",vv?"":"- - - - - - - - - - - - - aniOnScrollWrap skip:"+K+" "+O+" for muzlock:"+L.muzlock);else{e=K;a.vprint("anmt",vv?"":"- - - - - - - - - - - - - aniOnScrollWrap on:"+K+" "+O);var b=void 0,n=void 0,k=void 0,g=void 0,t=void 0,C=void 0,H=void 0,D=void 0,G=void 0,x=void 0,A=void 0;var f=[];var R=[],q=[],c={},w=$.extend({},m[e].numAbyTarget),y={},B={};var h= 10 0;null==E[e]&&(E[e]={lastime:(new Date).getTime(),tiltG:0,tiltB:0,gpa:.5,num_group_mode:0});var u=X;if(null==z[e]||"scroll"==z[e]||"scroll_standard"==z[e]||"scroll_near_top"==z[e]){var v=$("#"+e.replace(/_svg$/,""));1>v.length&&a.vprint("warn",vv?"":"aniOnScroll did not find div:"+e.replace(/_svg$/,""));D=parseInt(v.offset().top);H=parseInt(v.height());C=parseInt($(window).height());t=parseInt($(window).width());g=D-u;k=C-g}var p=(new Date).getTime();v=p-E[e].lastime;E[e].lastime=p;if(null==z[e]|| 11 "scroll"==z[e])D<.5*C?(z[e]="scroll_near_top",h=0,V[e]=H>C?.1:.6):(z[e]="scroll_standard",h=.2*H,V[e]=H>C?.6:1);if("scroll_standard"==z[e])x=a.d4(Math.min(1,(k-h)/C*V[e]));else if("scroll_near_top"==z[e])x=a.d4(Math.min(1,u/(g+H*V[e])));else if("mouse"==z[e])x=a.d4((k-h)/C),1.5>x&&0<x&&(x=a.d4(Math.min(1,da/t)));else if("tilt"==z[e])x=a.d4((k-h)/C),1.5>x&&0<x&&(window.matchMedia("only screen and (orientation:portrait)").matches?E[e].gpa=a.setVal(E[e].gpa,Z*Math.PI/180,0,1,a.setValMode.LIMIT):E[e].gpa= 12 a.setVal(E[e].gpa,ea*Math.PI/180,0,1,a.setValMode.LIMIT),x=E[e].gpa);else if("music"==z[e]){var S=t=p=x=0,I=0,T=!1,pa=0,wa=Math.max(15,E[e].num_group_mode);A=na;for(h=0;h<N;h++)255>aa[h]&&!T&&(T=!0,n=h),h>wa+n&&15>aa[h]&&pa++,f[h]=a.setVal(aa[h]/255,0,0,1,a.setValMode.LIMIT),R[h]=a.setVal(latestT[h]/255,0,0,1,a.setValMode.LIMIT),T&&3>pa&&q.push(f[h]),I=Math.max(I,f[h]),x+=f[h],h<N/3?S+=f[h]:h<N/3+N/3?t+=f[h]:p+=f[h];c.ave=x/=N;c.max=I;c.bass=S/(N/3);c.mid=t/(N/3);c.treb=p/(N/3);c["group mode"]=f}a.vprint("scrl", 13 vv?"":"aniOnScroll - - - - ");a.vprint("scrl",vv?"":"aniOnScroll - - - - START[ divid "+e+" ] event:"+O+" calc: "+z[e]+" talldiv:"+V[e]+" found svgA?"+typeof svgA+" svgH.id:"+typeof W[e]);if("undefined"!=typeof gnlvSound&&gnlvSound.muted&&"music"==z[e])a.vprint("scrl",vv?"":"aniOnScroll MUTE abort");else{cur_t=eloop.anielapsed?eloop.anielapsed():L.anielapsed();for(b in m[e].slot)isVis=!0,h=m[e].slot[b],h.transO&&h.transO.slide&&h.transO.slide.startDelay&&h.transO.slide.duration&&("none"!=h.transO.slide.animateIn|| 14 10==h.transO.slide.addFade)?(a.vprint("scrl",vv?"":"aniOnScroll slot["+b+"]transO?"+h.transO),start_t=h.transO.slide.startDelay,gofor="none"!=h.transO.slide.animateOut?h.transO.slide.animateOutPause+2*h.transO.slide.duration:Q-start_t,m[e].slot[b].isVis=cur_t>start_t&&cur_t<start_t+gofor?!0:!1,a.vprint("scrl",vv?"":"aniOnScroll slot["+b+"]vis?"+m[e].slot[b].isVis)):a.vprint("scrl",vv?"":"aniOnScroll["+e+"] slot["+b+"] no trasO or not faded");a.vprint("scrl",vv?"":"aniOnScroll - - - - START[ divid "+ 15 e+" , "+z[e]+"] dt:"+v+" - - - divscroll:"+D+" h:"+H+" winscroll:"+u+" h:"+C+" x:"+da+" y:"+ma+" g:"+Z+" b:"+ea+"->"+g+" inverse:"+k+" %:"+x+" num ani:"+m[e].gnlvaniA.length);if(1>x&&0<x)for(h=D=0;h<m[e].gnlvaniA.length;h++){b=m[e].gnlvaniA[h];u=b.valsA.length;n=1;v=x;F="notsound";if("music"==z[e]&&b.music&&b.music.enable){if(b.music.keyoff&&c[b.music.keyoff]&&(v=c[b.music.keyoff],b.slot&&m[e].slot[b.slot]&&!1===m[e].slot[b.slot].isVis)){a.vprint("scrl",vv?"":"aniOnScroll skip ani:"+h);continue}F= 16 b.music.drivemode;1<b.music.beatMultiple?g=a.setVal(A*b.music.beatMultiple,0,0,1,a.setValMode.LOOP):-1>=b.music.beatMultiple?(g=A/Math.abs(b.music.beatMultiple),ia&&(b.gpb+=b.mpAlongPrev),g=b.gpb+g,1<g&&(g=b.gpb=0)):g=A;g<b.mpAlongPrev?(b.mpPulse=.002*9,a.vprint("scrl",vv?"":"aniOnScroll * Pulse *")):b.mpPulse*=.6;b.mpAlongPrev=g;k=v>b.threshold?1:0;b.threshold=v>b.threshold?b.threshold+.005:b.threshold-.005;G=1*Math.cos(g*Math.PI*2)+1.2;"freqbar"==F?g=v:"waveform"==F?g=R[0]: 17 "beat"!=F&&("beat with flow"==F?g=a.setVal(b.gpa,b.mpPulse+.002,0,1,a.setValMode.LOOP):"beat against flow"==F?g=a.setVal(b.gpa,b.mpPulse+-.002,0,1,a.setValMode.LOOP):"freqbar with easeback"==F?g=a.setVal(Math.max(v,b.gpa),-.002,0,1,a.setValMode.LIMIT):"advance jumpy"==F?g=a.setVal(b.gpa,.002*k,0,1,a.setValMode.LOOP):"advance"==F?g=a.setVal(b.gpa,.002*v,0,1,a.setValMode.LOOP):"advance with easeback"==F&&(g=a.setVal(b.gpa,.006*k-.002,0,1,a.setValMode.LOOP)));if("group mode"==b.music.keyoff){k="freqbar"== 18 F?q.length:N;C=E[e].num_group_mode<k?Math.round(k/E[e].num_group_mode):1;H=a.setVal(D*C,0,0,k,a.setValMode.LOOP);if("freqbar"==F)g=q[H];else if("waveform"==F)g=R[H];else{if(0==D){ba=[];for(v=E[e].num_group_mode-1;0<v;v--)m[e].gnlvaniA[h+v].twa=m[e].gnlvaniA[h+v-1].twa,ba[h+v]=m[e].gnlvaniA[h+v].twa;m[e].gnlvaniA[h].twa=a.d4(c.mid);m[e].gnlvaniA[h].twa=R[3];ba[h]=m[e].gnlvaniA[h].twa;a.vprint("scrl",vv?"":"aniOnScrol set T T T at ii="+h+" beat/pulse val:"+m[e].gnlvaniA[h].twa+" TWA "+a.dumpvar(ba))}g= 19 m[e].gnlvaniA[h].twa}v=g;a.vprint("scrl",vv?"":"aniOnScroll div:"+e+" GROUPMODE[ "+D+" of "+E[e].num_group_mode+" ] * binstep:"+C+" of max:"+k+"->dex"+H+" extracted gpA of:"+g);D++}a.vprint("scrl",vv?"":"aniOnScroll div:"+e+" MUSIC keyoff["+b.music.keyoff+"] % "+v+" drivemode["+F+"] durm?"+b.durm+" beatM:"+b.music.beatMultiple+" %> "+g);v=b.gpa=g}for(v=a.setVal(v*b.durm,0,0,1,a.setValMode.LOOP);b.timsA[n]<v&&n<u;)n++;g=b.timsA[n]-b.timsA[n-1];k=v-b.timsA[n-1];H=a.d4(k/g);k=b.type;C=b.valsA[n-1]; 20 g=b.valsA[n];p=C;t=g;S=H;I=[];if("number"==typeof p)p+=(t-p)*S;else if("object"==typeof p){p.length!=t.length&&a.vprint("scrl",vv?"":"X X X X X X X interpolate beg end LENGTH mismatch:"+p.join("|")+":"+t.join("|"));for(f=0;f<p.length;f++)"number"==typeof p[f]?I.push(p[f]+(t[f]-p[f])*S):(p[f]!=t[f]&&a.vprint("scrl",vv?"":"X X X X X X X interpolate beg end mismatch:"+p[f]+":"+t[f]),I.push(p[f]));p=I.join(",")}else a.vprint("warn","interpolate bad type:"+typeof p),p=void 0;f=b.mytargetid;a.vprint("scrl", 21 vv?"":"aniOnScroll["+h+"] [type: "+k+" ][drive: "+F+" ] numvals:"+u+" aBYtran["+f+"]:"+(w[f]-1)+" "+m[e].gnlvaniA[h].attributeName+" gpAlongS:"+x+" gpAlong:"+v+" lpAlong:"+H+" times:"+b.timsA+" vals:"+b.valsA+" dex:"+n+",beg,end:"+C+"|"+g+" now:"+p);if(null!=b.keyPoints)point=Snap.path.getPointAtLength(b.pathd,p*b.zlen),"auto"!=b.rotate&&"auto-reverse"!=b.rotate||null==b.prevpoint?b.prevpoint=point:(theta=Math.atan2(point.y-b.prevpoint.y,point.x-b.prevpoint.x),B[f]=180*theta/Math.PI,"auto-reverse"== 22 b.rotate&&(B[f]+=180)),a.vprint("scrl",vv?"":"aniOnScroll["+h+"] for keyPoint:"+p+" got:"+point.x+","+point.y+" add2rotate:"+B[f]),p=point.x+","+point.y;else if(null!=B[f]&&"rotate"==k)a.vprint("scrl",vv?"":"aniOnScroll["+h+"] combine rotate:"+p+" and autorotate:"+B[f]),p+=B[f];else if("d"==b.attributeName)p=p.replace(/,?([a-zA-Z]),?/g," $1 "),a.vprint("scrl",vv?"":"aniOnScroll["+h+"] - - - - CLEANED - - - - up d valstr:"+p);else if(!b.attributeName.match(/(stroke-|fill-)/))if(b.attributeName.match(/(stop-color|fill|stroke|flood-color)/)){valstrA= 23 p.split(/,/);for(hh=0;3>hh;hh++)u=Number(a.setVal(Math.round(valstrA[hh]),0,0,255,a.setValMode.LIMIT)).toString(16),valstrA[hh]=2==u.length?u:"0"+u;p="#"+valstrA.join("");a.vprint("scrl",vv?"":"aniOnScroll["+h+"] cleaned up color valstr:"+p)}else"string"==typeof p&&(p=p.replace(/,([%])/g,"$1"));if("transform"==b.attributeName)if(w[f]--,ja.transform(k+"("+p+")"),u=ja.transform().localMatrix,null==y[f]&&(y[f]=[]),0==w[f]){y[f].push(u);"sum"==b.additive&&y[f].push(b.lmatrix.clone());a.vprint("scrl", 24 vv?"":"aniOnScroll["+h+"] - APPLY - matrix["+f+"]: num"+y[f].length+" slot:"+b.slot+" kind:"+b.kind+" type:"+b.type);if("path"!=b.kind)if("slide"==b.kind)"scale"==b.type||"rotate"==b.type&&3>y[f].length||"rotate"==b.type&&3>=y[f].length&&b.slot.match(/^image/)?y[f]=y[f].reverse():2<y[f].length&&(first1=y[f].shift(),y[f]=y[f].reverse(),y[f].unshift(first1));else if("patternTransform"==b.realattributeName||"intrinsic"==b.kind&&"rotate"==b.type)y[f]=y[f].reverse();u=new Snap.Matrix;for(n=0;n<y[f].length;n++)u.add(y[f][n]); 25 b.mytarget.transform(u)}else y[f].push(u);else"currentTime"==b.attributeName?0==ha%5&&(a.vprint("scrl",vv?"":"aniOnScroll["+h+"]["+ha+"] V I D E O [ "+m[e].gnlvaniA[h].attributeName+" ]-> "+p+" cpAlong:"+G),la?b.mytarget.node.fastSeek?b.mytarget.node.fastSeek(p):(la=!1,b.mytarget.node.play()):b.mytarget.node.playbackRate=G):"gradientTransform"==b.attributeName?(u=m[e].gnlvaniA[h].type+"("+p+")",b.mytarget.attr(u),a.vprint("scrl",vv?"":"aniOnScroll["+h+"] [ "+m[e].gnlvaniA[h].attributeName+ 26 " type:"+m[e].gnlvaniA[h].type+" ]-> "+u)):(b.mytarget.attr(b.attributeName,p),a.vprint("scrl",vv?"":"aniOnScroll["+h+"] [ "+m[e].gnlvaniA[h].attributeName+" ]-> "+p));"patternTransform"==b.realattributeName&&(a.vprint("scrl",vv?"":"aniOnScroll["+h+"] patternTransform updated id:"+b.realtarget.attr("id")+" with val:"+p),b.realtarget.transform(b.mytarget.transform().localMatrix))}ia=!1}}fa=!1};this.anielapsed=function(d){var l="default";"undefined"!=typeof gnlvScroll&&(l=gnlvScroll.changeDiv()); 27 var b=window.gnlv_start_time&&null!=window.gnlv_start_time[l]?window.gnlv_start_time[l]:L.ani_start_timestamp,n=(Date.now()-b)/1E3;if("absolute"==d)return n;d=a.setVal(n,0,0,Q,a.setValMode.LOOP);a.vprint("scrl",vv?"":"anielapsed["+l+"] atime:"+Q+" starttimestamp:"+b+" delta:"+n+" return:"+d);return d};this.resetTransforms=function(d){var l=0;null!=d&&L.changeDiv(d);a.vprint("scrl",vv?"":"resetTransforms start on["+e+"] "+(null!=m[e]));for(d=0;d<m[e].gnlvaniA.length;d++){var b=m[e].gnlvaniA[d];a.vprint("scrl", 28 vv?"":"resetTransforms ["+d+"] id:"+b.id+" type:"+b.type+" have orig tran?"+b.origtransform+" target?"+(null!=b.mytarget));b.origtransform&&b.mytarget&&(l++,b.mytarget.transform(b.origtransform))}a.vprint("scrl",vv?"":"resetTransforms checking reset "+l+" of "+m[e].gnlvaniA.length)};var ca=function(d,l){for(var b,n,k,g=d.split(l),t=0;t<g.length;t++)b=g[t].match(/(,\s*|\s+)/),n=g[t].match(/[a-zA-Z%]/),k=g[t].match(/#/),b?g[t]=ca(g[t],b[0]):k?(diskula=g[t].replace(/#/,""),g[t]=[parseInt(diskula.substr(0, 29 2),16),parseInt(diskula.substr(2,2),16),parseInt(diskula.substr(4,2),16)]):n||(g[t]=a.d4(g[t]));return g},xa=function(d){a.vprint("scrl",vv?"":"parseSplines starting on:"+a.dumpvar(d));d.valsA=ca(d.values,/\s*;\s*/);var l=d.valsA.length;if(null!=d.keyTimes)var b=ca(d.keyTimes,/\s*;\s*/);else{var n=[0];for(b=1;b<l;b++)n[b]=Math.min(1,n[b-1]+1/(l-1));b=n}d.timsA=b;if(null!=d.keySplines)l=ca(d.keySplines,/\s*;\s*/);else{n=[];var k=[0,0,1,1];for(b=1;b<l;b++)n.push(k);l=n}d.splsA=l;return d};this.doSetup= 30 function(d){var l="FROMDIV .gnlv-scroll, FROMDIV .gnlv-mouse, FROMDIV .gnlv-music",b="id attributeName values type dur xlink:href calcMode repeatDur keyTimes keySplines keyPoints rotate additive".split(" "),n={};null==d&&(d={},z={},V={},m={},E={});M=d.usemode?d.usemode:M;l=null==d.fromdiv?l.replace(/FROMDIV/g,""):l.replace(/FROMDIV/g,"#"+d.fromdiv);var k=Snap.selectAll(l);var g;a.vprint("scrl",vv?"":"scrollSetup - - - -doSetup - - - - START usemode:"+M+" - - -fromdiv?"+d.fromdiv+" on num:"+k.length); 31 for(r=0;r<k.length;r++){var t={};l=!1;var C,H;if("edit"==M)mydivid="default";else if(mydivid=k[r].attr("id"),null==mydivid||null!=W[mydivid])mydivid=null==d.fromdiv?"svg"+r:d.fromdiv+"_svg",a.vprint("scrl",vv?"":"scrollSetup - - - -id missing or not unique, newid > "+mydivid+" <"),k[r].attr("id",mydivid);m[mydivid]={};m[mydivid].slot={};m[mydivid].gnlvaniA=[];m[mydivid].numAbyTarget={};k[r].started=!1;k[r].hasClass("gnlv-scroll")?P="scroll":k[r].hasClass("gnlv-mouse")?P="mouse":k[r].hasClass("gnlv-music")&& 32 (P="music");a.vprint("scrl",vv?"":"scrollSetup - - - -doSetup - - - - START svgA["+r+"] divid[ "+mydivid+" ] ,anitype:"+P);null==E[mydivid]&&(E[mydivid]={lastime:(new Date).getTime(),tiltG:0,tiltB:0,gpa:.5});E[mydivid].num_group_mode=0;var D=k[r].select(".gnlv-slot-template");if(D&&D.attr){var G=D.attr("gnlv-data");a.vprint("scrl",vv?"":"TEMPLATE DATA:"+G);G=a.parsejson(G);G.music&&G.music.mp3?k[r].tlmusic=G.music.mp3:a.vprint("warn","scrollSetup found no mp3!");Q!=G.atime&&(a.vprint("warn","scrollSetup found atime missmatch!"+ 33 Q+"< going with:>"+G.atime+" if defined"),Q=G.atime?G.atime:Q)}var x=!1;k[r].hasClass("gnlv-music")&&(x=!0,"undefined"==typeof eloop&&(eloop={}),eloop.templatediv=k[r].parent().attr("id"),eloop.templatediv||(eloop.templatediv="tempid"+Math.floor(1E4*Math.random()),a.vprint("scrl",vv?"":"scrollSetup no id on templatediv, setting now"),k[r].parent().attr("id",eloop.templatediv)),a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching MUSIC | | | | | | | | |divid: "+mydivid+" templatediv:"+eloop.templatediv+ 34 " tlmusic:"+k[r].tlmusic),"undefined"==typeof gnlvSound&&"undefined"!=typeof GenolveSound?(a.vprint("scrl",vv?"":"scrollSetup X X X NO snd gnlvSound but had CLAS, instantiate now"),gnlvSound=new GenolveSound({vpr:a}),document.gnlvSound=gnlvSound,volControl=document.gnlvSound.addVol(D)):J&&J.volel&&(a.vprint("scrl",vv?"":"scrollSetup registro vol:"+J.volel),volControl=gnlvSound.registerVol(J.volel)),z[mydivid]="music",eloop.autoResize=eloop.autoResizeSnd?eloop.autoResizeSnd:function(){console.log("gnlvScroll X X X non eloop autoResizeSnd ")}, 35 eloop.autoResize());a.vprint("scrl",vv?"":"scrollSetup START with num SVG["+r+"] tag >"+mydivid+"< of "+k.length+" -------------------------------------------------vv--------------------");var A=k[r].selectAll("g[id=hiddenslotsubnode]");1>A.length?a.vprint("warn","scrollSetup did not find hiddenslotsubnode for:"+mydivid):ja=A[0];k[r].selectAll(".gnlv-slot-eloop").forEach(function(p,S){var I=p.attr("id");G=p.attr("gnlv-data");if(I.match(/.*hidden.*/)||null==G)a.vprint("scrl",vv?"":"scrollSetup skip datagnlv for slot["+ 36 I+"] ");else{a.vprint("scrl",vv?"":"SLOT [ "+I+" ] DATA:"+G);q=a.parsejson(G);if(null!=q.usetagID)for(K in q.usetagID){var T=q.usetagID[K];t[T]=I;T.match(/\d$/)&&(t[T.replace(/\d+$/,"N")]=I);("imgcorner"==K||"imgmask"==K)&&(C=k[r].select("#"+T))&&C.parent()&&C.parent().parent()&&(H="imgcorner"==K?C.parent().parent().attr("id"):C.parent().attr("id"),a.vprint("scrl",vv?"":"["+K+"] tagged:"+H),t[H]=I)}null==m[mydivid].slot[I]?m[mydivid].slot[I]=q:a.vprint("warn","scrollSetup slot["+I+"] not empty! mydata already logged??????")}}); 37 var f=k[r].select("#theoverlayVid");"undefined"!=typeof eloop&&eloop.rmVidTimer?eloop.rmVidTimer(D):f&&f.remove();D=k[r].selectAll("animate,animateTransform,animateMotion");a.vprint("scrl",vv?"":"scrollSetup START looping animations["+mydivid+"] -- - - -- "+D.length);for(var R in m[mydivid].slot){var q=m[mydivid].slot[R];if(q.transO&&q.transO.music&&q.transO.music.enable&&"video"==q.transO.music.whichani)for(videlA=k[r].selectAll("#"+R+" video"),a.vprint("scrl",vv?"":"scrollSetup > videojog < for slot["+ 38 R+"] numel:"+videlA.length),g=0;g<videlA.length;g++)videlA[g].attr("id","anivid"+Math.floor(1E4*Math.random())),D.push(videlA[g])}for(U=0;U<D.length;U++){f=D[U];var c={};A=f.parent();g=f.attr("id");null==g&&(g="anmttemp"+Math.floor(1E4*Math.random()),f.attr("id",g));var w=g.match(/^aniusr/)?"slide":g.match(/^anipth/)?"path":g.match(/^anmt/)?"intrinsic":g.match(/^anifal/)?"fallingeffect":g.match(/^anivid/)?"video":"unknown";a.vprint("scrl",vv?"":"scrollSetup ======== start["+U+"]["+g+"]"+w);var y= 39 A.attr("id")?A.attr("id"):"none",B=h,h=A,u=h.attr?h.attr("id"):"nada";if("vidtimer"!=g&&"marqSOani"!=g&&"timekeeperani"!=g){for(;h.parent()&&h.parent().attr&&!h.hasClass("gnlv-slot-eloop")&&!h.hasClass("gnlv-svg");)B=h,h=h.parent(),u=h.attr("id")?h.attr("id"):"nada";if("hiddenslot"==u||h.hasClass("gnlv-svg"))a.vprint("scrl",vv?"":"scrollSetup found hidden, SKIP:"+g+":");else{if("hiddenslotdefs"==u){B=B.attr("id");if(t[B])u=t[B];else if(t[B.replace(/\d+$/,"N")])u=t[B.replace(/\d+$/,"N")];else{a.vprint("scrl", 40 vv?"":"X SKIP X hiddenslot lookup fail on key:"+B+" for hsd2slot hash:"+a.dumpvar(t));continue}q=m[mydivid].slot[u];a.vprint("scrl",vv?"":"scrollSetup hiddenslotdefs translate for["+B+"]->"+u)}else m[mydivid].slot[u]?q=m[mydivid].slot[u]:a.vprint("scrl",vv?"":"scrollSetup X X X X X X no slot data/mydata for "+u);B=q&&q.transO&&q.transO.music&&q.transO.music.whichani?q.transO.music.whichani:"all";var v=q&&q.transO&&q.transO.music&&q.transO.music.enable?q.transO.music.enable:!1;a.vprint("scrl",vv? 41 "":"scrollSetup ======== start["+U+"]["+g+"]["+u+"] enabled?"+v+" have parent?"+(null!=A)+" id:"+y+" type:"+A.node.localName+" > "+f.node.tagName);if(null!=f.attr("begin")&&!f.attr("begin").match(/theoverlayVid/))a.vprint("warn","scrollSetup skip element with begin, id:"+f.attr("id")+" attr:"+f.attr("attributeName"));else if(null!=f.attr("from")&&null==f.attr("values"))a.vprint("warn","scrollSetup skip element with from to, id:"+f.attr("id")+" attr:"+f.attr("attributeName"));else if("handwave"!= 42 y&&"helpinghand"!=y)if(A.attr("xlink:href")&&A.attr("xlink:href").match(/^#bird/))a.vprint("scrl",vv?"":"scrollSetup SKIP this xlink:"+A.attr("xlink:href"));else if(x&&("slide"==B&&"slide"!=w||"path"==B&&"path"!=w||"intrinsic"==B&&"intrinsic"!=w||"fallingeffect"==B&&"fallingeffect"!=w||"video"==B&&"video"!=w))a.vprint("scrl",vv?"":"scrollSetup SKIP, bad match with whichani:"+B+" me:"+w);else if(x&&!v)a.vprint("scrl",vv?"":"scrollSetup SKIP, music not enabled");else if(!x&&q.transO&&q.transO.sound&& 43 0==q.transO.sound.enable&&"scroll"!=P)a.vprint("scrl",vv?"":"scrollSetup SKIP, sound not enabled");else if(x&&v&&"slide"==w&&q.transO.music.drivemode.match(/(freqbar|waveform)/)&&"group mode"==q.transO.music.keyoff&&"opacity"==f.attr("attributeName"))a.vprint("scrl",vv?"":"scrollSetup SKIP, opacity for slide freqbar group mode");else{c.slot=u;c.kind=w;x&&q.transO&&q.transO.music&&(c.music=$.extend({},q.transO.music),c.sound=$.extend({},q.transO.sound),c.gpa=0,c.twa=0,c.gpb=0,c.threshold=.5,c.mpPulse= 44 0,c.order=-1);q.transO&&q.transO.group&&(c.apply2group=q.transO.group.apply2group);for(g=0;g<b.length;g++)c[b[g]]=f.attr(b[g]);"video"==c.kind&&(c.values=f.attr("data-vbeg")+";"+f.attr("data-vend"),c.dur=f.attr("data-vend")-f.attr("data-vbeg"),c.repeatDur="indefinite",c.kind="video",c.attributeName="currentTime",la&&(f.attr("data-vres","never"),f.node.pause()),a.vprint("scrl",vv?"":"scrollSetup videojog params now:"+a.dumpvar(c)));if(f.attr("origid")||A.attr("origid"))l=!0,c.order=f.attr("origid")|| 45 A.attr("origid");"feColorMatrix"==A.node.localName&&(c.type="feColorMatrix");if("rotate"==c.type||"d"==c.attributeName||"feColorMatrix"==c.type)c.values=c.values.replace(/\s*;\s*/g,";").replace(/\s+$/,"").replace(/([a-yA-Y])/g,"$1 ").replace(/\s+/g,",").replace(/,,/g,",").replace(/[,;]$/,""),a.vprint("scrl",vv?"":"scrollSetup CLEANED UP rotate/d values:"+c.values);"feColorMatrix"==c.type&&(c.values=c.values.replace(/\r\n/g,""));c.attributeName&&c.attributeName.match(/(stop-color|fill|stroke|flood-color|d)/)|| 46 !c.values||(c.values=c.values.replace(/([a-zA-Z%])/g,",$1"));null!=c.keyPoints&&(c.values=c.keyPoints,thepathid=f.select("mpath").attr("xlink:href"),pathd=k[r].select(thepathid),a.vprint("scrl",vv?"":"aniOnScroll aniMo pathid:"+thepathid+" found it?"+pathd),null!=pathd&&(c.pathd=pathd.attr("d"),c.zlen=Snap.path.getTotalLength(c.pathd),c.attributeName="transform",c.type="translate",c.kind="path"));c=xa(c);c.durm=Q/parseFloat(c.dur);x&&(c.durm=1,q.transO&&q.transO.music&&q.transO.music.enable&&("slide"== 47 w&&q.transO.music.drivemode.match(/(freqbar|waveform)/)&&"group mode"==q.transO.music.keyoff&&(c.skipPause=!0,junk=c.timsA.shift(),junk=c.valsA.shift(),1<c.timsA.length&&(junk=c.timsA.pop(),junk=c.valsA.pop()),c.timsA[0]=0,c.timsA[c.timsA.length-1]=1,a.vprint("scrl",vv?"":" drivemode freqbarmod valsA now:"+c.valsA+" timsA:"+c.timsA)),a.vprint("scrl",vv?"":" drivemode:"+F+","+q.transO.music.drivemode),q.transO.music.drivemode.match(/^beat/)&&(ka=!0),"group mode"==q.transO.music.keyoff&&E[mydivid].num_group_mode++, 48 null==m[mydivid].slot[c.slot].started?(k[r].tlmusic?a.vprint("scrl",vv?"":"scrollSetup have tlmusic SKIP paramO file ["+c.sound.snd+"]!!!!!"):(a.vprint("scrl",vv?"":"scrollSetup START paramO music["+c.sound.snd+"] !!!!!"),gnlvSound.start(c.sound)),a.vprint("scrl",vv?"":"scrollSetup TODO beat or headless per sound"),m[mydivid].slot[c.slot].started=!0):a.vprint("scrl",vv?"":"scrollSetup sound["+c.sound.snd+"] already started")));a.vprint("scrl",vv?"":"scrollSetup paramO [ "+U+" ] : "+a.dumpvar(c)); 49 a.vprint("scrl",vv?"":"scrollSetup paramO------------------------------");c.mytarget=c["xlink:href"]?k[r].select(c["xlink:href"]):"video"==c.kind?f:A;w=c.mytargetid=c.mytarget.attr("id");null==w&&(w=c.mytargetid="temp"+Math.floor(1E4*Math.random()),a.vprint("scrl",vv?"":"scrollSetup no id for animate target! setting now:"+w),c.mytarget.attr?c.mytarget.attr("id",w):a.vprint("warn","scrollSetup failed to set id"));"transform"==c.attributeName&&(c.mytarget&&"function"==typeof c.mytarget.transform&&"symbol"!= 50 A.node.localName?c.lmatrix=c.mytarget.transform().localMatrix:(a.vprint("scrl",vv?"":"scrollSetup X X X no transform off["+c.id+"]:target:"+c.mytarget+" fake it"),c.lmatrix=new Snap.Matrix),null!=c.keyPoints&&"matrix(1,0,0,1,0,0)"!=c.lmatrix.toString()&&(a.vprint("scrl",vv?"":"scrollSetup X X X aniMo initial transform NOT OK:"+c.lmatrix.toString()),c.mytarget.transform("matrix(1,0,0,1,0,0)")),m[mydivid].numAbyTarget[w]=null==m[mydivid].numAbyTarget[w]?1:m[mydivid].numAbyTarget[w]+1);"patternTransform"== 51 c.attributeName&&(g=c.mytarget.attr("patternTransform"),a.vprint("scrl",vv?"":"scrollSetup patternTransform attr:"+c.mytarget.attr("patternTransform")+" parentid:"+y+" lmat:"+g+" type:"+c.type),c.realtarget=c.mytarget,A=k[r].selectAll("g[id=hiddenslotdefssubnode]"),1>A.length?a.vprint("warn","scrollSetup patternTransform did not find hiddenslotdefssubnode"):(c.mytarget=A[0],c.mytarget.transform(g),c.lmatrix=c.mytarget.transform().localMatrix.clone(),a.vprint("scrl",vv?"":"scrollSetup patternTransform proxy setup with transform:"+ 52 c.lmatrix),c.realattributeName=c.attributeName,c.attributeName="transform",w=y,m[mydivid].numAbyTarget[w]=null==m[mydivid].numAbyTarget[w]?1:m[mydivid].numAbyTarget[w]+1));null==n[w]&&(n[w]={});y=c.realattributeName?c.realattributeName:c.attributeName;"currentTime"!=y&&(n[w][y]=1,f.node.setAttribute("fill","remove"),"idle2play"==M?(f.attr("repeatDur","indefinite"),f.node.setAttribute("fill","remove")):f.attr("repeatDur",1E-6),c.lmatrix&&c.mytarget&&(c.origtransform=c.lmatrix.toString()+"",c.mytarget.attr("data-transform", 53 c.origtransform)));c.myself=f;m[mydivid].gnlvaniA.push(c)}}}}1==l&&(a.vprint("scrl",vv?"":"scrollSetup SPECIAL SORT!"),m[mydivid].gnlvaniA.sort(function(p,S){return parseFloat(p.order)-parseFloat(S.order)}));a.vprint("scrl",vv?"":"scrollSetup ======== vv ============================== vv");a.vprint("scrl",vv?"":"scrollSetup ======== setup scroll for num animations:"+m[mydivid].gnlvaniA.length+" ID:"+mydivid);a.vprint("scrl",vv?"":"scrollSetup ======== last drivemode:"+F+" found_beat?"+ka);a.vprint("scrl", 54 vv?"":"scrollSetup ======== willchange list:"+a.dumpvar(n));k[r].tlmusic&&0==k[r].started?(gnlvSound.doplots=!1,F.match(/^beat/)||ka?gnlvSound.ana("onbeat"):gnlvSound.ana("headless"),l={enable:!0,snd:"tlmusic",pl:mydivid,playmode:"continuous",do3d:!1,file:k[r].tlmusic,usemode:M},myvol=k[r].select("#vol_on_off"),a.vprint("scrl",vv?"":"scrollSetup ======= M U S I C ======= PRELOAD top level music usemode:"+M+" vol["+typeof myvol+"] file:"+a.dumpvar(l)+" ======== !!!!!"),myvol&&myvol.attr&&(volver= 55 myvol.attr("data-ver"),myvol.attr("data-target",mydivid),l.volel=myvol,myvol.parent()&&myvol.parent().select("#timekeeperani")&&myvol.parent().select("#timekeeperani").attr("data-target",mydivid)),"idle2play"==M?gnlvSound.preload(l):gnlvSound.start(l),k[r].started=!0,gnlvSound.muteTrans=L.resetTransforms):a.vprint("scrl",vv?"":"scrollSetup ======== NO top level music defined");for(K in n)if(l=Object.keys(n[K]).join(","),x=k[r].select("#"+K))x.node.style.willChange=l;"scroll"==P?(a.vprint("scrl",vv? 56 "":"scrollSetup | | | | | | | | | watching SCROLL | | | | | | | | | "+mydivid),myvol&&myvol.attr&&myvol.removeClass("gnlv-gone"),z[mydivid]="scroll",$(window).off("scroll.genolve"),$(window).on("scroll.genolve",{value:mydivid},sa)):"mouse"==P?a.getBrowser("isMobile")?(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching TILT | | | | | | | | | "+mydivid),z[mydivid]="tilt",e=mydivid,window.addEventListener("devicemotion",ra,!1)):(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching MOUSE | | | | | | | | | "+ 57 mydivid),z[mydivid]="mouse",$(window).off("mousemove.genolve"),$(window).on("mousemove.genolve",{value:mydivid},qa)):"music"==P?(a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | watching MUSIC | | | | | | | | | ID:"+mydivid+" interval->20"),z[mydivid]="music",e=mydivid,"idle2play"==M&&(gnlvSound.muteExtra&&a.vprint("warn",vv?"":"scrollSetup setting muteExtra toggleMuzPause but not null:"+gnlvSound.muteExtra),gnlvSound.muteExtra=L.toggleMuzPause,gnlvSound.playExtra&&a.vprint("warn",vv?"":"scrollSetup setting playExtra toggleMuzPlay but not null:"+ 58 gnlvSound.playExtra),gnlvSound.playExtra=L.toggleMuzPlay),document.gnlv_ana_interval=window.setInterval(ta,20),$(window).off("beat"),$(window).on("beat",va)):a.vprint("scrl",vv?"":"scrollSetup NO ANITYPE no scroll flages detected");W[mydivid]=k[r]}a.vprint("scrl",vv?"":"scrollSetup | | | | | | | | | setup done");a.vprint("scrl",vv?"":"scrollSetup | | | | |");"undefined"!=typeof eloop&&eloop.mkVidtimer&&"edit"==M&&(a.vprint("scrl",vv?"":"scrollSetup | | mkVidtimer"),eloop.mkVidtimer())};J&&"minimal"== 59 J.usemode||L.doSetup();"stub"==eloop.version&&null==eloop.anielapsed&&(eloop.anielapsed=this.anielapsed)}; -
genolve-toolkit/trunk/js/genolve-sound.js
r2500177 r2719585 1 var GenolveSound=function( r){var b=this;null==r&&(r={});this.ver="2.0.0";this.fov=90;this.muted=!0;this.numfreqbins=256;var X=0,Y=0,t=484,P=0,J=57,G=null,Z=3,Q=!1,K=!0,v={},C=0,R=70,aa,S,g=r.vpr;null==r.actionhost&&"https://www.genolve.com"==r.actionhost;var q,w="off",L,T,B,M,U,V=!0,D,m={},n=[];this.trueh=200;this.plO={};var c="notset";this.playExtra=this.muteExtra=this.muteTrans=null;this.doplots=!0;this.needSetup=!1;var u=0,N=0,E=document.getElementById("oscilloscope");if(null!=E){var p=E.getContext("2d");1 var GenolveSound=function(p){var b=this;null==p&&(p={});this.ver="2.0.0";this.fov=90;this.muted=!0;this.numfreqbins=256;var X=0,Y=0,t=484,P=0,J=57,G=null,Z=3,Q=!1,K=!0,v={},C=0,R=70,aa,S,g=p.vpr;null==p.actionhost&&"https://www.genolve.com"==p.actionhost;var r,w="off",L,T,B,M,U,V=!0,D,m={},n=[];this.trueh=200;this.plO={};var c="notset";this.playExtra=this.muteExtra=this.muteTrans=null;this.doplots=!0;this.needSetup=!1;var u=0,N=0,E=document.getElementById("oscilloscope");if(null!=E){var q=E.getContext("2d"); 2 2 var y=E.width;var z=E.height}var x=document.getElementById("plot");if(null!=x){var l=x.getContext("2d");l.font="28px serif";l.lineWidth=1;l.strokeStyle="green";l.rect(0,0,x.width,x.height);l.stroke()}null==g&&(g={name:"snd-stub",vprint:function(a,d){vv||console.log(d)},dumpvar:function(a){return JSON.stringify(a)},setValMode:{LOOP:"LOOP",LOOPz:"LOOPz",LOOPtoBOUND:"LOOPtoBOUND",LIMIT:"LIMIT",RANDOM:"RANDOM",MIDNORM:"MIDNORM",LOWNORM:"LOWNORM",HINORM:"HINORM"},setVal:function(a,d,e,h,f){e=parseFloat(e); 3 3 h=parseFloat(h);if(e>h){var k=h;h=e;e=k}k=h-e;k=f==this.setValMode.LOOPz?k+1:k;a=isNaN(a)?0:parseFloat(a);d=isNaN(d)?1:parseFloat(d);a+=d;if(a>h)if(f==this.setValMode.LIMIT)a=h;else if(f==this.setValMode.LOOPtoBOUND)a=e;else if(f==this.setValMode.LOOP||f==this.setValMode.LOOPz)for(;a>h;)a-=k;else console.warn("GNLV_UTILS.setVal invalid setValMode:"+f+" must be LOOP/LIMIT/RANDOM");else if(a<e)if(f==this.setValMode.LIMIT)a=e;else if(f==this.setValMode.LOOPtoBOUND)a=h;else if(f==this.setValMode.LOOP|| 4 4 f==this.setValMode.LOOPz)for(;a<e;)a+=k;else console.warn("GNLV_UTILS.setVal invalid setValMode:"+f+" must be LOOP/LIMIT/RANDOM");return a}});this.volsprite='<g id="vol_on_off" class="gnlv-clickable gnlv-vol-control" data-ver="1.1" data-target="default" onclick="document.gnlvSound.toggleVol(this)" transform="scale(.2)"><circle cx="100" cy="100" r="100" fill="#DDDDDD"/><g id="vol_on" transform="scale(0.2)" class="vol_on"><path d="M156,379 v247 h140 l210,173 l0,-592 l-210,173 H156 z M588,351 c-12,-12 -32,-12 -44,0 c-12,12 -12,32 0,44 v0 c27,27 44,64 44,105 c0,41 -17,78 -44,105 c-12,12 -12,32 0,44 c6,6 14,9 22,9 c8,0 16,-3 22,-9 c38,-38 62,-91 62,-149 C650,442 626,389 588,351 z M659,279 c-12,-12 -32,-12 -44,0 c-12,12 -12,32 0,44 c45,45 73,108 73,177 c0,69 -28,131 -73,177 c-12,12 -12,32 0,44 c6,6 14,9 22,9 c8,0 16,-3 22,-9 c57,-57 92,-135 91,-221 C751,414 716,335 659,279 z M728,211 c-12,-12 -32,-12 -44,0 c-12,12 -12,32 0,44 h0 c63,63 102,149 102,245 c0,96 -39,182 -101,245 c-12,12 -12,32 0,44 c6,6 14,9 22,9 s16,-3 22,-9 c74,-74 120,-176 120,-289 C847,387 801,285 728,211 z "></path></g><g id="vol_off" transform="scale(0.2)" class="vol_off" style="display:none"><path d="M156,379 v247 h140 l210,173 l0,-592 l-210,173 H156 z M920,652 788,520 920,384 852,320 720,452 588,320 520,384 652,520 520,652 588,716 720,584 852,716 920,652 788,520 "></path> </g></g>'; 5 5 this.sndLibO={none:"none",drone:"https://www.genolve.com/svg/snd/drone-flying.mp3",train:"https://www.genolve.com/svg/snd/train-wheels.mp3",tick:"https://www.genolve.com/svg/snd/Tick.mp3",bells:"https://www.genolve.com/svg/snd/sleigh-bells-2ring.mp3","80svibe":"https://www.genolve.com/svg/snd/80s_vibe.mp3",rave:"https://www.genolve.com/svg/snd/rave_digger.mp3"};this.eventMapO={onmousemove:"mousemove",onfocusin:"focusin",onclick:"click",onmousedown:"mousedown",onmouseup:"mouseup",onbegin:"beginEvent", 6 onend:"endEvent",onrepeat:"repeatEvent"};this.panningInterval=null;g.vprint("snd"," - = gnlvSound loading = - vpr:"+g.name);"function"!=typeof Howl&&(g.vprint("warn","= = = =missing Howler! loading now"),jQuery.getScript(r.actionhost+"/js/howler.js/dist/howler.js",function(){g.vprint("snd","3 3 3 3 3 3 3 3 3 3 3 3 howler loaded DONE 3 3 3 3 3 3 3 3 3 3 3 3")}));"function"!=typeof window.jsmediatags&&(g.vprint("warn","= = = =missing window.jsmediatags! loading now"),jQuery.getScript(r.actionhost+ 7 "/js/jsmediatags/dist/jsmediatags.min.js",function(){g.vprint("snd","3 3 3 3 3 3 3 3 3 3 3 3 jsmediatags loaded DONE 3 3 3 3 3 3 3 3 3 3 3 3")}));this.init=function(){r.volel&&b.registerVol(r.volel);r.preload&&(g.vprint("snd","PRELOAD["+c+"]:"+r.preload),b.preload({enable:!0,snd:"tlmusic",pl:c,playmode:"continuous",do3d:!1,file:r.preload,usemode:"record"}))};this.getMediaTags=function(a){"undefined"!=typeof eloop&&eloop.music&&window.jsmediatags?window.jsmediatags.read(a,{onSuccess:function(d){"none"== 8 eloop.music.exturl;if(d&&d.tags&&d.tags.comment&&d.tags.comment.text){var e=d.tags.comment.text.split(/\r\n/,1);1==e.length&&(eloop.music.exturl=e[0].replace(/URL:\s*/,""))}e={artist:"unknown",album:"unknown",track:0,title:"unknown",fileLength:eloop.mp3length,genre:"unknown"};g.vprint("snd","getMediaTags returned:"+g.dumpvar(d));for(key in e)eloop.music[key]=d&&d.tags&&d.tags[key]?d.tags[key]:e[key];"undefined"==typeof SpotifyApi?g.vprint("warn","getMediaTags no spotify api!"):(SpotifyApi.thmb=eloop.thmb, 9 SpotifyApi.updateCurTrack("normal",eloop.music))},onError:function(d){console.log(d)}}):g.vprint("warn","getMediaTags missing "+typeof window.jsmediatags+" or eloop missing!"+typeof eloop)};var H=function(a){return a?a-S:(new Date).getTime()-S},ba=function(a,d){g.vprint("error","ERROR X X sound["+a+"]:"+d)};this.resize=function(a){a?(b.winw=a.winw||1200,b.winh=a.winh||630,a.coordA&&b.plO[c]&&b.plO[c].volel&&b.plO[c].volel.transform("matrix(0.2 0 0 0.2 "+coordA.join(" ")+")")):(b.winw=b.winw||1200, 10 b.winh=b.winh||630);b.aratio=b.winw/b.winh;b.camxshift=b.winw/2;b.camx=0;b.camy=b.winh/2;b.camz=-20;g.vprint("snd","sound resize= = = = = win w h:"+b.winw+","+b.winh+" aratio:"+b.aratio)};b.resize(r);this.panO={};this.mute=function(){g.vprint("snd","= = = = = global MUTE Sound["+c+"] muteTrans?"+(null!=b.muteTrans)+" extra?"+(null!=b.muteExtra));Howler.mute(!0);for(var a in b.plO[c].sndO)b.plO[c].sndO[a].pause();b.muted=!0;b.metronomeID&&(window.clearInterval(b.metronomeID),b.metronomeID=null);b.beatWorkerID&& 11 (window.clearInterval(b.beatWorkerID),b.beatWorkerID=null);null!=b.muteTrans&&b.muteTrans(c);null!=b.muteExtra&&b.muteExtra()};this.play=function(){g.vprint("snd","= = = = = global PLAY Sound["+c+"] extra?"+(null!=b.playExtra));b.muted=!1;Howler.mute(!1);for(var a in b.plO[c].sndO)b.plO[c].sndO[a].play();this.ana();null!=b.playExtra&&b.playExtra()};this.volume=function(a){Howler.volume(a)};this.addVol=function(a){if(null==a)g.vprint("snd","sound addVol["+c+"] abort, missing parent obj!");else{var d= 12 a.select("#vol_on_off"),e=!0;I(c);d&&(oldver=d.attr("data-ver"),oldver=null==oldver?0:parseFloat(oldver),g.vprint("snd","addVol["+c+"] sound found existing vol el! ver:"+oldver),1.1>oldver?d.remove():e=!1);e&&(g.vprint("snd","addVol["+c+"] sound new volsprite and hide!"),a.append(Snap.parse(b.volsprite)),d=a.select("#vol_on_off"),d.hasClass("gnlv-gone")||d.addClass("gnlv-gone"),b.plO[c].volState="vol_hidden");b.plO[c].volel=d;b.plO[c].voldomel=d.node;return d}};this.showVol=function(a){b.plO[c].volel? 13 null==a||1==a?b.plO[c].volel.removeClass("gnlv-gone"):b.plO[c].volel.addClass("gnlv-gone"):g.vprint("warn","showVol["+c+"] = = = found no vol element at:"+b.plO[c].volel)};this.registerVol=function(a){a=a?a:r.volel;null==a&&(a="#vol_on_off");a=Snap.select(a);g.vprint("warn","registerVol["+c+"]found it?"+typeof a);I(c);a&&a.attr?(b.plO[c].volel=a,b.plO[c].voldomel=a.node):g.vprint("warn","registerVol["+c+"] = = = found no vol element at:"+r.volel)};this.toggleVol=function(a){"string"==typeof a?b.plO[c].volState= 14 "vol_on"==a?"vol_off":"vol_on":"object"==typeof a&&(newapl=a.getAttribute("data-target"),g.vprint("snd","toggleVol[ event:"+a+"] playlist:"+newapl),I(newapl));a=b.plO[c].voldomel.getAttribute("id");"vol_on"==b.plO[c].volState?(b.plO[c].volState="vol_off",b.plO[c].voldomel.querySelector(".vol_on").style.display="none",b.plO[c].voldomel.querySelector(".vol_off").style.display="block",b.mute()):(b.needSetup&&(b.needSetup=!1,"undefined"!=typeof gnlvScroll?(gnlvScroll.doSetup(),"undefined"!=typeof eloop&& 15 "running"==eloop.ani_state&&eloop.mkVidtimer()):g.vprint("snd","toggleVol X X X sound had flag for doSetup but no gnlvScroll defined!")),b.plO[c].volState="vol_on",b.plO[c].voldomel.querySelector(".vol_on").style.display="block",b.plO[c].voldomel.querySelector(".vol_off").style.display="none","undefined"!=typeof eloop&&eloop.music&&1==eloop.music.muzvidlink&&b.restart(eloop.anielapsed()),b.play());"undefined"!=typeof gnlvScroll&&gnlvScroll.changeDiv(c,b.plO[c].volState);g.vprint("snd","toggleVol[cur:"+ 16 c+"]["+a+"]:"+b.plO[c].volState)};this.getVolState=function(){I(c);return b.plO[c].volState};this.volColor=function(){var a=Q?"#FFFFFF":"#000000";Q=!Q;b.plO[c].volel.attr({fill:a})};this.volMarquee=function(a,d,e){zmq=b.plO[c].volel.select("#track_marquee");"auto"!=d?null!=zmq&&zmq.remove():(g.vprint("snd","= = = = = = = volMarquee marquee mode:"+d+" volel:"+b.plO[c].volel.attr("id")+" marquee el?"+zmq+" track info:"+e),null==zmq?(g.vprint("snd","= = = = = = = volMarquee inserted marquee"),b.plO[c].volel.append(Snap.parse(a.replace(/CONTENT/, 17 e))),zmq=b.plO[c].volel.select("#track_marquee"),mycirc=b.plO[c].volel.select("circle"),mycirc.before(zmq)):zmq.select("textPath").node.innerHTML=e)};var I=function(a,d){"notset"==a&&(a="default");g.vprint("snd","changeapl playlist "+c+" -> "+a);a==c&&"create"!=d?g.vprint("snd","changeapl playlist same!"+a):null==a||null==b.plO[a]||"create"==d?(g.vprint("snd","changeapl X X X X playlist missing! >"+a+"< will create"),c=a,b.plO[c]={},b.plO[c].sndO={},b.plO[c].volState="vol_hidden"):("vol_on"==b.plO[c].volState&& 18 b.toggleVol("vol_off"),c=a,"undefined"!=typeof gnlvScroll&&gnlvScroll.changeDiv(c,b.plO[c].volState))};this.radio=function(a){b.start({enable:!0,snd:"myradio",file:a,format:["mp3","aac"],do3d:!1,playmode:"normal"})};this.ana=function(a){if(null!=a&&(w=a,g.vprint("snd","ana MODE CHANGE:"+w+" muted?"+b.muted+" save for later"),b.muted))return;"off"==w?p&&(p.clearRect(0,0,y,z),p.fillStyle="red",p.fillRect(0,0,y,z)):null==q&&(g.vprint("snd","ana -------------------------------------------------- CREATE --------------------------------------------------Analyser:"+ 19 w+" bins:"+b.numfreqbins),q=Howler.ctx.createAnalyser(),q.maxDecibels=-20,q.fftSize=2*b.numfreqbins,"onbeat"===w?(a=Howler.ctx.createBiquadFilter(),a.type="lowpass",Howler.masterGain.connect(a),a.connect(q),g.vprint("snd","ana LOWPASS FILTER ADDED")):Howler.masterGain.connect(q),E&&(y=E.width,z=E.height),aa=S=(new Date).getTime());"headless"===w?(this.bufferLength=B=q.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.timeArray=new Uint8Array(this.bufferLength)):"onbeat"=== 20 w?(this.bufferLength=B=q.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.timeArray=new Uint8Array(this.bufferLength),g.vprint("snd","start beatWorker at interval:10"),b.beatWorkerID&&window.clearInterval(b.beatWorkerID),b.beatWorkerID=window.setInterval(ha,10),g.vprint("snd","start metronome at period - - - - - - - - - - - :"+t),b.metronomeID&&window.clearInterval(b.metronomeID),b.metronomeID=window.setTimeout(ca,t)):"sinewave"===w?(B=q.frequencyBinCount,L=new Uint8Array(B), 21 q.getByteTimeDomainData(L),da()):"frequencybars"==w&&(B=M=q.frequencyBinCount,T=new Uint8Array(M),p.clearRect(0,0,y,z),ea());g.vprint("snd","ana DONE anaMode [ "+w+" ] num bins:"+B+" - - - - - - - - - - - - - - - - - -- - - - - - -- -- - ");g.vprint("snd","ana DONE - - - - - - - - - - - - - - - - - -- - - - - - -- -- - ")};this.getAna=function(){if(null==q||"off"==w||b.muted)return null;q.getByteFrequencyData(this.dataArray);q.getByteTimeDomainData(this.timeArray);return{data:{freq:this.dataArray, 22 time:this.timeArray,metro:(H()-C)/t,size:this.bufferLength}}};var ha=function(){q.getByteFrequencyData(b.dataArray);var a=b.dataArray,d=b.bufferLength;Y++;X=((new Date).getTime()-aa)/Y;var e=[],h,f=0,k=0,A=0,F=0,W=0;for(h=0;h<d;h++)e[h]=g.setVal(a[h]/255,0,0,1,g.setValMode.LIMIT),W=Math.max(W,e[h]),f+=e[h],3>h?F+=e[h]:6>h?A+=e[h]:k+=e[h];m.ave=f/d;m.max=W;m.bass=F/3;m.mid=A/3;m.treb=k/3;U=!1;m.prevh2&&m.bass<m.prevh&&m.prevh<m.prevh2&&1==V&&(V=!1,U=!0,D=100*m.prevh2,a={bar:D,ts:m.prevt2},D<J?O(a, 23 "cyan"):(n.push(a),J=(3*J+(D-10))/4));m.bass>m.prevh&&m.prevh>m.prevh2&&(V=!0);m.prevh2=m.prevh;m.prevt2=m.prevt;m.prevh=m.bass;m.prevt=H()},ca=function(){C=H();O({ts:C,bar:R},"black");g.vprint("snd",vv?"":"metronome - - - - - - - - - - - TICK at["+C+"] period:"+t+" beat:"+n.length);$.event.trigger({type:"beat",keyoff:"bass",time:new Date});if(0>Z--){Z=3;var a=(new Date).getTime();g.vprint("snd",vv?"":"metronome evalBeats - START - period:"+t+" num beats:"+n.length);0==n.length&&(J*=.5);var d=99999999999999; 24 b.doplots&&(u=P/10-N,plotw=(H(a)-P)/10,l.fillStyle=K?"yellow":"orange",l.fillRect(u,0,plotw,5+5*K));P=H(a);K=!K;if(0<n.length){for(var e=0;e<n.length;e++){var h=R-n[e].bar;h=0>h?0:h*h;var f=C-n[e].ts;f*=f;h=f+h;0<e&&(f=n[e].ts-n[e-1].ts,f=10*Math.round(f/10),v[f]=null==v[f]?1:v[f]+1);1<e&&(f=n[e].ts-n[e-2].ts,f=10*Math.round(f/10),v[f]=null==v[f]?1:v[f]+1);2<e&&(f=n[e].ts-n[e-3].ts,f=10*Math.round(f/10),v[f]=null==v[f]?1:v[f]+1);if(h<d){var k=e;d=h}O(n[e],"sand")}O(n[k],"red");R=n[k].bar;g.vprint("snd", 25 vv?"":"metronome evalBeats histO:"+g.dumpvar(v));f=ia(v);k="nada";g.vprint("snd",vv?"":"metronome evalBeats gotback:"+g.dumpvar(f));f&&1<f.length&&(f=f.sort(ja),t=Math.round(60/f[0].tempo*1E3),k=f[0].tempo);d=t-(C-n[n.length-1].ts);G=t;t=d;g.vprint("snd",vv?"":"metronome evalBeats best:"+k+"->[ "+G+" ] THIS delay:"+t+" DUMP tempos:"+g.dumpvar(f));b.doplots&&(u=n[n.length-1].ts/10-N,plotw=G/10,l.fillStyle="green",l.fillRect(u,16,plotw,2));n.length=0;g.vprint("snd",vv?"":"metronome evalBeats DONE for["+ 26 C+"]: took:"+((new Date).getTime()-a))}}b.metronomeID&&window.clearInterval(b.metronomeID);b.metronomeID=window.setTimeout(ca,t);null!=G&&(t=G,G=null)},ja=function(a,d){var e=0;a.count<d.count?e=1:a.count>d.count&&(e=-1);return e},ia=function(a){var d,e=[];for(d in a){var h=a[d];var f=60/(d/1E3);f=Math.round(f);if(0===f)return;for(;90>f;)f*=2;for(;180<f;)f/=2;f=Math.round(f);e.some(function(k){if(k.tempo===f)return k.count+=h})||e.push({tempo:f,count:h})}return e},O=function(a,d){b.doplots&&(u=a.ts/ 27 10-N,ploty="black"==d?0:15,ploth="black"==d?a.bar:a.bar-15,l.fillStyle=d,l.fillRect(u,ploty,1,ploth),u>x.width&&(N+=x.width,l.fillStyle="white",l.fillRect(1,1,x.width-2,x.height-2)))},ea=function(){b.muted||(drawVisual=requestAnimationFrame(ea));q.getByteFrequencyData(T);p.fillStyle="rgb(0, 0, 0)";p.fillRect(0,0,y,z);for(var a=y/M,d,e=0,h=0;h<M;h++)d=T[h],p.fillStyle="rgb("+(d+100)+",50,50)",p.fillRect(e,z-d,a,d),e+=a+1;U?(pnbpix=333/17,l.fillStyle="rgb(200,200,0)",l.fillRect(u,D-1,pnbpix,1),l.fillStyle= 28 beatStyle):(D=10,l.fillStyle="rgb(50,50,50)");l.fillRect(u,0,1,D);l.fillStyle="rgb(200, 200, 200)";l.fillRect(10,25,250,35);l.fillStyle="rgb(0,0,0)";l.fillText("cps:"+Math.round(X)+" pbp:333",10,50);u+=1;u>x.width&&(u=0,l.fillStyle="white",l.fillRect(1,1,x.width-2,x.height-2))},da=function(){b.muted||requestAnimationFrame(da);q.getByteTimeDomainData(L);p.fillStyle="rgb(200, 200, 200)";p.fillRect(0,0,y,z);p.lineWidth=2;p.strokeStyle="rgb(0, 0, 0)";p.beginPath();for(var a=1*y/B,d=0,e=0;e<B;e++){var h= 29 L[e]/128*z/2;0===e?p.moveTo(d,h):p.lineTo(d,h);d+=a}p.lineTo(y,z/2);p.stroke()};this.restart=function(a,d){g.vprint("snd","= = restart");if(null!=b.plO[c])if(null==a&&(a=0),null!=d)b.plO[c].sndO[d].seek(a);else for(d in b.plO[c].sndO)b.plO[c].sndO[d].seek(a)};this.preload=function(a){g.vprint("snd","=preload("+a.file+","+a.snd+","+a.pl+"):");a.preloading=!0;b.start(a)};this.start=function(a){c=null==a.pl?"default":a.pl;I(c,"create");g.vprint("snd","= = = = = gnvlSound.START["+c+"], eloop?"+typeof eloop+ 30 ":");null==b.plO[c]?g.vprint("snd","= = = = = X X X playlist[ "+c+" ] mia"):g.vprint("snd","= = = = = volel?"+typeof a.volel+", sndO:"+g.dumpvar(b.plO[c].sndO));null==a.snd&&(a.snd="tlmusic");a.volel&&(b.plO[c].volel=a.volel,b.plO[c].voldomel=a.volel.node,delete a.volel);"vol_hidden"==b.plO[c].volState&&("idle2play"==a.usemode?b.plO[c].volel.removeClass("gnlv-gone"):("undefined"==typeof eloop||"stub"!=eloop.version)&&b.plO[c].volel.removeClass("gnlv-gone"),a.preloading&&"idle2play"!=a.usemode||b.toggleVol("vol_off")); 31 if(a.enable){g.vprint("snd","= = = = = CREATE Sound["+a.snd+"] params:"+g.dumpvar(a));var d="continuous"==a.playmode?!0:!1;if(null!=this.plO[c].sndO[a.snd]){var e=this.plO[c].sndO[a.snd].src==a.file;g.vprint("snd","= old sound existed same? "+e+" :old:"+this.plO[c].sndO[a.snd].src+" new:"+a.file);if(e)return;this.plO[c].sndO[a.snd].unload()}d={src:[a.file],loop:d,autoplay:!1,preload:!0,onloaderror:ba,onplayerror:ba};a.format&&(d.format=a.format);a.html5&&(d.html5=a.html5,g.vprint("snd","X X looks like html5? "+ 32 a.html5+" NO ANALYZER"));a.file.match(/\.[a-zA-Z0-9]{3}$/)||(g.vprint("snd","no extension guess = AUTOFORMAT mp3"),d.format=["mp3"]);this.plO[c].sndO[a.snd]=new Howl(d);this.plO[c].sndO[a.snd].src=a.file;this.plO[c].sndO[a.snd].once("load",function(h,f){g.vprint("snd","LOADED:sound tag:"+a.snd+" arg1"+h+" arg2:"+f);"tlmusic"==a.snd&&a.preloading&&jQuery.event.trigger({type:"readyplayerone",message:"tlmusic is ready for action",time:new Date})});g.vprint("snd","have audiocontext:"+Howler.ctx);if(a.do3d)b.panO[a.ani]= 33 b.setupPan(a.snd,0,0),null==b.panningInterval&&(g.vprint("snd","= = = = = START Panner Interval= = = = = "),Howler.pos(this.camx,this.camy,this.camz),b.panningInterval=window.setInterval(ka,100));else if(a.playmode.match(/^on/))for(playmodeA=a.playmode.split(/,/),g.vprint("snd",vv?"":"= = = = = EVENT: "+a.playmode+" : split:"+playmodeA.length+" for "+a.ani),ii=0;ii<playmodeA.length;ii++)myp=fa(a.ani),anelA=myp.el.querySelectorAll("animateTransform"),anmtA=myp.el.querySelectorAll("*[id^=anmt_]"),g.vprint("snd", 34 vv?"":"on-event= = = = = found num animateTransform:"+anelA.length+" num id anmt:"+anmtA.length),0<anelA.length?anel=anelA[0]:0<anmtA.length&&(anel=anmtA[0]),anel.addEventListener(b.eventMapO[playmodeA[ii]],function(h){console.log("i repeated:"+h.detail);b.plO[c].sndO[a.snd].play()});else g.vprint("snd","= = = = = non-3d sound autoplay skip")}};var fa=function(a){var d=200,e=0,h=200;var f=document.getElementById(a);if(null==f)g.vprint("warn","gnlvPosById["+a+"] not found!");else{var k=f.getBoundingClientRect(); 35 var A=b.fov*Math.PI/180;var F=k.height;F=A*F/b.winh;d=b.trueh/Math.tan(F);A*=b.aratio;curx=k.x+k.width/2-b.camxshift;A=A*curx/b.winw;e=d*Math.tan(A);h=k.y;g.vprint("snd",vv?"":"gnlvPosById["+a+"] hasPan?"+b.panO[a]+" found el?"+typeof f+" x:"+parseInt(k.x)+" truex:"+e+" theta:"+F+" phi:"+A+" dist:"+parseInt(d))}return{x:e,y:h,z:d,el:f}},ka=function(){for(key in b.panO)myp=fa(key),0<b.panO[key].indexOf(".")?b.plO[c].sndO[b.panO[key.split(".")[0]]].pos(myp.x+.5,myp.y+.5,myp.z,key.split(".")[1]):b.plO[c].sndO[b.panO[key]].pos(myp.x+ 36 .5,myp.y+.5,myp.z)};this.setupPan=function(a,d,e,h){sound=b.plO[c].sndO[a];var f=null==h?sound.play():sound.play(h);sound.once("play",function(){sound.pos(d+.5,e+.5,-.5,f);sound.volume(1,f);sound.pannerAttr({panningModel:"HRTF",refDistance:100,rolloffFactor:2.5,distanceModel:"linear"},f)}.bind(this),f);return null==h?a:a+"."+h};this.init()}; 6 onend:"endEvent",onrepeat:"repeatEvent"};this.panningInterval=null;g.vprint("snd"," - = gnlvSound loading = - vpr:"+g.name);"function"!=typeof Howl&&(g.vprint("warn","= = = =missing Howler! loading now"),jQuery.getScript(p.actionhost+"/js/howler.js/dist/howler.min.js",function(){g.vprint("snd","3 3 3 3 3 3 3 3 3 3 3 3 howler loaded DONE 3 3 3 3 3 3 3 3 3 3 3 3")}));"function"!=typeof window.jsmediatags&&(g.vprint("warn","= = = =missing window.jsmediatags! loading now"),jQuery.getScript(p.actionhost+ 7 "/js/jsmediatags/dist/jsmediatags.min.js",function(){g.vprint("snd","3 3 3 3 3 3 3 3 3 3 3 3 jsmediatags loaded DONE 3 3 3 3 3 3 3 3 3 3 3 3")}));this.init=function(){p.volel&&b.registerVol(p.volel);if(p.preload){g.vprint("snd","PRELOAD["+c+"]:"+p.preload);var a={enable:!0,snd:"tlmusic",pl:c,playmode:"continuous",do3d:!1,file:p.preload,usemode:"record"};"none"==p.preload?window.setTimeout(function(){jQuery.event.trigger({type:"readyplayerone",message:"NO music to load, ready now",time:new Date})}, 8 500):b.preload(a)}};this.getMediaTags=function(a){"undefined"!=typeof eloop&&eloop.music&&window.jsmediatags?window.jsmediatags.read(a,{onSuccess:function(d){"none"==eloop.music.exturl;if(d&&d.tags&&d.tags.comment&&d.tags.comment.text){var e=d.tags.comment.text.split(/\r\n/,1);1==e.length&&(eloop.music.exturl=e[0].replace(/URL:\s*/,""))}e={artist:"unknown",album:"unknown",track:0,title:"unknown",fileLength:eloop.mp3length,genre:"unknown"};g.vprint("snd","getMediaTags returned:"+g.dumpvar(d));for(key in e)eloop.music[key]= 9 d&&d.tags&&d.tags[key]?d.tags[key]:e[key];"undefined"==typeof SpotifyApi?g.vprint("warn","getMediaTags no spotify api!"):(SpotifyApi.thmb=eloop.thmb,SpotifyApi.updateCurTrack("normal",eloop.music))},onError:function(d){console.log(d)}}):g.vprint("warn","getMediaTags missing "+typeof window.jsmediatags+" or eloop missing!"+typeof eloop)};var H=function(a){return a?a-S:(new Date).getTime()-S},ba=function(a,d){g.vprint("error","ERROR X X sound["+a+"]:"+d)};this.resize=function(a){a?(b.winw=a.winw||1200, 10 b.winh=a.winh||630,a.coordA&&b.plO[c]&&b.plO[c].volel&&b.plO[c].volel.transform("matrix(0.2 0 0 0.2 "+coordA.join(" ")+")")):(b.winw=b.winw||1200,b.winh=b.winh||630);b.aratio=b.winw/b.winh;b.camxshift=b.winw/2;b.camx=0;b.camy=b.winh/2;b.camz=-20;g.vprint("snd","sound resize= = = = = win w h:"+b.winw+","+b.winh+" aratio:"+b.aratio)};b.resize(p);this.panO={};this.mute=function(){g.vprint("snd","= = = = = global MUTE Sound["+c+"] muteTrans?"+(null!=b.muteTrans)+" extra?"+(null!=b.muteExtra));Howler.mute(!0); 11 for(var a in b.plO[c].sndO)b.plO[c].sndO[a].pause();b.muted=!0;b.metronomeID&&(window.clearInterval(b.metronomeID),b.metronomeID=null);b.beatWorkerID&&(window.clearInterval(b.beatWorkerID),b.beatWorkerID=null);null!=b.muteTrans&&b.muteTrans(c);null!=b.muteExtra&&b.muteExtra()};this.play=function(){g.vprint("snd","= = = = = global PLAY Sound["+c+"] extra?"+(null!=b.playExtra));b.muted=!1;Howler.mute(!1);for(var a in b.plO[c].sndO)b.plO[c].sndO[a].play();this.ana();null!=b.playExtra&&b.playExtra()}; 12 this.volume=function(a){Howler.volume(a)};this.addVol=function(a){if(null==a)g.vprint("snd","sound addVol["+c+"] abort, missing parent obj!");else{var d=a.select("#vol_on_off"),e=!0;I(c);d&&(oldver=d.attr("data-ver"),oldver=null==oldver?0:parseFloat(oldver),g.vprint("snd","addVol["+c+"] sound found existing vol el! ver:"+oldver),1.1>oldver?d.remove():e=!1);e&&(g.vprint("snd","addVol["+c+"] sound new volsprite and hide!"),a.append(Snap.parse(b.volsprite)),d=a.select("#vol_on_off"),d.hasClass("gnlv-gone")|| 13 d.addClass("gnlv-gone"),b.plO[c].volState="vol_hidden");b.plO[c].volel=d;b.plO[c].voldomel=d.node;return d}};this.showVol=function(a){b.plO[c].volel?null==a||1==a?b.plO[c].volel.removeClass("gnlv-gone"):b.plO[c].volel.addClass("gnlv-gone"):g.vprint("warn","showVol["+c+"] = = = found no vol element at:"+b.plO[c].volel)};this.registerVol=function(a){a=a?a:p.volel;null==a&&(a="#vol_on_off");a=Snap.select(a);g.vprint("warn","registerVol["+c+"]found it?"+typeof a);I(c);a&&a.attr?(b.plO[c].volel=a,b.plO[c].voldomel= 14 a.node):g.vprint("warn","registerVol["+c+"] = = = found no vol element at:"+p.volel)};this.toggleVol=function(a){"string"==typeof a?b.plO[c].volState="vol_on"==a?"vol_off":"vol_on":"object"==typeof a&&(newapl=a.getAttribute("data-target"),g.vprint("snd","toggleVol[ event:"+a+"] playlist:"+newapl),I(newapl));a=b.plO[c].voldomel.getAttribute("id");"vol_on"==b.plO[c].volState?(b.plO[c].volState="vol_off",b.plO[c].voldomel.querySelector(".vol_on").style.display="none",b.plO[c].voldomel.querySelector(".vol_off").style.display= 15 "block",b.mute()):(b.needSetup&&(b.needSetup=!1,"undefined"!=typeof gnlvScroll&&1==p.doScroll?(gnlvScroll.doSetup(),"undefined"!=typeof eloop&&"running"==eloop.ani_state&&eloop.mkVidtimer()):g.vprint("warn","toggleVol X X X sound had flag for doSetup but no gnlvScroll defined!"+typeof gnlvScroll+" or flagged to skip:"+p.doScroll)),b.plO[c].volState="vol_on",b.plO[c].voldomel.querySelector(".vol_on").style.display="block",b.plO[c].voldomel.querySelector(".vol_off").style.display="none","undefined"!= 16 typeof eloop&&eloop.music&&1==eloop.music.muzvidlink&&b.restart(eloop.anielapsed()),b.play());"undefined"!=typeof gnlvScroll&&gnlvScroll.changeDiv(c,b.plO[c].volState);g.vprint("snd","toggleVol[cur:"+c+"]["+a+"]:"+b.plO[c].volState)};this.getVolState=function(){I(c);return b.plO[c].volState};this.volColor=function(){var a=Q?"#FFFFFF":"#000000";Q=!Q;b.plO[c].volel.attr({fill:a})};this.volMarquee=function(a,d,e){zmq=b.plO[c].volel.select("#track_marquee");"auto"!=d?null!=zmq&&zmq.remove():(g.vprint("snd", 17 "= = = = = = = volMarquee marquee mode:"+d+" volel:"+b.plO[c].volel.attr("id")+" marquee el?"+zmq+" track info:"+e),null==zmq?(g.vprint("snd","= = = = = = = volMarquee inserted marquee"),b.plO[c].volel.append(Snap.parse(a.replace(/CONTENT/,e))),zmq=b.plO[c].volel.select("#track_marquee"),mycirc=b.plO[c].volel.select("circle"),mycirc.before(zmq)):zmq.select("textPath").node.innerHTML=e)};var I=function(a,d){"notset"==a&&(a="default");g.vprint("snd","changeapl playlist "+c+" -> "+a);a==c&&"create"!= 18 d?g.vprint("snd","changeapl playlist same!"+a):null==a||null==b.plO[a]||"create"==d?(g.vprint("snd","changeapl X X X X playlist missing! >"+a+"< will create"),c=a,b.plO[c]={},b.plO[c].sndO={},b.plO[c].volState="vol_hidden"):("vol_on"==b.plO[c].volState&&b.toggleVol("vol_off"),c=a,"undefined"!=typeof gnlvScroll&&gnlvScroll.changeDiv(c,b.plO[c].volState))};this.radio=function(a){b.start({enable:!0,snd:"myradio",file:a,format:["mp3","aac"],do3d:!1,playmode:"normal"})};this.ana=function(a){if(null!= 19 a&&(w=a,g.vprint("snd","ana MODE CHANGE:"+w+" muted?"+b.muted+" save for later"),b.muted))return;"off"==w?q&&(q.clearRect(0,0,y,z),q.fillStyle="red",q.fillRect(0,0,y,z)):null==r&&(g.vprint("snd","ana -------------------------------------------------- CREATE --------------------------------------------------Analyser:"+w+" bins:"+b.numfreqbins),r=Howler.ctx.createAnalyser(),r.maxDecibels=-20,r.fftSize=2*b.numfreqbins,"onbeat"===w?(a=Howler.ctx.createBiquadFilter(),a.type="lowpass",Howler.masterGain.connect(a), 20 a.connect(r),g.vprint("snd","ana LOWPASS FILTER ADDED")):Howler.masterGain.connect(r),E&&(y=E.width,z=E.height),aa=S=(new Date).getTime());"headless"===w?(this.bufferLength=B=r.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.timeArray=new Uint8Array(this.bufferLength)):"onbeat"===w?(this.bufferLength=B=r.frequencyBinCount,this.dataArray=new Uint8Array(this.bufferLength),this.timeArray=new Uint8Array(this.bufferLength),g.vprint("snd","start beatWorker at interval:10"),b.beatWorkerID&& 21 window.clearInterval(b.beatWorkerID),b.beatWorkerID=window.setInterval(ha,10),g.vprint("snd","start metronome at period - - - - - - - - - - - :"+t),b.metronomeID&&window.clearInterval(b.metronomeID),b.metronomeID=window.setTimeout(ca,t)):"sinewave"===w?(B=r.frequencyBinCount,L=new Uint8Array(B),r.getByteTimeDomainData(L),da()):"frequencybars"==w&&(B=M=r.frequencyBinCount,T=new Uint8Array(M),q.clearRect(0,0,y,z),ea());g.vprint("snd","ana DONE anaMode [ "+w+" ] num bins:"+B+" - - - - - - - - - - - - - - - - - -- - - - - - -- -- - "); 22 g.vprint("snd","ana DONE - - - - - - - - - - - - - - - - - -- - - - - - -- -- - ")};this.getAna=function(){if(null==r||"off"==w||b.muted)return null;r.getByteFrequencyData(this.dataArray);r.getByteTimeDomainData(this.timeArray);return{data:{freq:this.dataArray,time:this.timeArray,metro:(H()-C)/t,size:this.bufferLength}}};var ha=function(){r.getByteFrequencyData(b.dataArray);var a=b.dataArray,d=b.bufferLength;Y++;X=((new Date).getTime()-aa)/Y;var e=[],h,f=0,k=0,A=0,F=0,W=0;for(h=0;h<d;h++)e[h]= 23 g.setVal(a[h]/255,0,0,1,g.setValMode.LIMIT),W=Math.max(W,e[h]),f+=e[h],3>h?F+=e[h]:6>h?A+=e[h]:k+=e[h];m.ave=f/d;m.max=W;m.bass=F/3;m.mid=A/3;m.treb=k/3;U=!1;m.prevh2&&m.bass<m.prevh&&m.prevh<m.prevh2&&1==V&&(V=!1,U=!0,D=100*m.prevh2,a={bar:D,ts:m.prevt2},D<J?O(a,"cyan"):(n.push(a),J=(3*J+(D-10))/4));m.bass>m.prevh&&m.prevh>m.prevh2&&(V=!0);m.prevh2=m.prevh;m.prevt2=m.prevt;m.prevh=m.bass;m.prevt=H()},ca=function(){C=H();O({ts:C,bar:R},"black");g.vprint("snd",vv?"":"metronome - - - - - - - - - - - TICK at["+ 24 C+"] period:"+t+" beat:"+n.length);$.event.trigger({type:"beat",keyoff:"bass",time:new Date});if(0>Z--){Z=3;var a=(new Date).getTime();g.vprint("snd",vv?"":"metronome evalBeats - START - period:"+t+" num beats:"+n.length);0==n.length&&(J*=.5);var d=99999999999999;b.doplots&&(u=P/10-N,plotw=(H(a)-P)/10,l.fillStyle=K?"yellow":"orange",l.fillRect(u,0,plotw,5+5*K));P=H(a);K=!K;if(0<n.length){for(var e=0;e<n.length;e++){var h=R-n[e].bar;h=0>h?0:h*h;var f=C-n[e].ts;f*=f;h=f+h;0<e&&(f=n[e].ts-n[e-1].ts, 25 f=10*Math.round(f/10),v[f]=null==v[f]?1:v[f]+1);1<e&&(f=n[e].ts-n[e-2].ts,f=10*Math.round(f/10),v[f]=null==v[f]?1:v[f]+1);2<e&&(f=n[e].ts-n[e-3].ts,f=10*Math.round(f/10),v[f]=null==v[f]?1:v[f]+1);if(h<d){var k=e;d=h}O(n[e],"sand")}O(n[k],"red");R=n[k].bar;g.vprint("snd",vv?"":"metronome evalBeats histO:"+g.dumpvar(v));f=ia(v);k="nada";g.vprint("snd",vv?"":"metronome evalBeats gotback:"+g.dumpvar(f));f&&1<f.length&&(f=f.sort(ja),t=Math.round(60/f[0].tempo*1E3),k=f[0].tempo);d=t-(C-n[n.length-1].ts); 26 G=t;t=d;g.vprint("snd",vv?"":"metronome evalBeats best:"+k+"->[ "+G+" ] THIS delay:"+t+" DUMP tempos:"+g.dumpvar(f));b.doplots&&(u=n[n.length-1].ts/10-N,plotw=G/10,l.fillStyle="green",l.fillRect(u,16,plotw,2));n.length=0;g.vprint("snd",vv?"":"metronome evalBeats DONE for["+C+"]: took:"+((new Date).getTime()-a))}}b.metronomeID&&window.clearInterval(b.metronomeID);b.metronomeID=window.setTimeout(ca,t);null!=G&&(t=G,G=null)},ja=function(a,d){var e=0;a.count<d.count?e=1:a.count>d.count&&(e=-1);return e}, 27 ia=function(a){var d,e=[];for(d in a){var h=a[d];var f=60/(d/1E3);f=Math.round(f);if(0===f)return;for(;90>f;)f*=2;for(;180<f;)f/=2;f=Math.round(f);e.some(function(k){if(k.tempo===f)return k.count+=h})||e.push({tempo:f,count:h})}return e},O=function(a,d){b.doplots&&(u=a.ts/10-N,ploty="black"==d?0:15,ploth="black"==d?a.bar:a.bar-15,l.fillStyle=d,l.fillRect(u,ploty,1,ploth),u>x.width&&(N+=x.width,l.fillStyle="white",l.fillRect(1,1,x.width-2,x.height-2)))},ea=function(){b.muted||(drawVisual=requestAnimationFrame(ea)); 28 r.getByteFrequencyData(T);q.fillStyle="rgb(0, 0, 0)";q.fillRect(0,0,y,z);for(var a=y/M,d,e=0,h=0;h<M;h++)d=T[h],q.fillStyle="rgb("+(d+100)+",50,50)",q.fillRect(e,z-d,a,d),e+=a+1;U?(pnbpix=333/17,l.fillStyle="rgb(200,200,0)",l.fillRect(u,D-1,pnbpix,1),l.fillStyle=beatStyle):(D=10,l.fillStyle="rgb(50,50,50)");l.fillRect(u,0,1,D);l.fillStyle="rgb(200, 200, 200)";l.fillRect(10,25,250,35);l.fillStyle="rgb(0,0,0)";l.fillText("cps:"+Math.round(X)+" pbp:333",10,50);u+=1;u>x.width&&(u=0,l.fillStyle="white", 29 l.fillRect(1,1,x.width-2,x.height-2))},da=function(){b.muted||requestAnimationFrame(da);r.getByteTimeDomainData(L);q.fillStyle="rgb(200, 200, 200)";q.fillRect(0,0,y,z);q.lineWidth=2;q.strokeStyle="rgb(0, 0, 0)";q.beginPath();for(var a=1*y/B,d=0,e=0;e<B;e++){var h=L[e]/128*z/2;0===e?q.moveTo(d,h):q.lineTo(d,h);d+=a}q.lineTo(y,z/2);q.stroke()};this.restart=function(a,d){g.vprint("snd","= = restart");if(null!=b.plO[c])if(null==a&&(a=0),null!=d)b.plO[c].sndO[d].seek(a);else for(d in b.plO[c].sndO)b.plO[c].sndO[d].seek(a)}; 30 this.preload=function(a){g.vprint("snd","=preload("+a.file+","+a.snd+","+a.pl+"):");a.preloading=!0;b.start(a)};this.start=function(a){c=null==a.pl?"default":a.pl;I(c,"create");g.vprint("snd","= = = = = gnvlSound.START["+c+"], eloop?"+typeof eloop+":");null==b.plO[c]?g.vprint("snd","= = = = = X X X playlist[ "+c+" ] mia"):g.vprint("snd","= = = = = volel?"+typeof a.volel+", sndO:"+g.dumpvar(b.plO[c].sndO));null==a.snd&&(a.snd="tlmusic");a.volel&&(b.plO[c].volel=a.volel,b.plO[c].voldomel=a.volel.node, 31 delete a.volel);"vol_hidden"==b.plO[c].volState&&("idle2play"==a.usemode?b.plO[c].volel.removeClass("gnlv-gone"):("undefined"==typeof eloop||"stub"!=eloop.version)&&b.plO[c].volel.removeClass("gnlv-gone"),a.preloading&&"idle2play"!=a.usemode||b.toggleVol("vol_off"));if(a.enable){g.vprint("snd","= = = = = CREATE Sound["+a.snd+"] params:"+g.dumpvar(a));var d="continuous"==a.playmode?!0:!1;if(null!=this.plO[c].sndO[a.snd]){var e=this.plO[c].sndO[a.snd].src==a.file;g.vprint("snd","= old sound existed same? "+ 32 e+" :old:"+this.plO[c].sndO[a.snd].src+" new:"+a.file);if(e)return;this.plO[c].sndO[a.snd].unload()}d={src:[a.file],loop:d,autoplay:!1,preload:!0,onloaderror:ba,onplayerror:ba};a.format&&(d.format=a.format);a.html5&&(d.html5=a.html5,g.vprint("snd","X X looks like html5? "+a.html5+" NO ANALYZER"));a.file.match(/\.[a-zA-Z0-9]{3}$/)||(g.vprint("snd","no extension guess = AUTOFORMAT mp3"),d.format=["mp3"]);this.plO[c].sndO[a.snd]=new Howl(d);this.plO[c].sndO[a.snd].src=a.file;this.plO[c].sndO[a.snd].once("load", 33 function(h,f){g.vprint("snd","LOADED:sound tag:"+a.snd+" arg1"+h+" arg2:"+f);"tlmusic"==a.snd&&a.preloading&&jQuery.event.trigger({type:"readyplayerone",message:"tlmusic is ready for action",time:new Date})});g.vprint("snd","have audiocontext:"+Howler.ctx);if(a.do3d)b.panO[a.ani]=b.setupPan(a.snd,0,0),null==b.panningInterval&&(g.vprint("snd","= = = = = START Panner Interval= = = = = "),Howler.pos(this.camx,this.camy,this.camz),b.panningInterval=window.setInterval(ka,100));else if(a.playmode.match(/^on/))for(playmodeA= 34 a.playmode.split(/,/),g.vprint("snd",vv?"":"= = = = = EVENT: "+a.playmode+" : split:"+playmodeA.length+" for "+a.ani),ii=0;ii<playmodeA.length;ii++)myp=fa(a.ani),anelA=myp.el.querySelectorAll("animateTransform"),anmtA=myp.el.querySelectorAll("*[id^=anmt_]"),g.vprint("snd",vv?"":"on-event= = = = = found num animateTransform:"+anelA.length+" num id anmt:"+anmtA.length),0<anelA.length?anel=anelA[0]:0<anmtA.length&&(anel=anmtA[0]),anel.addEventListener(b.eventMapO[playmodeA[ii]],function(h){console.log("i repeated:"+ 35 h.detail);b.plO[c].sndO[a.snd].play()});else g.vprint("snd","= = = = = non-3d sound autoplay skip")}};var fa=function(a){var d=200,e=0,h=200;var f=document.getElementById(a);if(null==f)g.vprint("warn","gnlvPosById["+a+"] not found!");else{var k=f.getBoundingClientRect();var A=b.fov*Math.PI/180;var F=k.height;F=A*F/b.winh;d=b.trueh/Math.tan(F);A*=b.aratio;curx=k.x+k.width/2-b.camxshift;A=A*curx/b.winw;e=d*Math.tan(A);h=k.y;g.vprint("snd",vv?"":"gnlvPosById["+a+"] hasPan?"+b.panO[a]+" found el?"+typeof f+ 36 " x:"+parseInt(k.x)+" truex:"+e+" theta:"+F+" phi:"+A+" dist:"+parseInt(d))}return{x:e,y:h,z:d,el:f}},ka=function(){for(key in b.panO)myp=fa(key),0<b.panO[key].indexOf(".")?b.plO[c].sndO[b.panO[key.split(".")[0]]].pos(myp.x+.5,myp.y+.5,myp.z,key.split(".")[1]):b.plO[c].sndO[b.panO[key]].pos(myp.x+.5,myp.y+.5,myp.z)};this.setupPan=function(a,d,e,h){sound=b.plO[c].sndO[a];var f=null==h?sound.play():sound.play(h);sound.once("play",function(){sound.pos(d+.5,e+.5,-.5,f);sound.volume(1,f);sound.pannerAttr({panningModel:"HRTF", 37 refDistance:100,rolloffFactor:2.5,distanceModel:"linear"},f)}.bind(this),f);return null==h?a:a+"."+h};this.init()}; -
genolve-toolkit/trunk/readme.txt
r2693883 r2719585 1 === Genolve Music VideoToolkit ===1 === Genolve Slideshow Maker Toolkit === 2 2 Contributors: genolve 3 3 Donate link: https://www.genolve.com/ 4 Tags: music video, mp3 player, animate SVG, SVG editor, animation, featured image, stock photos, gutenberg blocks4 Tags: slideshow maker, animate on scroll, SVG editor, animate SVG, featured image, stock photos, music video 5 5 Requires at least: 5.0 6 Tested up to: 5.9. 27 Stable tag: 2.0.66 Tested up to: 5.9.3 7 Stable tag: 3.0.0 8 8 Requires PHP: 5.2.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Make music videos with music driven animations that perfectly synchronize movement to music.12 Create artistic slideshows freely mixing images, video, SVG or text with animations choreographed to a soundtrack. 13 13 14 14 == Description == 15 15 16 Play music in style with a simple mesmerizing background animation or make a complex multi-layered video with animated text, images and stickers all synchronized with the music. Music driven animations add that extra flair to make it look like a professional did it. When making your video access millions of free stock photos, videos, amazing text effects and stunning SVG stickers. On your website, use the mp4 video or use the crisp SVG version which looks great on all screen resolutions. All SVG comes from genolve.com where it is checked for safety and fast load time. If you have no time to make a video just flip an existing template and add your track. You need an API key from genolve.com to use this plugin; after registering, look for the link 'My Api Key'. 16 Create artistic multi-layered slideshows mixing video, images, text or SVG stickers with optional background music. Huge array of animation options including animate-on-scroll. Upload your own media or access millions of free stock photos and video via a built-in interface. Grab amazing SVG text effects and stunning SVG stickers from genolve.com where everything is checked for safety and fast load time. Design from scratch or speed up your workflow and start from a library of existing templates. You need an API key from genolve.com to use this plugin which you can get via registration or using the one-click-trial option. The banner above and our animated icon were both made with the Genolve Slideshow Maker. 17 17 18 [Tutorials]( https://www.youtube.com/playlist?list=PLw1SeQ8zjXIbjWxvllwa12fmCY6u4iqdh) and [Demos]( https://www.genolve.com/svg/en/genolve-wordpress-plugin.php)19 18 20 = More features = 19 ### Simple To Use 20 Whenever you create a slideshow you get a video recording of the slideshow and a coverphoto image representing that slideshow is also generated, **simply place that coverphoto where you want the slideshow to go**. If the browser supports SVG (all modern browsers do) the image will be swapped for the slideshow using the same **responsive** settings the image had. That's it, no shortcodes or other parameters to mess with. 21 22 ### Wide Compatibility 23 Because the slideshow goes where you place the coverphoto, it can be placed anywhere you place an image; as the featured image, Gutenberg image blocks, or any other plugin that uses images, including WooCommerce. 24 25 ### Demos 26 These are demos and video captures of slideshows: 27 * [Slideshows](https://www.genolve.com/design/websites/slideshow-maker) 28 * [Animate on Scroll live](https://www.genolve.com/svg/en/genolve-wordpress-slideshow-maker-plugin.php) 29 * [Animate on Scroll video](https://www.genolve.com/design/websites/animate-on-scroll) 30 * [Featured Image](https://www.genolve.com/design/websites/featuredimage) 31 * [Gutenberg Ornate Separator](https://wildwebwidget.com/genolve-ornate-separator-block-demo) 32 * [Tutorials]( https://www.youtube.com/playlist?list=PLw1SeQ8zjXIbjWxvllwa12fmCY6u4iqdh) 33 34 ### Use Cases by Site Type 35 36 **Photography and Art Sites** 37 38 When you highlight your new photos, videos or art in a blog post, use multiple slideshows down the page to support the story progression. Make interactive stories with the Premium option. If your photos are copyrighted, don't expose them to the web, use the generated slideshow video instead. 39 40 **Online Store** 41 42 Highlight a new product line or special sales promotion. Construct a slideshow with flair and punch worthy of a Fortune 500 advertisement. Highlight a [drink](https://www.youtube.com/watch?v=Y3mE3KziMno&t=2s) or a [car sale](https://www.youtube.com/watch?v=2k1lGdAJR5c&t=3s) (Note these tutorials were made before animation timing bars made animations even easier). 43 44 **Music Site** 45 46 Make a [full-blown music video](https://www.genolve.com/svg/en/how-to-make-a-music-video.php) to put a spotlight on your music. Music driven animations add that extra professional touch. Use unconventional animations such as using the windows of a skyscraper as a frequency meter. 47 48 **Blog** 49 50 Make a slideshow tell a story or explain a point you are trying to communicate. Go for humor by making your own [meme](https://www.genolve.com/design/socialmedia/memes) or make artistic abstract animations to break up the flow of thought. Instead of a static pull quotes, make elegant animated pull quotes. 51 52 = Bonus features = 21 53 * **Image Filters** - hundreds of filters to enhance your images, including background stripping (works best on solid color backgrounds). 22 54 * **Templates** - speed up the design process with hundreds of pre-designed templates. 23 * **Fast -Safe SVG** - all SVG comes from genolve.com where it is checked for safety and fast load time.24 * **Animations** - add slide-in, fade-in, zoom-in and m ore effects including path animations.25 * **Gutenberg Blocks** - Ornate Separator divides paragraphs or videos in style. More blocks in development. [Demos]( https://wildwebwidget.com/genolve-ornate-separator-block-demo)55 * **Fast Safe SVG** - all SVG comes from genolve.com where it is checked for safety and fast load time. 56 * **Animations** - add slide-in, fade-in, zoom-in and many more effects including path animations. 57 * **Gutenberg Blocks** - Ornate Separator divides paragraphs or videos in style. More blocks in development. 26 58 * **Fonts** - use our suggested font variations or set your own Google font. 27 * **Quotes** - seamlessly pull quotes from Wikiquote the largest quote collection on the internet. 28 * **Covers** - Use the same assets from your video to make coverphotos, album covers, youtube banners, etc. 59 * **Quotes** - seamlessly pull quotes from Wikiquote the largest accurate quote collection on the internet. 60 * **Featured Image** - when making your slideshow you can also make a featured image for social media posts. 61 * **Video Recording** - when making your slideshow you get a video that can be used in emails or posted on YouTube. 62 * **Easy Resizing** - after making a video for YouTube, quickly resize, do some touchups and make a video for TikTok, Instagram, etc. 63 * **Falling Snow** - add falling snow, confetti, etc. that people see on their first visit to your site. 29 64 30 = Costs=31 Genolve is free to use! Just get your API key on genolve.com and you're all set. Get a [Premium membership](https://www.genolve.com/svg/en/genolve-wordpress-plugin-premium.php) to unlock more features and capabilities.65 = Free Version is Awesome = 66 Genolve is free to use! Just get your API key on genolve.com and you're all set. You can do a lot with the free version, unlink some other plugins. Get a [Premium membership](https://www.genolve.com/svg/en/genolve-wordpress-plugin-premium.php) to unlock more features and capabilities. Premium Members can make slideshows fully interactive with buttons or game-like interactions powerful enough to construct a Rube Goldberg machine. 32 67 33 = Limited Time Promotion=34 Post a Genolve music video on TikTok, Snapchat or Instagram and get upgraded to a Premium Membership, [full details](https://www.genolve.com/svg/en/genolve-wordpress-plugin-premium.php). 68 = No Spam = 69 No emails, dashboard notices or admin banners except for valid notices you wouldn't want to miss like security updates or an expiring membership. 35 70 36 71 = About Genolve = 37 Genolve hosts the internet's largest collection of evolving shapes and designs. The designs evolve using simulated evolution. Whenever you click on a design, new variations of that design are automatically generated. Anything you create will be unique; found nowhere else but on your site. New designs added daily by artists and generative art experts. [Find out more.](https://www.genolve.com/svg/en/about.php) [Terms of Use.](https://www.genolve.com/svg/en/terms.php)72 Genolve hosts the internet's largest collection of evolving shapes and designs. The designs evolve using simulated evolution. Whenever you click on a design, new variations of that design are automatically generated. Anything you create will be unique; found nowhere else but on your site. New designs added daily by [artists and generative art experts](https://www.genolve.com/svg/en/about.php). The banner image above was created on Genolve using images by [Natalie_voy](https://pixabay.com/users/natalie_voy-23809635/) and [StockSnap](https://pixabay.com/users/stocksnap-894430/). [Genolve Terms of Use.](https://www.genolve.com/svg/en/terms.php) 38 73 39 74 == Installation == … … 54 89 The plugin remotely uses the SVG designs on genolve.com and the API key is used to link to your account on Genolve. It adds extra security. 55 90 91 = How can I reduce CPU load? = 92 Complex animations with high CPU load have a warning notice that should be heeded - which is to only show it a short time and don’t show multiple high CPU animations together. Also avoid using filters on fullscreen videos. After selecting a high CPU animation, change the selection menu to something without animations! 93 56 94 = How do I contact you if I have questions/suggestion? = 57 95 Please contact us via the [Contact page](https://www.genolve.com/svg/en/contact.php) or [Suggestions page](https://genolve.uservoice.com/forums/236974-feature-request-list) we'd love to hear from you. … … 59 97 == Screenshots == 60 98 61 1. Des gin Editor In Use screenshot-1.png (v 2.0.0)62 2. Manage Designs screenshot-2.png (v 1.0.1)63 3. Music Video Landscape Templates (list scrolls down) screenshot-3.png (v 2.0.0)64 4. Gutenberg Ornate Separator Controls screenshot-4.png (v 1.0.6)99 1. Design Editor In Use 100 2. Blog Graphic by Genolve user QueenBee [site](https://www.permission2thinkfreely.com/wordpress/) 101 3. Slideshow by Genolve user Debam [site](https://www.sapience2112.com/) 102 4. Music Video by Genolve user craig 65 103 66 104 == Changelog == 105 = 3.0.0 = 106 * Big improvements to Animate on Scroll, including adding an optional mp3 track. 107 * Image names now SEO optimized. 108 67 109 = 2.0.6 = 68 110 * Variations on image and text masks.
Note: See TracChangeset
for help on using the changeset viewer.