add new cards and images

This commit is contained in:
Juraj Michalek
2014-12-26 19:01:56 +00:00
parent 246edf1202
commit 0bd9c6a81d
14 changed files with 65 additions and 67 deletions

View File

@@ -68,8 +68,8 @@ flippy.fancy {
position: relative; position: relative;
font-size: .8em; font-size: .8em;
cursor: pointer; cursor: pointer;
width: 250px; width: 150px;
height: 250px; height: 150px;
} }
flippy.fancy img { flippy.fancy img {
height: 100%; height: 100%;

BIN
img/cards/barrel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
img/cards/butterfly.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
img/cards/carrot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
img/cards/cheese.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
img/cards/cherry.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
img/cards/cloud.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
img/cards/dwarf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
img/cards/ghost.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

12
img/cards/images.txt Normal file
View File

@@ -0,0 +1,12 @@
Images available under CC
barrel - http://pixabay.com/en/barrel-keg-wood-vintage-wooden-575341/
butterfly - http://pixabay.com/en/animal-butterfly-insect-nature-156895/
carrot - http://pixabay.com/en/carrot-vegetable-food-fresh-575529/
cherry - http://pixabay.com/en/cherry-stem-fruit-red-ripe-fresh-575547/
cheese - http://pixabay.com/en/swiss-cheese-swiss-cheese-food-575542/
cloud - http://pixabay.com/en/weather-clouds-fog-weather-forecast-157120/
dwarf - http://pixabay.com/en/gnome-statue-decoration-dwarf-elf-575475/
ghost - http://pixabay.com/en/ghost-spooky-white-ghostly-scary-156656/
rose - http://pixabay.com/en/flower-red-rose-blossom-nature-156608/
sun - http://pixabay.com/en/sun-weather-weather-forecast-sunny-157126/

BIN
img/cards/rose.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
img/cards/sun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@@ -56,7 +56,8 @@
</flippy-front> </flippy-front>
<flippy-back> <flippy-back>
{{card.cardId}} <img src="img/cards/{{card.cardId}}.png" ng-show="card.cardType == 'picture'">
<div ng-hide="card.cardType == 'picture'">{{card.card['en-US']}}</div>
</flippy-back> </flippy-back>
</flippy> </flippy>

View File

@@ -8,6 +8,9 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
// How many cards must be found as the same. // How many cards must be found as the same.
$scope.chainLength = 2; $scope.chainLength = 2;
// Whic card types are active
$scope.currentCardTypes = [ 'picture', 'picture' ];
/** /**
* Level descriptor: * Level descriptor:
* *
@@ -71,50 +74,55 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
}; };
$scope.basicCards = { $scope.basicCards = {
'printer' : { 'cherry' : {
'cs-CZ': 'tiskárna', 'cs-CZ': 'třešnička',
'en-US': 'house', 'en-US': 'cherry',
'sk-SK': 'tlačiareň' 'sk-SK': 'čerešňa'
}, },
'toner' : { 'cheese' : {
'cs-CZ': 'toner', 'cs-CZ': 'r',
'en-US': 'toner', 'en-US': 'cheese',
'sk-SK': 'toner' 'sk-SK': 'syr'
},
'carrot' : {
'cs-CZ': 'mrkev',
'en-US': 'carrot',
'sk-SK': 'mrkva'
}, },
'finisher': { 'dwarf': {
'cs-CZ': 'finisher', 'cs-CZ': 'trpaslík',
'en-US': 'finisher', 'en-US': 'dwarf',
'sk-SK': 'finisher' 'sk-SK': 'trpaslík'
}, },
'paper': { 'barrel': {
'cs-CZ': 'papír', 'cs-CZ': 'sud',
'en-US': 'paper', 'en-US': 'barrel',
'sk-SK': 'papier' 'sk-SK': 'sud'
}, },
'black': { 'butterfly': {
'cs-CZ': 'černá', 'cs-CZ': 'motýl',
'en-US': 'black', 'en-US': 'butterfly',
'sk-SK': 'čierna' 'sk-SK': 'motýľ'
}, },
'white': { 'ghost': {
'cs-CZ': 'bílá', 'cs-CZ': 'duch',
'en-US': 'white', 'en-US': 'ghost',
'sk-SK': 'biela' 'sk-SK': 'duch'
}, },
'color': { 'rose': {
'cs-CZ': 'barva', 'cs-CZ': 'růže',
'en-US': 'color', 'en-US': 'rose',
'sk-SK': 'farba' 'sk-SK': 'ruža'
}, },
'duplexPrint': { 'sun': {
'cs-CZ': 'oboustranný tisk', 'cs-CZ': 'slunce',
'en-US': 'duplex print', 'en-US': 'sun',
'sk-SK': 'obostranná tlač' 'sk-SK': 'slnko'
}, },
'stapler': { 'cloud': {
'cs-CZ': 'sešívačka', 'cs-CZ': 'oblak',
'en-US': 'stapler', 'en-US': 'cloud',
'sk-SK': 'zošívačka' 'sk-SK': 'oblak'
} }
}; };
@@ -122,33 +130,7 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
$scope.cards = $scope.basicCards; $scope.cards = $scope.basicCards;
$scope.maxSelected = 2; $scope.maxSelected = 2;
$scope.board = [ $scope.board = [];
{
cardId:'house',
index:1,
state: 'solved'
}, {
cardId: 'dog',
index:1,
state: 'mystery'
}, {
cardId:'house',
index:2,
state: 'solved'
}, {
cardId:'printer',
index:1,
state: 'mystery'
}, {
cardId: 'dog',
index:2,
state: 'mystery'
},{
cardId:'printer',
index:2,
state: 'mystery'
}
];
/** /**
* Generate playing card object. * Generate playing card object.
@@ -157,6 +139,7 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
return { return {
cardId: cardId, cardId: cardId,
card: card, card: card,
cardType: 'picture',
index: index, index: index,
state: 'mystery', state: 'mystery',
flipState: '' flipState: ''
@@ -179,7 +162,8 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
var card = fullStack[cardIndex]; var card = fullStack[cardIndex];
fullStack.splice(cardIndex, 1); fullStack.splice(cardIndex, 1);
for (var instanceIndex = 0; instanceIndex < $scope.chainLength; instanceIndex++) { for (var instanceIndex = 0; instanceIndex < $scope.chainLength; instanceIndex++) {
var tempCard = $scope.getCard(card, card.cardId, instanceIndex + 1) var tempCard = $scope.getCard(card, card.cardId, instanceIndex + 1);
tempCard.cardType = $scope.currentCardTypes[instanceIndex];
stack.push(tempCard); stack.push(tempCard);
} }
} }
@@ -299,6 +283,7 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
$scope.initLevel = function(event, args) { $scope.initLevel = function(event, args) {
$scope.levelIndex = args.levelIndex; $scope.levelIndex = args.levelIndex;
$scope.currentLevel = $scope.levels[$scope.levelIndex]; $scope.currentLevel = $scope.levels[$scope.levelIndex];
$scope.currentCardTypes = $scope.currentLevel.cardTypes;
$scope.generateBoard($scope.currentLevel.totalCards); $scope.generateBoard($scope.currentLevel.totalCards);
$scope.isLevelVisible = true; $scope.isLevelVisible = true;
}; };