HUGE refactor

This commit is contained in:
Nicky Case 2017-07-13 11:41:43 -04:00
parent eaef2c71e4
commit 1a17694633
6 changed files with 28 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View file

@ -97,6 +97,9 @@ body{
-moz-user-select: none; /* Firefox all */ -moz-user-select: none; /* Firefox all */
-ms-user-select: none; /* IE 10+ */ -ms-user-select: none; /* IE 10+ */
user-select: none; user-select: none;
transform-origin: 97.5px 27.5px;
transition: transform 0.1s ease-out;
} }
.button #background{ .button #background{
position: absolute; position: absolute;
@ -130,6 +133,7 @@ body{
} }
.button[hover=yes]{ .button[hover=yes]{
z-index: 100; z-index: 100;
transform: scale(1.02, 1.02);
} }
.button[hover=yes] #background{ .button[hover=yes] #background{
background-position: 0px -125px !important; background-position: 0px -125px !important;
@ -143,6 +147,9 @@ body{
.button[deactivated=yes] #hitbox{ .button[deactivated=yes] #hitbox{
display: none; display: none;
} }
.button[size=short]{
transform-origin: 57.5px 27.5px;
}
.button[size=short] #background{ .button[size=short] #background{
background: url(../assets/ui/button_short.png); background: url(../assets/ui/button_short.png);
background-size: 100%; background-size: 100%;
@ -154,6 +161,9 @@ body{
.button[size=short] #hitbox{ .button[size=short] #hitbox{
width:115px; width:115px;
} }
.button[size=long]{
transform-origin: 172.5px 27.5px;
}
.button[size=long] #background{ .button[size=long] #background{
background: url(../assets/ui/button_long.png); background: url(../assets/ui/button_long.png);
background-size: 100%; background-size: 100%;
@ -166,6 +176,9 @@ body{
.button[size=long] #hitbox{ .button[size=long] #hitbox{
width:345px; width:345px;
} }
.button:active{
transform: scale(0.95, 0.95);
}
/*************************/ /*************************/

View file

@ -25,6 +25,7 @@
<script src="js/lib/minpubsub.src.js"></script> <script src="js/lib/minpubsub.src.js"></script>
<script src="js/lib/q.js"></script> <script src="js/lib/q.js"></script>
<script src="js/lib/pixi.min.js"></script> <script src="js/lib/pixi.min.js"></script>
<script src="js/lib/howler.js"></script>
<script>var createjs = window;</script> <script>var createjs = window;</script>
<script src="js/lib/tweenjs-0.6.2.min.js"></script> <script src="js/lib/tweenjs-0.6.2.min.js"></script>
<script>Ticker.framerate=60; Ticker.paused=true;</script> <script>Ticker.framerate=60; Ticker.paused=true;</script>

View file

@ -1,3 +1,8 @@
Loader.addToManifest(Loader.manifest,{
scratch_in: "assets/sounds/scratch_in.mp3",
scratch_out: "assets/sounds/scratch_out.mp3"
});
(function(exports){ (function(exports){
var Scratcher = {}; var Scratcher = {};
@ -41,6 +46,7 @@ subscribe("slideshow/scratch", Scratcher.scratch);
Scratcher.scratchAnim = function(scratchIn){ Scratcher.scratchAnim = function(scratchIn){
var dom = $("#scratcher"); var dom = $("#scratcher");
var deferred = Q.defer(); var deferred = Q.defer();
var frame = 0; var frame = 0;
@ -53,7 +59,14 @@ Scratcher.scratchAnim = function(scratchIn){
Scratcher.gotoFrame(scratchIn, frame); Scratcher.gotoFrame(scratchIn, frame);
} }
},40); },40);
setTimeout(function(){
var sound = scratchIn ? Loader.sounds.scratch_in : Loader.sounds.scratch_out;
sound.volume(0.7).play();
},100);
return deferred.promise; return deferred.promise;
}; };
Scratcher.gotoFrame = function(scratchIn, frame){ Scratcher.gotoFrame = function(scratchIn, frame){
var dom = $("#scratcher"); var dom = $("#scratcher");

View file

@ -379,6 +379,7 @@ function Tournament(config){
// TODO: KILL ALL LISTENERS, TOO. // TODO: KILL ALL LISTENERS, TOO.
// TODO: Don't screw up when paused or looking at new tab // TODO: Don't screw up when paused or looking at new tab
self.remove = function(INSTANT){ self.remove = function(INSTANT){
_stopAutoPlay();
for(var i=0; i<self.agents.length; i++) unlisten(self.agents[i]); for(var i=0; i<self.agents.length; i++) unlisten(self.agents[i]);
unlisten(self); unlisten(self);
app.destroy(); app.destroy();