diff --git a/app/index.html b/app/index.html index 660f7fac..81b04978 100644 --- a/app/index.html +++ b/app/index.html @@ -26,13 +26,14 @@
+
+ diff --git a/app/js/config.js b/app/js/config.js index d275ad1d..90a3b6d6 100644 --- a/app/js/config.js +++ b/app/js/config.js @@ -26,6 +26,7 @@ angular.module('app').config(['$provide','$stateProvider', '$urlRouterProvider', } }) .state('shipyard', { url: '/', templateUrl: 'views/page-shipyard.html', controller: 'ShipyardController' }) + .state('comparison', { url: '/comparison', templateUrl: 'views/page-comparison.html', controller: 'ComparisonController' }) .state('error', { params: {type:null, message:null, details: null }, templateUrl: 'views/page-error.html', controller: 'ErrorController' }) // Redirects diff --git a/app/js/controllers/controller-comparison.js b/app/js/controllers/controller-comparison.js new file mode 100644 index 00000000..90604a9b --- /dev/null +++ b/app/js/controllers/controller-comparison.js @@ -0,0 +1,24 @@ +angular.module('app').controller('ComparisonController', ['$rootScope', '$scope', 'ShipsDB', 'Ship', 'Persist', 'Serializer', function ($rootScope, $scope, Ships, Ship, Persist, Serializer) { + $rootScope.title = 'Coriolis - Comparison'; + $rootScope.bodyClass = 'docking-bay'; + + var comparison = $scope.comparison = []; + + for (var shipId in Persist.builds) { + var data = Ships[shipId]; + for (var buildName in Persist.builds[shipId]) { + var code = Persist.builds[shipId][buildName]; + var ship = new Ship(shipId, data.properties, data.slots); // Create a new Ship instance + Serializer.toShip(ship, code); // Populate components from 'code' URL param + + comparison.push({ + shipId: shipId, + buildName: buildName, + ship: ship, + code: code + }); + } + } + + +}]); \ No newline at end of file diff --git a/app/js/directives/directive-header.js b/app/js/directives/directive-header.js index 706e1eaa..6218f1ed 100644 --- a/app/js/directives/directive-header.js +++ b/app/js/directives/directive-header.js @@ -29,6 +29,7 @@ angular.module('app').directive('shipyardHeader', ['lodash','$rootScope', 'Persi $rootScope.$on('close', function () { scope.openedMenu = null; + $rootScope.showAbout = false; }); scope.updateInsurance = function(){ @@ -49,6 +50,17 @@ angular.module('app').directive('shipyardHeader', ['lodash','$rootScope', 'Persi scope.openedMenu = menu; }; + scope.about = function(e) { + e.preventDefault(); + e.stopPropagation(); + scope.openedMenu = null; + $rootScope.showAbout = true; + }; + + $rootScope.hideAbout = function (){ + $rootScope.showAbout = false; + } + } }; }]); \ No newline at end of file diff --git a/app/js/shipyard/factory-ship.js b/app/js/shipyard/factory-ship.js index 939763db..20e96eca 100644 --- a/app/js/shipyard/factory-ship.js +++ b/app/js/shipyard/factory-ship.js @@ -56,7 +56,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', if (comps.internal[i] !== 0) { internal[i].id = comps.internal[i]; internal[i].c = Components.internal(comps.internal[i]); - if (internal[i].c.group == 'sg') { + if (internal[i].c.grp == 'sg') { this.sgSI = i; } } else { diff --git a/app/less/app.less b/app/less/app.less index 3159d243..994cc333 100644 --- a/app/less/app.less +++ b/app/less/app.less @@ -8,7 +8,9 @@ @import 'list'; @import 'slot'; @import 'outfit'; +@import 'table'; @import 'select'; +@import 'modal'; @import 'charts'; @import 'error'; @@ -58,6 +60,17 @@ body { clear: both; } +h1 { + font-family: @fTitle; + color: @primary; +} + +h2 { + text-transform: uppercase; + font-family: @fTitle; +} + + a, a:visited { color: @fg; } diff --git a/app/less/error.less b/app/less/error.less index 098105d0..82b1b9a1 100644 --- a/app/less/error.less +++ b/app/less/error.less @@ -7,4 +7,10 @@ small { color: @primary-disabled; } +} + +pre { + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -o-pre-wrap; } \ No newline at end of file diff --git a/app/less/header.less b/app/less/header.less index af509a8e..5ca95642 100644 --- a/app/less/header.less +++ b/app/less/header.less @@ -46,13 +46,18 @@ header { width: 25em; font-family: @fStandard; position: absolute; - padding: 0 0 1em 1em; + padding: 1em 1em; overflow: hidden; background-color: @bgBlack; font-size: 0.8em; &.sm { - width: 15em; + width: auto; + } + + hr { + border: none; + border-top: 1px solid @disabled; } } diff --git a/app/less/modal.less b/app/less/modal.less new file mode 100644 index 00000000..8ce841ac --- /dev/null +++ b/app/less/modal.less @@ -0,0 +1,36 @@ + + +.modal-bg { + z-index: 2; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(0,0,0,0.5); +} + +.modal { + width: 50%; + padding: 3em; + margin: 10em auto 0; + background-color: @bgBlack; + border: 1px solid @primary; + + h1 { + margin: 0.2em 0; + } + + h2 { + margin: 0; + } +} + +.dismiss { + outline: none; + background-color: @primary-bg; + font-family: @fStandard; + color: @primary; + line-height: 1.5em; + border: 1px solid @primary; +} \ No newline at end of file diff --git a/app/less/outfit.less b/app/less/outfit.less index 2c4608e6..aafbd187 100644 --- a/app/less/outfit.less +++ b/app/less/outfit.less @@ -6,9 +6,7 @@ #overview { h1 { - font-family: @fTitle; margin: 0.2em 0; - color: @primary; float: left; } } diff --git a/app/less/shipyard.less b/app/less/shipyard.less index f77ad467..03de31f2 100644 --- a/app/less/shipyard.less +++ b/app/less/shipyard.less @@ -21,9 +21,7 @@ a.ship { h2 { width: 100%; - text-transform: uppercase; margin: 0; - font-family: @fTitle; text-align: left; } diff --git a/app/less/table.less b/app/less/table.less new file mode 100644 index 00000000..79a457f6 --- /dev/null +++ b/app/less/table.less @@ -0,0 +1,34 @@ + +table { + margin: 0 auto; + background-color: @primary-bg; + border-spacing: 0; + font-size: 0.8em; + + a { + text-decoration: none; + } +} + +thead { + color: @bgBlack; + background-color: @primary-disabled; +} + + +tbody tr { + + &:hover { + color: #000; + background-color: @secondary; + } +} + +th { + padding: 0.1em 0.5em; +} + +td { + padding-left: 0.5em; + font-size: 0.9em; +} \ No newline at end of file diff --git a/app/views/_header.html b/app/views/_header.html index 60b0f2f0..d62ba354 100644 --- a/app/views/_header.html +++ b/app/views/_header.html @@ -20,20 +20,35 @@ + + diff --git a/app/views/about.html b/app/views/about.html new file mode 100644 index 00000000..eff71299 --- /dev/null +++ b/app/views/about.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/app/views/page-comparison.html b/app/views/page-comparison.html new file mode 100644 index 00000000..6e27b7dd --- /dev/null +++ b/app/views/page-comparison.html @@ -0,0 +1,54 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ShipBuildAgilitySpeedBoostShield
Strength
ArmourMassPowerFuelCargoJump RangeCost
UnladenLadenRetracted%Deployed%AvailableUnladenLaden
{{b.ship.speed}} M/s{{b.ship.boost}} M/s{{fRound(b.ship.shieldStrength)}} Mj{{fRound(b.ship.unladenMass)}} T{{fRound(b.ship.ladenMass)}} T{{fPwr(b.ship.powerRetracted)}} MW{{fPct(b.ship.powerRetracted/b.ship.powerAvailable)}}{{fPwr(b.ship.powerDeployed)}} MW{{fPct(b.ship.powerDeployed/b.ship.powerAvailable)}}{{fPwr(b.ship.powerAvailable)}} MW{{fRound(b.ship.fuelCapacity)}} T{{fRound(b.ship.cargoCapacity)}} T{{fRound(b.ship.unladenJumpRange)}} LY{{fRound(b.ship.ladenJumpRange)}} LY{{b.ship.totalCost}} CR
+
+ + + \ No newline at end of file