Commit 2d4747aef4e449f18ddea17f30ebb8a9b8b9cfb6
Exists in
master
and in
1 other branch
Merge branch 'master' of git.ucsd.edu:110swag/flashy-frontend
Showing 4 changed files Side-by-side Diff
scripts/FlashcardDirective.js
View file @
2d4747a
... | ... | @@ -22,7 +22,18 @@ |
22 | 22 | }; |
23 | 23 | angular.element($window).bind('resize', refresh_width); |
24 | 24 | refresh_width(); |
25 | - | |
25 | + scope.textPieces = []; | |
26 | + console.log(scope.flashcard); | |
27 | + scope.flashcard.mask.sort(function(a, b) { | |
28 | + return a[0] - b[0]; | |
29 | + }); | |
30 | + var i = 0; | |
31 | + scope.flashcard.mask.forEach(function(blank) { | |
32 | + scope.textPieces.push({text: scope.flashcard.text.slice(i, blank[0])}); | |
33 | + scope.textPieces.push({text: scope.flashcard.text.slice(blank[0], blank[1]), blank: true}); | |
34 | + i = blank[1]; | |
35 | + }); | |
36 | + scope.textPieces.push({text: scope.flashcard.text.slice(i)}); | |
26 | 37 | /* Pulls card from feed into deck */ |
27 | 38 | scope.pullCard = function(flashcard) { |
28 | 39 | if ($state.current.name == 'feed') { |
scripts/UserService.js
View file @
2d4747a
styles/flashy.css
View file @
2d4747a
templates/flashcard.html
View file @
2d4747a
1 | 1 | <div class="card flashy smallify" ng-init="startShrink = false" |
2 | 2 | ng-class="{'shrinky': startShrink}"> |
3 | 3 | <div class="valign-wrapper"> |
4 | - <div class="card-content valign"> | |
5 | - <p>{{flashcard.text}}</p> | |
4 | + <div class="card-content valign center-align"> | |
5 | + <span ng-repeat="piece in textPieces" | |
6 | + ng-style="piece.blank ? {'opacity':'0.4', 'border-bottom': '1px solid black'} : {}">{{piece.text}}</span> | |
6 | 7 | </div> |
7 | 8 | </div> |
8 | 9 | <div class="card-overlay"> |