Skip to content

Commit

Permalink
(#16) Start menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Tang committed Feb 6, 2014
1 parent 1b56618 commit 13531f4
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 8 deletions.
5 changes: 4 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'pages/main.html'
templateUrl: 'pages/startmenu.html'
})
.when('/tutorial', {
templateUrl: 'pages/tutorial.html'
})
.otherwise({
redirectTo: '/'
Expand Down
2 changes: 0 additions & 2 deletions app/pages/main.html

This file was deleted.

10 changes: 10 additions & 0 deletions app/pages/startmenu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--
~ Copyright (c) 2014.
~
~ @author Andy Tang
-->
<h1>Start menu</h1>
<nav>
<a href="/#/tutorial">Tutorial</a>
<a href="/#/versus">Versus</a>
</nav>
7 changes: 7 additions & 0 deletions app/pages/tutorial.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
~ Copyright (c) 2014.
~
~ @author Andy Tang
-->
<h1>Tutorial</h1>
<section data-first-attack-scene=""></section>
28 changes: 27 additions & 1 deletion app/styles/game.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ body {
-o-background-size: cover;
background-size: cover;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
.prevent-selection();
}

h1 {
.borderRadius(12px);
background: rgba(150, 150, 150, 0.5);
background: rgba(150, 150, 150, 0.8);
padding: 20px;
margin: 30px 30px;
font-size: 24px;
Expand All @@ -53,6 +54,31 @@ h2 {
color: @mainColor;
}

nav {
.borderRadius(12px);
overflow: hidden;
background: rgba(150, 150, 150, 0.8);
margin: 30px;

a:link,
a:visited {
font-size: 18px;
font-weight: bold;
text-decoration: none;
color: #36363b;
text-align: center;
display: block;
margin-left: auto;
margin-right: auto;
padding: 15px 30px 15px 30px;

&:hover {
background: rgba(50, 50, 50, 0.8);
color: #fff;
}
}
}

.game-board {
.borderRadius(12px);
position: absolute;
Expand Down
12 changes: 12 additions & 0 deletions app/styles/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
border-top-right-radius: @radius;
border-top-left-radius: @radius;
}

.border-right-radius(@radius) {
border-bottom-right-radius: @radius;
border-top-right-radius: @radius;
}

.border-bottom-radius(@radius) {
border-bottom-right-radius: @radius;
border-bottom-left-radius: @radius;
}

.border-left-radius(@radius) {
border-bottom-left-radius: @radius;
border-top-left-radius: @radius;
Expand All @@ -31,4 +34,13 @@
-webkit-opacity: @opacity;
-moz-opacity: @opacity;
opacity: @opacity;
}

.prevent-selection() {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
2 changes: 0 additions & 2 deletions e2e-karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ module.exports = function (config) {

// list of files / patterns to load in the browser
files: [
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/e2e/**/*.js'
],

Expand Down
3 changes: 1 addition & 2 deletions test/e2e/FirstAttackScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
describe('First Attack Scene Scenarios', function FirstAttackScene() {

beforeEach(function () {
browser().navigateTo('/');
browser().navigateTo('/#/tutorial');
});

it('should have one saber and one sword soldier', function oneCharacter() {
Expand All @@ -21,7 +21,6 @@
});

it('should show a menu when clicking on a character', function actionMenu() {
expect(element('.game-square:has(.saber)').count()).toEqual(1);
clickOnSaber();
expect(element('.game-square:has(.saber) .action-menu li').count()).toEqual(3);
var text = element('.game-square:has(.saber) li').text();
Expand Down

0 comments on commit 13531f4

Please sign in to comment.