• image1
  • image2
  • image3
  • image4

Spine

2D animation for games

"); var script = document.createElement("script"); script.src = "https://www.youtube.com/iframe_api"; var firstScript = document.getElementsByTagName("script")[0]; firstScript.parentNode.insertBefore(script, firstScript); } else playVideo(); } var player; function onYouTubeIframeAPIReady () { player = new YT.Player("player", { videoId: "5RTkImAOJKM", width: 720, playerVars: { modestbranding: 1, showinfo: 0 }, suggestedQuality : "hd720", events: { onReady: onPlayerReady, onStateChange: onPlayerStateChange } }); } function onPlayerReady(event) { player.playVideo(); } function onPlayerStateChange(event) { if (event.data == YT.PlayerState.ENDED) minimizeVideo(); } function playVideo() { player.playVideo(); } function pauseVideo() { player.pauseVideo(); } function expandVideo() { $("#trailer").addClass("trailer-active"); $(".trailer-overlay").delayCss([ { delay: 1000, css: { opacity: 0 }}, { delay: 1500, css: { display: "none" }} ]); $(".trailer-button-minimize").delayCss([ { delay: 1400, css: { display: "block" }}, { delay: 1500, css: { opacity: 0.75}} ]); $(".slider-overlay").css({"background-color" : "rgba(0,0,0,1)", "transition" : "background-color 0.1s"}); } function minimizeVideo() { $(".trailer-overlay").css({"opacity" : "1", "display" : "block"}); $(".trailer-button-minimize").css({"opacity" : "0", "display" : "none"}); $("#trailer").removeClass("trailer-active"); $(".slider-overlay").delay(400).queue(function() { $(this).css({"background-color" : "rgba(0,0,0,0)", "transition" : "background-color 1s"}); $(this).dequeue(); }); } $.fn.delayCss = function(cssChanges) { $(this).each(function() { var element = $(this), lastDelay = 0; $.each(cssChanges, function(i, options) { lastDelay += parseInt(options.delay); setTimeout(function() { element.css(options.css); }, lastDelay); }); }); } $("#trailer .trailer-video").click(function () { expandVideo(); loadTrailer(); }); $("#trailer .trailer-button-minimize").click(function () { pauseVideo(); minimizeVideo(); });