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
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules

*.md

npm-debug.log
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"rules": {
"no-console": "off",
"indent": [ "error", 2 ],
"quotes": [ "error", "single" ],
"semi": ["error", "always"],
"linebreak-style": [ "error", "unix" ],
# "no-unused-vars": [2, {"vars": "local", "args": "after-used"}]
},
"env": {
"es6": true,
"node": true,
"mocha": true,
"jasmine": true
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

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

### Linux ###
*~

#Build (webpack)
build/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job ignoring your build/.


# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

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

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# 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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### 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

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,osx,windows,linux
62 changes: 62 additions & 0 deletions app/entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict';

require('./scss/core.scss');

const angular = require('angular');
const cowsay = require('cowsay-browser');

const mooMooApp = angular.module('mooMooApp', []);

mooMooApp.controller('CowsayController', ['$log', CowsayController]);

function CowsayController($log) {
$log.debug('CowsayController');

this.title = 'Cow Creator';
this.history = [];

cowsay.list((err, cowfiles) => {
this.cowfiles = cowfiles;
this.current = cowfiles[0];
});

this.update = function(input) {
$log.debug('cowsayCtrl.update');
return cowsay.say({ text: input || 'cowcontrol.io', f: this.current });
};

this.speak = function(input) {
$log.debug('cowsayCtrl.update');

this.spoken = this.update(input);
this.history.push(this.spoken);
};

this.undo = function() {
$log.debug('cowsayCtrl.undo');

this.history.pop();
this.spoken = this.history.pop() || '';
};
}

mooMooApp.controller('NavController', ['$log', NavController]);

function NavController($log) {
$log.debug('NavController');

this.routes = [
{
name: 'Home',
url: '/home'
},
{
name: 'Cow Creator',
url: '/cow-creator'
},
{
name: 'Account',
url: '/account'
}
];
}
70 changes: 70 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html ng-app="mooMooApp">
<head>
<meta charset="utf-8">
<title>MooMoo Tests</title>
</head>
<body>
<header>
<div class="logo-container">
<img id="logo" src="../assets/moo-moo-logo.png">
<h1>cowcontrol.io</h1>
</div>
<nav class="nav-bar" ng-controller="NavController as navCtrl">
<ul>
<li ng-repeat="route in navCtrl.routes">
<a class="nav-link" href="{{ route.url }}">{{ route.name }}</a>
</li>
</ul>
</nav>
</header>

<section class="cow-container" ng-controller="CowsayController as cowsayCtrl"
ng-init="cowsayCtrl.current = 'default'">

<div class="cow-header">
<h2> {{ cowsayCtrl.title }}</h2>
<p>make it, view it, and undo it!</p>
</div>

<pre class="cow">
{{ cowsayCtrl.update(cowsayCtrl.text) }}
</pre>

<form class="opts-container" ng-submit="cowsayCtrl.speak(cowsayCtrl.text)"
name="cowsayForm"
novalidate>
<p>Select a cowfile</p>
<select ng-model="cowsayCtrl.current">
<option ng-repeat="cowfile in cowsayCtrl.cowfiles" value="{{cowfile}}">
{{cowfile}}
</option>
</select>
<p class="cow-opts">What does it say?</p>
<input type="text" ng-model="cowsayCtrl.text" required></input>
<p class="cow-opts">View it!</p>
<button type="submit">CLICK TO VIEW</button>
</form>

<div class="thinline"></div>

<div ng-show="cowsayCtrl.spoken" class="history">
<div class="cow-header">
<h2>View it!</h2>
<p>check out the cow you just made!</p>
</div>
<pre class="cow">
{{ cowsayCtrl.spoken }}
</pre>
<div class="opts-container">
<button type="button" ng-click="cowsayCtrl.undo()">UNDO THIS COW!</button>
</div>
</div>

</section>

<footer>
<p>cowcontrol.io</p>
</footer>
</body>
</html>
15 changes: 15 additions & 0 deletions app/scss/_base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//:::: Base Styles :::://
$font-color: #484848;

p {
font-family: muli;
color: $font-color;
}

body {
width: 900px;
height: 100%;
background-color: $site-primary;
margin: auto;
outline: 1px solid black;
}
14 changes: 14 additions & 0 deletions app/scss/_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//:::: footer :::://

footer {
height: 90px;
background-color: $footer-bg;
position: relative;

p {
display: inline-block;
position: absolute;
top: 70%;
left: 89%;
}
}
Loading