Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/node_modules/*
**/vendor/*
**/*.min.js
/*.md
/package.json
/npm-debug.log
/procfile
**/build/*
41 changes: 41 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"rules": {
"no-console": 0,
"indent": [
2,
2
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
]
},
"env": {
"es6": true,
"node": true,
"browser": true,
"mocha": true
},
"globals": {
"describe": false,
"it": false,
"beforeEach": false,
"afterEach": false,
"before": false,
"after": false
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
86 changes: 86 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# application specific
db/
build/

# Created by https://www.gitignore.io/api/node,osx,vim

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history


### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Vim ###
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
22 changes: 22 additions & 0 deletions app/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
main ul {
list-style-type: none;
margin: 10px;
padding: 0;
display: block;
height: 300px;
width: 600px;
overflow-y: scroll;
border: 1px solid gray;
}



span.game-input {
color: #0000FF;
}
span.command-input {
color: #008000;
}
span.user-input {
color: #FF0000;
}
114 changes: 114 additions & 0 deletions app/css/app.css.sav
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
html {
background-color: #FFFFFF;
}


div.game-container .game-title {
text-align: center;
}
div.game-container {
width: 500px;
background: #000000;
padding: 0 0 25px 5px;
font-size: 13px;
font-family: Courier, fixed;
color: #33d011;
text-align: left;
border: 1px solid #909090;
margin: 20px auto;
height: 350px;
position: relative;
font-weight: bold;
}
.game-container .game-console {
height: 328px;
}
.game-container .game-console .game-console-textbox {
width: 100%;
height: 328px;
border: none;
background-color: rgba(0, 0, 0, 0);
resize: none;
outline: none;
padding: 0 15px 0 0;
}
html body .game-container .game-input-container {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 20px;
}
html body .game-container .game-input-container .game-input-prompt {
width: 15px;
background-color: rgba(0, 0, 0, 0);
padding-left: 5px;
display: inline-block;
float: left;
}
html body .game-container .game-input-container .game-input-text {
background-color: rgba(0, 0, 0, 0);
display: inline-block;
float: left;
}
html body .game-container .game-input-container .game-input-cursor {
background-color: rgba(0, 0, 0, 0);
color: #33d011;
-webkit-animation: 1s blink step-end infinite;
animation: 1s blink step-end infinite;
float: left;
font-weight: bold;
}
html body .game-container .game-input-container .game-input {
width: 0;
height: 0;
opacity: 0;
border: none;
padding: 0;
}
/* blinking cursor */
@-webkit-keyframes blink {
from,
to {
color: #33d011;
}
50% {
color: transparent;
}
}
@keyframes blink {
from,
to {
color: #33d011;
}
50% {
color: transparent;
}
}
::-webkit-scrollbar {
background-color: #f1f1f1;
width: 8px;
height: 10px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
background-color: transparent;
display: block;
height: 0;
width: 0;
}
::-webkit-scrollbar-track {
background-color: #000000;
border-left: 1px solid #909090;
}
::-webkit-scrollbar-thumb {
background-color: #909090;
}
::-webkit-scrollbar-thumb:hover {
background-color: #a9a9a9;
}
::-webkit-scrollbar-button {
width: 0;
height: 0;
}
28 changes: 28 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>adventure</title>
<link rel="stylesheet" href="app.css">
</head>
<body data-ng-app="adventureApp">
<main data-ng-controller="GameController as settings" ng-cloak data-ng-init="settings.startGame()">
<h1>Adventure Game:</h1>
<form name="userInputForm" data-ng-submit="settings.processInput()">
<label for="command">Command:
<input type="text" required data-ng-model="settings.command">
</label>
<button type="submit">Go</button>
</form>
<ul id="inputlog">
<li data-ng-repeat="item in settings.gamelog">
<span class="{{item.src}}-input">{{item.msg}}
</span>
</li>
</ul>
</main>
<script src="bundle.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions app/js/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

const angular = require('angular');

var adventureApp = angular.module('adventureApp', []);
require('./game/game')(adventureApp);
Loading