Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco committed Sep 14, 2015
0 parents commit c7e9847
Show file tree
Hide file tree
Showing 23 changed files with 978 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
src/app/lib/
.static
cache
release
44 changes: 44 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';
/* jshint node:true */

var electron = require('gulp-electron');
var gulp = require('gulp');
var util = require('gulp-util');

var packageJson = require('./src/package.json');

process.NODE_ENV = 'test';

gulp.task('package', function() {

gulp.src("")
.pipe(electron({
src: './src',
packageJson: packageJson,
release: './release',
cache: './cache',
version: 'v0.32.2',
rebuild: false,
packaging: true,
asar: true,
platforms: ['win32-ia32', 'win32-x64', 'darwin-x64'],
platformResources: {
darwin: {
CFBundleDisplayName: "AnalyzeOrFeed",
CFBundleIdentifier: "AnalyzeOrFeed",
CFBundleName: "AnalyzeOrFeed",
CFBundleVersion: packageJson.version,
icon: 'src/app/icons/aof.icns'
},
win: {
"version-string": packageJson.version,
"file-version": packageJson.version,
"product-version": packageJson.version,
"icon": 'src/app/icons/aof.ico'
}
}
}))
.pipe(gulp.dest(""));
});

gulp.task('default', ['package']);
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "aof-replay-client-setup",
"version": "0.1.0",
"main": "gulpfile.js",
"scripts": {
"postinstall": "cd src; npm install",
"start": "./node_modules/.bin/electron ./src",
"build": "./node_modules/.bin/gulp"
},
"author": "Analyze Or Feed",
"license": "MIT",
"devDependencies": {
"electron-prebuilt": "^0.32.1",
"gulp": "^3.9.0",
"gulp-electron": "0.0.9",
"gulp-util": "^3.0.6"
}
}
37 changes: 37 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AnalyzeOrFeed Replay Client

The aof.gg Replay Client is built using Electron. This means the app is compatible with both Windows and Mac. You can download the packaged files here:

[aof.gg](http://aof.gg/download/)

---

If you would like to contribute to our client, here is how you get this repository working on your own computer:

First, make sure you have the latest version of [node.js](http://nodejs.org) and [bower](http://bower.io) installed. Then clone the repository.

````shell
$ git clone https://github.com/AnalyzeOrFeed/aof-replay-client.git aof-replay-client
````

Afterwards, you need to run
````shell
$ npm install
````
in the root directory **AND** in the source directory.

In the src/app directory, run
````shell
bower install
````

That's it! You should be able to test the app by running
````shell
npm start
````

If you want to package the app, run
````shell
npm run build
````
**Note:** On Windows, you need to have 7zip command line version installed.
1 change: 1 addition & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions src/app/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "lib"
}
16 changes: 16 additions & 0 deletions src/app/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "aof-replay-client",
"version": "0.1.0",
"authors": [
"AnalyzeOrFeed <admin@aof.com>"
],
"description": "AnalyzeOrFeed Replay Client",
"license": "MIT",
"homepage": "http://www.aof.gg",
"dependencies": {
"angular": "*",
"angular-material": "*",
"angular-route": "*",
"material-design-icons-iconfont": "*"
}
}
61 changes: 61 additions & 0 deletions src/app/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
body {
color: #333333;
font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-size: 1em;
-webkit-font-smoothing: antialiased;
line-height: 1.5em;
display: inline-block;
position: relative;
min-height: 100%;
width: 100%;
margin: 0;
}

.aof {
background-color: #3598db;
}

.aof.md-button {
position: absolute;
left: 3px;
}

.content {
margin-top: 50px;
}

.client-found-true {
color: green;
}

.client-found-false {
color: red;
}

.title {
font-size: 1.3em;
}

.load-file {

}

.play-replay {

}

.spell1 {
position: relative;
left: 0px;
top: 0px;
width: 23px;
height: 23px;
}

.spell2 {
position: relative;
left: 0px;
top: 2px;
width: 23px;
height: 23px;
}
Binary file added src/app/icons/aof.icns
Binary file not shown.
Binary file added src/app/icons/aof.ico
Binary file not shown.
37 changes: 37 additions & 0 deletions src/app/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
angular.module('app',
[
"ngAnimate",
"ngAria",
"ngMaterial",
"ngRoute",
"app.controllers",
"app.directives",
"app.services",
"app.routes"
])

