Skip to content

Commit ef5d27b

Browse files
committed
Random code formatting
1 parent c03a83c commit ef5d27b

File tree

6 files changed

+27
-28
lines changed

6 files changed

+27
-28
lines changed

app/js/card/CardModel.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var CardModel = module.exports = Backbone.Model.extend({
4242

4343

4444
toggleSelect: function(){
45-
this.set({ selected: !this.get("selected") });
45+
this.set({ selected: !this.get('selected') });
4646
},
4747

4848
deselect: function(){
@@ -71,7 +71,7 @@ var CardModel = module.exports = Backbone.Model.extend({
7171
return this.get(att);
7272
}.bind(this));
7373

74-
return card.join(" ");
74+
return card.join(' ');
7575
}
7676

7777

app/js/card/CardParams.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var CardParams = module.exports = {
2828
DIAMOND : 'diamond'
2929
},
3030

31-
setAttrs: ["count", "color", "shade", "shape"],
31+
setAttrs: ['count', 'color', 'shade', 'shape'],
3232

3333
getRandom: function(obj){
3434
var keys = Object.keys(obj);

app/js/card/CardView.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,21 @@ var CardView = module.exports = Backbone.View.extend({
6969
// this svg only needs to be in the DOM once.
7070
// if it's already there (from a previous CardView), do nothing
7171
checkForStripies: function(){
72-
if (!$("#" + this.stripyId).length) {
72+
if (!$('#' + this.stripyId).length) {
7373
var stripies = require('./templates/stripies.handlebars');
74-
$("body").prepend(stripies({id: this.stripyId}));
74+
$('body').prepend(stripies({id: this.stripyId}));
7575
}
7676
},
7777

7878
// pass these events to the model, we're listening change:selected
7979
toggleSelect: function(){
8080
this.model.toggleSelect();
8181
},
82+
8283
select: function(){
8384
this.$el.addClass('selected');
8485
},
86+
8587
deselect: function(){
8688
this.$el.removeClass('selected');
8789
},

app/js/cards/CardsCollection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ var CardsCollection = module.exports = Backbone.Collection.extend({
7474
isSet: function(cards){
7575

7676
if (cards.length != 3){
77-
console.error("isSet has to be given 3 cards");
77+
console.error('isSet has to be given 3 cards');
7878
}
7979

8080
// for each attribute (color, count, shade, shape)

app/js/cards/CardsView.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var CardsView = module.exports = Backbone.View.extend({
2626

2727
// listen for keyboard events
2828
$(window).on('keydown', this.onKeypress.bind(this));
29-
$(window).on("resize", this.onResize.bind(this));
29+
$(window).on('resize', this.onResize.bind(this));
3030

3131
},
3232

@@ -153,7 +153,7 @@ var CardsView = module.exports = Backbone.View.extend({
153153

154154
// if there aren't any sets, reshuffle
155155
if (sets.length === 0){
156-
console.log("no sets :( ");
156+
console.log('no sets :( ');
157157

158158
// remove all cards from card collection
159159
while(this.cards.length > 0){
@@ -163,15 +163,15 @@ var CardsView = module.exports = Backbone.View.extend({
163163
this.addRandomCards();
164164
}
165165

166-
Backbone.trigger("cardsDealt");
167-
console.log(sets.join("\n"));
166+
Backbone.trigger('cardsDealt');
167+
console.log(sets.join('\n'));
168168
}
169169

170170
},
171171

172172
showSet: function(threeCards){
173173

174-
Backbone.trigger("setFound");
174+
Backbone.trigger('setFound');
175175

176176
this.cards.deselectAll();
177177

@@ -285,8 +285,8 @@ var CardsView = module.exports = Backbone.View.extend({
285285
if (!this.dim){
286286
this.dim = $('<div></div>').css({
287287
zIndex: 500,
288-
background: "rgba(255,255,255,0.9)",
289-
position: "fixed",
288+
background: 'rgba(255,255,255,0.9)',
289+
position: 'fixed',
290290
top: 0,
291291
right: 0,
292292
bottom: 0,

app/styl/card.styl

+12-15
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,32 @@ card-height = card-width*1.5;
3737
flex-direction: column;
3838
justify-content: center;
3939
align-items: center;
40-
4140
cursor: pointer;
42-
43-
&.animate-in {
44-
animation: bounceIn 1s both linear;
45-
46-
// animation: elastic-in 1s both linear;
47-
48-
// animation: rotateUp 1s both linear;
49-
// transform-origin: bottom center;
50-
}
51-
52-
// animation: fade-in 2s both linear;
53-
5441
transition: transform .2s ease-in-out;
55-
5642
margin: card-margin;
5743

44+
// animation: fade-in 2s both linear;
45+
5846
shape-margin-h = 14px;
5947
shape-margin-v = 3px;
6048
// shape-width = card-width - (shape-margin-h * 2);
6149
shape-width = 72%;
6250
shape-height = 25%;
6351
shape-stroke = 8px; // can be up to 10px (after that it gets cut off) http://stackoverflow.com/questions/7241393/can-you-control-how-an-svgs-stroke-width-is-drawn
6452

53+
&.animate-in {
54+
animation: bounceIn 1s both linear;
55+
56+
// animation: elastic-in 1s both linear;
57+
58+
// animation: rotateUp 1s both linear;
59+
// transform-origin: bottom center;
60+
}
61+
6562
&:nth-child(4n + 1){
6663
clear: both;
6764
}
68-
65+
6966
&.selected {
7067
box-shadow: 0px 0px 3px 2px #3498db;
7168
// animation: select-pop .3s both linear !important;

0 commit comments

Comments
 (0)