(function (cjs, an) { var p; // shortcut to reference prototypes var lib={};var ss={};var img={}; lib.ssMetadata = []; (lib.AnMovieClip = function(){ this.actionFrames = []; this.ignorePause = false; this.gotoAndPlay = function(positionOrLabel){ cjs.MovieClip.prototype.gotoAndPlay.call(this,positionOrLabel); } this.play = function(){ cjs.MovieClip.prototype.play.call(this); } this.gotoAndStop = function(positionOrLabel){ cjs.MovieClip.prototype.gotoAndStop.call(this,positionOrLabel); } this.stop = function(){ cjs.MovieClip.prototype.stop.call(this); } }).prototype = p = new cjs.MovieClip(); // symbols: // helper functions: function mc_symbol_clone() { var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop, this.reversed)); clone.gotoAndStop(this.currentFrame); clone.paused = this.paused; clone.framerate = this.framerate; return clone; } function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) { var prototype = cjs.extend(symbol, cjs.MovieClip); prototype.clone = mc_symbol_clone; prototype.nominalBounds = nominalBounds; prototype.frameBounds = frameBounds; return prototype; } (lib.unit = function(mode,startPosition,loop,reversed) { if (loop == null) { loop = false; } if (reversed == null) { reversed = false; } var props = new Object(); props.mode = mode; props.startPosition = startPosition; props.labels = {}; props.loop = loop; props.reversed = reversed; cjs.MovieClip.apply(this,[props]); this.isSingleFrame = false; // timeline functions: this.frame_0 = function() { if(this.isSingleFrame) { return; } if(this.totalFrames == 1) { this.isSingleFrame = true; } var data = SMARTGfxLink.data || {}; this.unitStyle.maxWidth = 1800; this.unitStyle.lineWidth = null; this.unitStyle.text = data.unitText; } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); // Layer_1 this.text = new cjs.Text("", "80px 'CodecPro-Bold'", "#2AB41F"); this.text.textAlign = "center"; this.text.lineHeight = 101; this.text.lineWidth = 100; this.text.parent = this; this.text.setTransform(-1033.65,739.25); this.unitStyle = new cjs.Text("km/h", "bold 50px 'Consolas'", "#FFFFFF"); this.unitStyle.name = "unitStyle"; this.unitStyle.textAlign = "center"; this.unitStyle.lineHeight = 61; this.unitStyle.lineWidth = 280; this.unitStyle.parent = this; this.unitStyle.setTransform(-0.05,-135.9); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.unitStyle},{t:this.text}]}).wait(1)); this._renderFirstFrame(); }).prototype = getMCSymbolPrototype(lib.unit, new cjs.Rectangle(-1085.6,-137.9,1227.5,977.8), null); (lib.speed_clip = function(mode,startPosition,loop,reversed) { if (loop == null) { loop = false; } if (reversed == null) { reversed = false; } var props = new Object(); props.mode = mode; props.startPosition = startPosition; props.labels = {}; props.loop = loop; props.reversed = reversed; cjs.MovieClip.apply(this,[props]); // timeline functions: this.frame_0 = function() { var data = SMARTGfxLink.data || {}; var unit = data.unitType; //var animationLength = 42; //var startFrame = this.currentFrame; if (unit == "KPH") { var serveSpeed = data.serveSpeed; this.speed.text = parseFloat(serveSpeed).toFixed(0) || ""; /*const countUpAnimation = () => { var frameDifference = this.currentFrame - startFrame; var progress = EasingFunctions.easeOutCubic(frameDifference/animationLength); this.speed.text = Math.max(Math.min( (serveSpeed * (progress) ), serveSpeed), 0).toFixed(0); } this.addEventListener('tick', countUpAnimation);*/ } else if (unit == "MPH") { var serveSpeed = KPHtoMPH(data.serveSpeed); this.speed.text = parseFloat(serveSpeed).toFixed(0) || ""; /*const countUpAnimation = () => { var frameDifference = this.currentFrame - startFrame; var progress = EasingFunctions.easeOutCubic(frameDifference/animationLength); this.speed.text = Math.max(Math.min( (serveSpeed * (progress) ), serveSpeed), 0).toFixed(0); } this.addEventListener('tick', countUpAnimation);*/ } } this.frame_1 = function() { this.gotoAndPlay(0); } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1).call(this.frame_1).wait(1)); // Layer 1 this.speed = new cjs.Text("134", "bold 75px 'Consolas'", "#FFFFFF"); this.speed.name = "speed"; this.speed.textAlign = "center"; this.speed.lineHeight = 90; this.speed.lineWidth = 354; this.speed.parent = this; this.speed.setTransform(-74.6,-100.35); this.timeline.addTween(cjs.Tween.get(this.speed).wait(1).to({x:178,y:-138.65,font:"bold 200px 'Sharp Sans Display No1'",textAlign:NaN,lineHeight:265},0).wait(1)); this._renderFirstFrame(); }).prototype = p = new cjs.MovieClip(); p.nominalBounds = new cjs.Rectangle(-253.5,-140.6,433.5,305.29999999999995); // stage content: (lib.speedboard = function(mode,startPosition,loop,reversed) { if (loop == null) { loop = true; } if (reversed == null) { reversed = false; } var props = new Object(); props.mode = mode; props.startPosition = startPosition; props.labels = {}; props.loop = loop; props.reversed = reversed; cjs.MovieClip.apply(this,[props]); this.actionFrames = [5,13]; // timeline functions: this.frame_5 = function() { this.stop(); SMARTGfxLink.incrementKeyframe(); } this.frame_13 = function() { SMARTGfxLink.reset(); } // actions tween: this.timeline.addTween(cjs.Tween.get(this).wait(5).call(this.frame_5).wait(8).call(this.frame_13).wait(2)); // speed this.speedClip = new lib.speed_clip(); this.speedClip.name = "speedClip"; this.speedClip.setTransform(882.25,1254.25,0.9387,0.9385,0,0,0,703.5,382.9); this.speedClip._off = true; this.timeline.addTween(cjs.Tween.get(this.speedClip).wait(1).to({_off:false},0).to({_off:true},12).wait(2)); // unit this.unitClip = new lib.unit(); this.unitClip.name = "unitClip"; this.unitClip.setTransform(1170.65,1446.4,1.2363,1.2336,0,0,0,703.5,382.7); this.unitClip._off = true; this.timeline.addTween(cjs.Tween.get(this.unitClip).wait(1).to({_off:false},0).to({_off:true},12).wait(2)); // Layer_1 this.text = new cjs.Text("", "50px 'Consolas-Bold'", "#FFFFFF"); this.text.textAlign = "center"; this.text.lineHeight = 61; this.text.lineWidth = 100; this.text.parent = this; this.text.setTransform(240.2,1227.05); this.timeline.addTween(cjs.Tween.get(this.text).wait(15)); this._renderFirstFrame(); }).prototype = p = new lib.AnMovieClip(); p.nominalBounds = new cjs.Rectangle(-81.3,1338.9,557.6999999999999,671.5); // library properties: lib.properties = { id: '36D6E8BDDCB50B4D9681420AF6CA779E', width: 1920, height: 1080, fps: 50, color: "#323232", opacity: 0.00, manifest: [], preloads: [] }; // bootstrap callback support: (lib.Stage = function(canvas) { createjs.Stage.call(this, canvas); }).prototype = p = new createjs.Stage(); p.setAutoPlay = function(autoPlay) { this.tickEnabled = autoPlay; } p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) } p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; } p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); } p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; } p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; } an.bootcompsLoaded = an.bootcompsLoaded || []; if(!an.bootstrapListeners) { an.bootstrapListeners=[]; } an.bootstrapCallback=function(fnCallback) { an.bootstrapListeners.push(fnCallback); if(an.bootcompsLoaded.length > 0) { for(var i=0; i