.config(function($mdThemingProvider) {
$mdThemingProvider.definePalette('amazingPaletteName', {
'50': 'ffebee',
'100': 'ffcdd2',
'200': 'ef9a9a',
'300': 'e57373',
'400': 'ef5350',
'500': '3598db',
'600': 'e53935',
'700': 'd32f2f',
'800': 'c62828',
'900': 'b71c1c',
'A100': 'ff8a80',
'A200': 'ff5252',
'A400': 'ff1744',
'A700': 'd50000',
'contrastDefaultColor': 'light', // whether, by default, text (contrast)
// on this palette should be dark or light
'contrastDarkColors': ['50', '100', //hues which contrast should be 'dark' by default
'200', '300', '400', 'A100'],
'contrastLightColors': undefined // could also specify this if default was 'dark'
});
$mdThemingProvider.theme('default')
.primaryPalette('amazingPaletteName')
});
85 changes: 85 additions & 0 deletions src/app/js/controllers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
var app = angular.module('app.controllers', []);

app.controller('MainController', ['$scope', '$rootScope', '$mdDialog',
function($scope, $rootScope, $mdDialog) {

var ipc = require('ipc');

$scope.hasReplay = false;
$scope.replay = null;
$scope.leagueClientFound = false;
$scope.leagueClientVersion = "";
$scope.staticDataReady = false;
$scope.aofClientInfo = {};

$scope.settings = [ { id: 1, name: "Select LoL Client" }, { id: 2, name: "Client info" } ];

$scope.showAofClientInfo = function(ev) {
var updateText = "";
if ($scope.aofClientInfo.newVersion) {
updateText = "<br /><br /><strong>New Version avaliable (" + $scope.aofClientInfo.newVersion + ")</strong><br />" + $scope.aofClientInfo.msg;
}

$mdDialog.show(
$mdDialog.alert()
.parent(angular.element(document.querySelector('#popupContainer')))
.clickOutsideToClose(true)
.title('Client info')
.content('v' + $scope.aofClientInfo.currVersion + updateText)
.ariaLabel('Client info')
.ok('ok')
.targetEvent(ev)
);
};

$scope.announceClick = function(index) {
if (index == 0) {
$scope.selectClient();
}
if (index == 1) {
$scope.showAofClientInfo();
}
};

$scope.openFile = function() {
ipc.send("openReplay");
};

$scope.selectClient = function() {
ipc.send("selectClient");
};

$scope.playReplay = function() {
console.log("playing");
ipc.send("play");
};

ipc.on("clientInfo", function(obj) {
$scope.$apply(function() {
$scope.leagueClientFound = obj.found;
$scope.leagueClientVersion = obj.version;
});
});

ipc.on("parsedReplayFile", function(arg) {
$scope.$apply(function() {
$scope.replay = arg;
$scope.hasReplay = true;
});
});

ipc.on("staticData", function(arg) {
$scope.$apply(function() {
$scope.staticDataReady = arg;
});
});

ipc.on("update", function(arg) {
$scope.$apply(function() {
$scope.aofClientInfo = arg;
});
});

ipc.send("ready");
}
]);
1 change: 1 addition & 0 deletions src/app/js/directives.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('app.directives', [])
10 changes: 10 additions & 0 deletions src/app/js/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module('app.routes', [])
.config(['$routeProvider',
function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: "app/tpl/main.html"
})
.otherwise('/');
}
]);
1 change: 1 addition & 0 deletions src/app/js/services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular.module('app.services', [])
20 changes: 20 additions & 0 deletions src/app/tpl/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<md-toolbar>
<div class="md-toolbar-tools">
<span id="md-toolbar-title">AnalyzeOrFeed Replay Client</span>
<span flex></span>
<span ng-show="aofClientInfo.newVersion" ng-click="showAofClientInfo($event)">Update available!</span>
<md-menu>
<md-button aria-label="Open demo menu" class="md-icon-button" ng-click="$mdOpenMenu($event)">
<md-icon>settings</md-icon>
</md-button>
<md-menu-content width="3">
<md-menu-item ng-repeat="item in settings">
<md-button ng-click="announceClick($index)">
<md-icon>folder</md-icon>
{{item.name}}
</md-button>
</md-menu-item>
</md-menu-content>
</md-menu>
</div>
</md-toolbar>
Loading

0 comments on commit c7e9847

Please sign in to comment.