This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added logging, sound caching again.

  • Loading branch information...
hako committed Oct 27, 2015
1 parent 8bbf5da commit 69e6ca94b690d1843ddf9bf91e92381e02410196
Showing with 159 additions and 120 deletions.
  1. +4 −4 README.md
  2. +26 −44 app.js
  3. +1 −0 package.json
  4. +46 −0 public/js/app/index.js
  5. +1 −1 views/app_layout.html
  6. +79 −70 views/index.html
  7. +1 −1 views/index_layout.html
  8. +1 −0 views/page_header.html
View
@@ -2,7 +2,7 @@
#Googol GLaDOS Simulator
An open source experiment of recreating the animation _['Googol GLaDOS'](http://www.youtube.com/watch?v=sDhc4mKtMkU)_ for the web.
The Googol GLaDOS Simulator is an experiment of recreating the animation _['Googol GLaDOS'](http://www.youtube.com/watch?v=sDhc4mKtMkU)_ for the web.
Here are some links below to help you understand the project.
@@ -12,7 +12,7 @@ Here are some links below to help you understand the project.
[http://ggs.hakobaito.co.uk](http://ggs.hakobaito.co.uk) - The official Googol GLaDOS Simulator.
[http://alexianson.co.uk/archive/gg/](http://alexianson.co.uk/archive/gg/) - The original Googol GLaDOS Simulator (by Alex I'Anson)
http://alexianson.co.uk/archive/gg/ - The original Googol GLaDOS Simulator (by Alex I'Anson) (Offline)
_NOTE: This version of the simulator is the **web** version, not the Windows version. If you are looking for the Windows version, head over here:_
@@ -21,9 +21,9 @@ _NOTE: This version of the simulator is the **web** version, not the Windows ver
Downloads
-
You can grab the latest beta release here.
If you would like to run the Googol GLaDOS Simulator on your own machine, you can download the code here:
[v3.0.1](https://github.com/hako/googol-glados-simulator/releases)
[Googol GLaDOS Simulator v3.0.1](https://github.com/hako/googol-glados-simulator/releases)
Installing
View
70 app.js
@@ -19,59 +19,41 @@ var express = require('express');
var chalk = require('chalk');
var bp = require('body-parser');
var nunjucks = require('nunjucks');
var morgan = require('morgan');
var ac = require('appcache-node');
//var ac = require('appcache-node');
var app = express();
// Create a cache for offline access, invalidate each hour.
// add manifest="app.cache" to app_layout and index_layout
// var cache = ac.newCache(["components/bootstrap/dist/css/bootstrap.css",
// "components/bootstrap/dist/js/bootstrap.min.js",
// "components/howler/howler.min.js",
// "components/animate.css/animate.css",
// "components/jquery/dist/jquery.min.js",
// "components/ionicons/css/ionicons.css",
// "components/icomoon/dist/css/style.css",
// "css/stylish-portfolio.css",
// "css/modern-buttons.css",
// "css/fonts.css",
// "css/app/index.css",
// "css/real-world.css",
// "css/fonts/Averia/averia_sans_libre_regular.svg",
// "css/fonts/Averia/averia_sans_libre_regular.ttf",
// "css/fonts/Averia/averia_sans_libre_regular.woff",
// "css/fonts/Catull.svg",
// "css/fonts/Catull.ttf",
// "css/fonts/Catull.woff",
// "components/icomoon/dist/fonts/icomoon.svg",
// "components/icomoon/dist/fonts/icomoon.ttf",
// "components/icomoon/dist/fonts/icomoon.woff",
// "components/ionicons/fonts/ionicons.svg?v=2.0.0#Ionicons",
// "components/ionicons/fonts/ionicons.ttf?v=2.0.0",
// "components/ionicons/fonts/ionicons.woff?v=2.0.0",
// "components/bootstrap/dist/css/bootstrap.css.map",
// "components/jquery/dist/jquery.min.map",
// "sounds/chicken.wav",
// "sounds/ignore.wav",
// "sounds/glados_s6.wav",
// "sounds/glados_s7.wav",
// "sounds/glados_s8.wav",
// "sounds/glados_s9.wav",
// "sounds/glados_s10.wav",
// "js/app/index.js",
// ])
// cache += "\nNETWORK:\n*"
var cache = ac.newCache(["components/bootstrap/dist/css/bootstrap.css",
"components/howler/howler.min.js",
"sounds/chicken.wav",
"sounds/ignore.wav",
"sounds/glados_s6.wav",
"sounds/glados_s7.wav",
"sounds/glados_s8.wav",
"sounds/glados_s9.wav",
"sounds/glados_s10.wav",
])
cache += "\nNETWORK:\n*"
var googol = chalk.blue("g") + chalk.red("o") + chalk.yellow("o") + chalk.blue("g") + chalk.red("o") + chalk.green("l");
var glados = chalk.yellow("g") + chalk.green("l") + chalk.red("a") + chalk.blue("d") + chalk.red("o") + chalk.blue("s");
// Express settings.
// Express settings and middleware.
app.set('port', (process.env.PORT || 5000));
app.set('view engine', 'html');
app.set('views', __dirname + '/views');
app.use(express.static(__dirname + '/public'));
app.disable('x-powered-by');
if (app.settings.env == "development") {
app.use(morgan('dev'))
} else {
app.use(morgan('combined'))
}
// Configure view template for nunjucks.
var nunjucksTemplate = nunjucks.configure('views', {
autoescape:true,
@@ -107,11 +89,11 @@ if (!process.env.SHOW_RELEASE_NAME) {
version['show_release_name'] = process.env.SHOW_RELEASE_NAME
}
// Cache
// app.all('/app.cache', function(req, res){
// res.writeHead(200, {'Content-Type': 'text/cache-manifest'});
// res.end(cache);
// })
// Display app cache.
app.all('/app.cache', function(req, res){
res.writeHead(200, {'Content-Type': 'text/cache-manifest'});
res.end(cache);
})
// Routes.
View
@@ -15,6 +15,7 @@
"express": "^4.13.0",
"lodash": "^3.9.3",
"mobile-detect": "^1.2.0",
"morgan": "^1.6.1",
"nunjucks": "^1.3.4"
},
"engines": {
View
@@ -1,5 +1,7 @@
(function() {
preloadSounds();
$('#video_background').hide();
$('#video_background').delay(1500).fadeIn(5000);
@@ -93,4 +95,48 @@ function chicken() {
}, 3000);
}
function preloadSounds() {
var preloadChicken = new Howl({
urls: ['../../sounds/chicken.wav'],
autoplay:false,
buffer:true
}).stop();
var preloadS6 = new Howl({
urls: ['../../sounds/glados_s6.wav'],
autoplay:false,
buffer:true
}).stop();
var preloadIgnore = new Howl({
urls: ['../../sounds/ignore.wav'],
autoplay:false,
buffer:true
}).stop();
var preloadS7 = new Howl({
urls: ['../../sounds/glados_s7.wav'],
autoplay:false,
buffer:true
}).stop();
var preloadS8 = new Howl({
urls: ['../../sounds/glados_s8.wav'],
autoplay:false,
buffer:true
}).stop();
var preloadS9 = new Howl({
urls: ['../../sounds/glados_s9.wav'],
autoplay:false,
buffer:true
}).stop();
var preloadS10 = new Howl({
urls: ['../../sounds/glados_s10.wav'],
autoplay:false,
buffer:true
}).stop();
}
})();
View
@@ -1,6 +1,6 @@
{% include 'banner' %}
<html>
<html manifest="app.cache">
{% include 'app_headers.html' %}
{% block custom_css %}{% endblock %}
<body>
Oops, something went wrong.

0 comments on commit 69e6ca9

Please sign in to comment.