mirror of
https://github.com/ysoftdevs/pf2015.git
synced 2026-03-28 20:12:02 +01:00
add math levels
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.7/angular.min.js"></script>
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.7/angular.min.js"></script>
|
||||||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<script type="text/javascript" src="js/level-data-service.js"></script>
|
||||||
<script type="text/javascript" src="js/pexeso-controller.js"></script>
|
<script type="text/javascript" src="js/pexeso-controller.js"></script>
|
||||||
<link rel="stylesheet" href="css/pexeso.css" type="text/css" />
|
<link rel="stylesheet" href="css/pexeso.css" type="text/css" />
|
||||||
|
|
||||||
@@ -66,8 +67,8 @@
|
|||||||
</flippy-front>
|
</flippy-front>
|
||||||
|
|
||||||
<flippy-back>
|
<flippy-back>
|
||||||
<span class="cardHelper"></span><img ng-src="img/cards/{{card.cardId}}.png" ng-show="card.cardType == 'picture'">
|
<span class="cardHelper" ng-show="card.cardType == 'picture'"></span><img ng-src="img/cards/{{card.image}}.png" ng-show="card.cardType == 'picture'">
|
||||||
<div ng-hide="card.cardType == 'picture'">{{card.card['en-US']}}</div>
|
<div ng-hide="card.cardType == 'picture'">{{card.label}}</div>
|
||||||
</flippy-back>
|
</flippy-back>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
122
js/level-data-service.js
Normal file
122
js/level-data-service.js
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
|
||||||
|
var basicCards = {
|
||||||
|
'cherry' : {
|
||||||
|
'cs-CZ': 'třešnička',
|
||||||
|
'en-US': 'cherry',
|
||||||
|
'sk-SK': 'čerešňa'
|
||||||
|
},
|
||||||
|
'cheese' : {
|
||||||
|
'cs-CZ': 'sýr',
|
||||||
|
'en-US': 'cheese',
|
||||||
|
'sk-SK': 'syr'
|
||||||
|
},
|
||||||
|
'carrot' : {
|
||||||
|
'cs-CZ': 'mrkev',
|
||||||
|
'en-US': 'carrot',
|
||||||
|
'sk-SK': 'mrkva'
|
||||||
|
},
|
||||||
|
'dwarf': {
|
||||||
|
'cs-CZ': 'trpaslík',
|
||||||
|
'en-US': 'dwarf',
|
||||||
|
'sk-SK': 'trpaslík'
|
||||||
|
},
|
||||||
|
'barrel': {
|
||||||
|
'cs-CZ': 'sud',
|
||||||
|
'en-US': 'barrel',
|
||||||
|
'sk-SK': 'sud'
|
||||||
|
},
|
||||||
|
'butterfly': {
|
||||||
|
'cs-CZ': 'motýl',
|
||||||
|
'en-US': 'butterfly',
|
||||||
|
'sk-SK': 'motýľ'
|
||||||
|
},
|
||||||
|
'ghost': {
|
||||||
|
'cs-CZ': 'duch',
|
||||||
|
'en-US': 'ghost',
|
||||||
|
'sk-SK': 'duch'
|
||||||
|
},
|
||||||
|
'rose': {
|
||||||
|
'cs-CZ': 'růže',
|
||||||
|
'en-US': 'rose',
|
||||||
|
'sk-SK': 'ruža'
|
||||||
|
},
|
||||||
|
'sun': {
|
||||||
|
'cs-CZ': 'slunce',
|
||||||
|
'en-US': 'sun',
|
||||||
|
'sk-SK': 'slnko'
|
||||||
|
},
|
||||||
|
'cloud': {
|
||||||
|
'cs-CZ': 'oblak',
|
||||||
|
'en-US': 'cloud',
|
||||||
|
'sk-SK': 'oblak'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var mathCards = {
|
||||||
|
'zero': {
|
||||||
|
'arabic': '0',
|
||||||
|
'roman': 'nulla',
|
||||||
|
'math': '1-1',
|
||||||
|
'japanese': '〇'
|
||||||
|
},
|
||||||
|
'one': {
|
||||||
|
'arabic': '1',
|
||||||
|
'roman': 'I',
|
||||||
|
'math': '4/4',
|
||||||
|
'japanese': '一'
|
||||||
|
},
|
||||||
|
'two': {
|
||||||
|
'arabic': '2',
|
||||||
|
'roman': 'II',
|
||||||
|
'math': '1+1',
|
||||||
|
'japanese': '二'
|
||||||
|
},
|
||||||
|
'three':{
|
||||||
|
'arabic': '3',
|
||||||
|
'roman': 'III',
|
||||||
|
'math': '1+2',
|
||||||
|
'japanese': '三'
|
||||||
|
},
|
||||||
|
'four': {
|
||||||
|
'arabic': '4',
|
||||||
|
'roman': 'IV',
|
||||||
|
'math': '2*2',
|
||||||
|
'japanese': '四'
|
||||||
|
},
|
||||||
|
'five': {
|
||||||
|
'arabic': '5',
|
||||||
|
'roman': 'V',
|
||||||
|
'math': '8-3',
|
||||||
|
'japanese': '五'
|
||||||
|
},
|
||||||
|
'six': {
|
||||||
|
'arabic': '6',
|
||||||
|
'roman': 'VI',
|
||||||
|
'math': '2*3',
|
||||||
|
'japanese': '六'
|
||||||
|
},
|
||||||
|
'seven': {
|
||||||
|
'arabic': '7',
|
||||||
|
'roman': 'VII',
|
||||||
|
'math': '4+3',
|
||||||
|
'japanese': '七'
|
||||||
|
},
|
||||||
|
'eight': {
|
||||||
|
'arabic': '8',
|
||||||
|
'roman': 'VIII',
|
||||||
|
'math': '2*4',
|
||||||
|
'japanese': '八'
|
||||||
|
},
|
||||||
|
'nine': {
|
||||||
|
'arabic': '9',
|
||||||
|
'roman': 'IX',
|
||||||
|
'math': '3*3',
|
||||||
|
'japanese': '九'
|
||||||
|
},
|
||||||
|
'ten': {
|
||||||
|
'arabic': '10',
|
||||||
|
'roman': 'X',
|
||||||
|
'math': '4*2+2',
|
||||||
|
'japanese': '十'
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -35,59 +35,100 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
|
|||||||
*/
|
*/
|
||||||
$scope.levels = [
|
$scope.levels = [
|
||||||
{
|
{
|
||||||
levelName: "01: 2x2 Picture",
|
levelName: "01: 2 Pictures",
|
||||||
totalCards: 2*2,
|
totalCards: 2*2,
|
||||||
cardsPerRow: 2,
|
cardsPerRow: 2,
|
||||||
chainLength: 2,
|
chainLength: 2,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'picture']
|
cardTypes: ['picture', 'picture']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
levelName: "02: 3x3 Picture",
|
levelName: "02: 3 Pictures",
|
||||||
totalCards: 3*3,
|
totalCards: 3*3,
|
||||||
cardsPerRow: 3,
|
cardsPerRow: 3,
|
||||||
chainLength: 3,
|
chainLength: 3,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'picture', 'picture']
|
cardTypes: ['picture', 'picture', 'picture']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
levelName: "03: 4x4 Picture",
|
levelName: "03: 4 Pictures",
|
||||||
totalCards: 4*4,
|
totalCards: 4*4,
|
||||||
cardsPerRow: 4,
|
cardsPerRow: 4,
|
||||||
chainLength: 4,
|
chainLength: 4,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'picture', 'picture', 'picture']
|
cardTypes: ['picture', 'picture', 'picture', 'picture']
|
||||||
}, {
|
}, {
|
||||||
totalCards: 4*4,
|
levelName: "04: Simple Math",
|
||||||
cardsPerRow: 4,
|
totalCards: 3*2,
|
||||||
|
cardsPerRow: 3,
|
||||||
chainLength: 2,
|
chainLength: 2,
|
||||||
cardTypes: ['picture', 'picture']
|
cardSet: mathCards,
|
||||||
|
cardTypes: ['arabic', 'math']
|
||||||
}, {
|
}, {
|
||||||
|
levelName: "05: Roman",
|
||||||
|
totalCards: 3*2,
|
||||||
|
cardsPerRow: 3,
|
||||||
|
chainLength: 2,
|
||||||
|
cardSet: mathCards,
|
||||||
|
cardTypes: ['arabic', 'roman']
|
||||||
|
}, {
|
||||||
|
levelName: "06: Japanese",
|
||||||
|
totalCards: 3*2,
|
||||||
|
cardsPerRow: 3,
|
||||||
|
chainLength: 2,
|
||||||
|
cardSet: mathCards,
|
||||||
|
cardTypes: ['arabic', 'japanese']
|
||||||
|
}, {
|
||||||
|
levelName: "07: 4x MIX",
|
||||||
totalCards: 4*4,
|
totalCards: 4*4,
|
||||||
cardsPerRow: 4,
|
cardsPerRow: 4,
|
||||||
|
chainLength: 4,
|
||||||
|
cardSet: mathCards,
|
||||||
|
cardTypes: ['arabic', 'math', 'roman', 'japanese']
|
||||||
|
},{
|
||||||
|
levelName: "04: Picture + Word",
|
||||||
|
totalCards: 2*2,
|
||||||
|
cardsPerRow: 2,
|
||||||
chainLength: 2,
|
chainLength: 2,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'en-US']
|
cardTypes: ['picture', 'en-US']
|
||||||
}, {
|
}, {
|
||||||
|
levelName: "05: Picture + Word",
|
||||||
totalCards: 4*4,
|
totalCards: 4*4,
|
||||||
cardsPerRow: 4,
|
cardsPerRow: 4,
|
||||||
chainLength: 2,
|
chainLength: 2,
|
||||||
|
cardSet: basicCards,
|
||||||
|
cardTypes: ['picture', 'en-US']
|
||||||
|
}, {
|
||||||
|
levelName: "06: Picture + Foreign Word",
|
||||||
|
totalCards: 4*4,
|
||||||
|
cardsPerRow: 4,
|
||||||
|
chainLength: 2,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'oneLanguage']
|
cardTypes: ['picture', 'oneLanguage']
|
||||||
}, {
|
}, {
|
||||||
totalCards: 4*4,
|
totalCards: 4*4,
|
||||||
cardsPerRow: 4,
|
cardsPerRow: 4,
|
||||||
chainLength: 2,
|
chainLength: 2,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'randomLanguage']
|
cardTypes: ['picture', 'randomLanguage']
|
||||||
}, {
|
}, {
|
||||||
totalCards: 3*3,
|
totalCards: 3*3,
|
||||||
cardsPerRow: 3,
|
cardsPerRow: 3,
|
||||||
chainLength: 3,
|
chainLength: 3,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'picture', 'picture']
|
cardTypes: ['picture', 'picture', 'picture']
|
||||||
}, {
|
}, {
|
||||||
totalCards: 3*3,
|
totalCards: 3*3,
|
||||||
cardsPerRow: 3,
|
cardsPerRow: 3,
|
||||||
chainLength: 3,
|
chainLength: 3,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'randomLanguage', 'randomLanguage']
|
cardTypes: ['picture', 'randomLanguage', 'randomLanguage']
|
||||||
}, {
|
}, {
|
||||||
totalCards: 4*4,
|
totalCards: 4*4,
|
||||||
cardsPerRow: 4,
|
cardsPerRow: 4,
|
||||||
chainLength: 4,
|
chainLength: 4,
|
||||||
|
cardSet: basicCards,
|
||||||
cardTypes: ['picture', 'randomLanguage', 'randomLanguage', 'randomLanguage']
|
cardTypes: ['picture', 'randomLanguage', 'randomLanguage', 'randomLanguage']
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -106,61 +147,9 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.basicCards = {
|
|
||||||
'cherry' : {
|
|
||||||
'cs-CZ': 'třešnička',
|
|
||||||
'en-US': 'cherry',
|
|
||||||
'sk-SK': 'čerešňa'
|
|
||||||
},
|
|
||||||
'cheese' : {
|
|
||||||
'cs-CZ': 'sýr',
|
|
||||||
'en-US': 'cheese',
|
|
||||||
'sk-SK': 'syr'
|
|
||||||
},
|
|
||||||
'carrot' : {
|
|
||||||
'cs-CZ': 'mrkev',
|
|
||||||
'en-US': 'carrot',
|
|
||||||
'sk-SK': 'mrkva'
|
|
||||||
},
|
|
||||||
'dwarf': {
|
|
||||||
'cs-CZ': 'trpaslík',
|
|
||||||
'en-US': 'dwarf',
|
|
||||||
'sk-SK': 'trpaslík'
|
|
||||||
},
|
|
||||||
'barrel': {
|
|
||||||
'cs-CZ': 'sud',
|
|
||||||
'en-US': 'barrel',
|
|
||||||
'sk-SK': 'sud'
|
|
||||||
},
|
|
||||||
'butterfly': {
|
|
||||||
'cs-CZ': 'motýl',
|
|
||||||
'en-US': 'butterfly',
|
|
||||||
'sk-SK': 'motýľ'
|
|
||||||
},
|
|
||||||
'ghost': {
|
|
||||||
'cs-CZ': 'duch',
|
|
||||||
'en-US': 'ghost',
|
|
||||||
'sk-SK': 'duch'
|
|
||||||
},
|
|
||||||
'rose': {
|
|
||||||
'cs-CZ': 'růže',
|
|
||||||
'en-US': 'rose',
|
|
||||||
'sk-SK': 'ruža'
|
|
||||||
},
|
|
||||||
'sun': {
|
|
||||||
'cs-CZ': 'slunce',
|
|
||||||
'en-US': 'sun',
|
|
||||||
'sk-SK': 'slnko'
|
|
||||||
},
|
|
||||||
'cloud': {
|
|
||||||
'cs-CZ': 'oblak',
|
|
||||||
'en-US': 'cloud',
|
|
||||||
'sk-SK': 'oblak'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.cards = $scope.basicCards;
|
$scope.cards = basicCards;
|
||||||
|
|
||||||
$scope.board = [];
|
$scope.board = [];
|
||||||
|
|
||||||
@@ -185,7 +174,7 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
|
|||||||
$scope.board = [];
|
$scope.board = [];
|
||||||
var fullStack = []
|
var fullStack = []
|
||||||
var stack = [];
|
var stack = [];
|
||||||
angular.forEach($scope.basicCards, function(card, cardId) {
|
angular.forEach($scope.currentLevel.cardSet, function(card, cardId) {
|
||||||
fullStack.push($scope.getCard(card, cardId, 1));
|
fullStack.push($scope.getCard(card, cardId, 1));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -196,6 +185,13 @@ angular.module('app', ['angular-flippy', 'level-selector', 'level-complete'])
|
|||||||
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];
|
tempCard.cardType = $scope.currentCardTypes[instanceIndex];
|
||||||
|
if (tempCard.cardType == 'picture') {
|
||||||
|
tempCard.image = tempCard.cardId;
|
||||||
|
tempCard.label = "";
|
||||||
|
} else {
|
||||||
|
tempCard.image = 'question';
|
||||||
|
tempCard.label = tempCard.card.card[tempCard.cardType];
|
||||||
|
}
|
||||||
stack.push(tempCard);
|
stack.push(tempCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user