diff --git a/scripts/DeckController.js b/scripts/DeckController.js index 78c8ea6..2f49526 100644 --- a/scripts/DeckController.js +++ b/scripts/DeckController.js @@ -1,6 +1,6 @@ -var app = angular.module('flashy.DeckController', ['ui.router']); +angular.module('flashy.DeckController', ['ui.router']). -app.controller('DeckController', ['$scope', '$state', '$http', '$stateParams', +controller('DeckController', ['$scope', '$state', '$http', '$stateParams', function ($scope, $state, $http, $stateParams) { // cards array sectionId = $stateParams.sectionId; @@ -19,7 +19,7 @@ app.controller('DeckController', ['$scope', '$state', '$http', '$stateParams', /* Lets page refresh the cards shown on the page. */ $scope.refreshCards = function () { - var myDelay = 260; // ms + var myDelay = 200; // ms setTimeout(function () { $http.get('/api/sections/' + sectionId + '/deck/'). @@ -33,85 +33,5 @@ app.controller('DeckController', ['$scope', '$state', '$http', '$stateParams', }); }, myDelay); }; - - - /* all kmach's stuff below, do not touch */ - // reorganize cards in array based on time - $scope.filter = function (card) { - - // get index of card - var index = $scope.cards.indexOf(card); - - //$scope.cards[index]; - - - }; - - // remove card from deck - $scope.removeCard = function (card) { - - // get index of card - var index = $scope.cards.indexOf(card); - - $scope.cards.splice(index, 1); - - alert('Removed card!'); - }; - - - $scope.editCard = function (card) { - - var index = $scope.cards.indexOf(card); - - $('.modal-trigger').leanModal({ - dismissible: true, // Modal can be dismissed by clicking outside of the modal - opacity: .5, // Opacity of modal background - in_duration: 300, // Transition in duration - out_duration: 200, // Transition out duration - ready: function () { - - - $scope.editableContent = $scope.cards[index].content; - }, // Callback for Modal open - complete: function () { - - $scope.cards[index].content = $scope.editableContent; - - } // Callback for Modal close - } - ); - - - //alert($scope.cards[index].content); - - // post flashcard edits - /*$http.post('/api/flashcards/', { 'text': $scope.editedContent }). - success(function (data) { - console.log('No way, really?'); - }). - error(function (error) { - console.log('haha, n00b'); - }); - - */ - }; - - - // get all cards from your deck and push into array - /*$http.get('/api/sections/{pk}/deck'). - success(function(data) { - - - - for (var i = 0; i < data.length; i++) { - cards.push({ 'title': data[i].title, 'content': data[i].content }); - } - }). - error(function(data) { - - console.log('no cards?!!'); - - });*/ - - - }]); + } +]); diff --git a/scripts/FlashcardDirective.js b/scripts/FlashcardDirective.js index 9425626..e67cded 100644 --- a/scripts/FlashcardDirective.js +++ b/scripts/FlashcardDirective.js @@ -10,8 +10,9 @@ directive('flashcard', ['$http', '$state', '$window', refresh: '&' // eval refresh in parent html }, link: function(scope, element) { + /* Handles width of the card */ function refresh_width() { - avail = $window.innerWidth; + avail = $window.innerWidth - 17; if (avail > 992) avail -= 240; width = Math.floor(avail / Math.floor(avail / 250) - 12); element.children().css({width: width + 'px', height: (width * 3 / 5) + 'px'}); diff --git a/styles/flashy.css b/styles/flashy.css index 9e4ddf4..1d0fd78 100644 --- a/styles/flashy.css +++ b/styles/flashy.css @@ -66,7 +66,7 @@ ul.side-nav.fixed li a { float: left; text-align: center; margin: 6px; - transition: all 0.255s cubic-bezier(0, 0, 0.6, 1); + transition: all 0.2s cubic-bezier(0, 0, 0.6, 1); font-family: 'Titillium Web', sans-serif; } @@ -96,6 +96,11 @@ ul.side-nav.fixed li a { position: absolute; top: 50%; transform: translate(-50%, -50%); + transition: all 0.2s cubic-bezier(0, 0, 0.6, 1) 0s; +} + +.center-me:hover i { + text-shadow: 0 0 15px rgba(255,255,255,0.7); } .card:hover .card-overlay { @@ -105,7 +110,7 @@ ul.side-nav.fixed li a { } .top-box { - background-color: rgba(0, 10, 203, 0.6); + background-color: rgba(0, 81, 229, 0.6); height: 65%; position: relative; transition: all 0.2s cubic-bezier(0, 0, 0.6, 1) 0s; @@ -113,7 +118,7 @@ ul.side-nav.fixed li a { } .top-box:hover { - background-color: rgba(0, 10, 203, 0.7); + background-color: rgba(0, 81, 229, 0.75); } .bottom-box { @@ -131,11 +136,11 @@ ul.side-nav.fixed li a { } .left-box:hover { - background-color: rgba(15, 0, 155, 0.7); + background-color: rgba(15, 0, 155, 0.75); } .right-box { - background-color: rgba(0, 81, 189, 0.6); + background-color: rgba(207, 0, 86, 0.6); float: right; height: 100%; position: relative; @@ -144,13 +149,15 @@ ul.side-nav.fixed li a { } .right-box:hover { - background-color: rgba(0, 81, 189, 0.7); + background-color: rgba(207, 0, 86, 0.75); } .center-me { + height: 100%; margin: 0 auto; text-align: center; vertical-align: middle; + width: 100%; } .modal.bottom-sheet { @@ -205,7 +212,7 @@ ul.side-nav.fixed li a { body { background-color: #3e1944; - overflow: hidden; + overflow-x: hidden; } html {