Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 4470e8c

Browse files
committed
Merge pull request #14 from hako/v3.0.1-features
merge v3.0.1 features
2 parents f8e2667 + db8ce9a commit 4470e8c

17 files changed

Lines changed: 361 additions & 292 deletions

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,38 @@
22

33
#Googol GLaDOS Simulator
44

5-
An experimental recreation of the animation _['Googol GLaDOS'](http://www.youtube.com/watch?v=sDhc4mKtMkU)_ written entirely in Javascript.
5+
The Googol GLaDOS Simulator is an experiment of recreating the animation _['Googol GLaDOS'](http://www.youtube.com/watch?v=sDhc4mKtMkU)_ for the web.
66

77
Here are some links below to help you understand the project.
88

99
[Googol GLaDOS](http://www.youtube.com/watch?v=sDhc4mKtMkU) - YouTube video.
1010

1111

12-
[http://ggs.hakobaito.co.uk](http://ggs.hakobaito.co.uk) - Googol GLaDOS Simulator
12+
[http://ggs.hakobaito.co.uk](http://ggs.hakobaito.co.uk) - The official Googol GLaDOS Simulator.
1313

1414

15-
[http://alexianson.co.uk/archive/gg/](http://alexianson.co.uk/archive/gg/) - Alex I'Anson's original link to the simulator.
15+
http://alexianson.co.uk/archive/gg/ - The original Googol GLaDOS Simulator (by Alex I'Anson) (Offline)
1616

17-
_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:_
17+
_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:_
1818

1919
[Googol GLaDOS Simulator for Windows](http://googolglados.tumblr.com/download)
2020

2121
Downloads
2222
-
2323

24-
You can grab the latest release here.
24+
If you would like to run the Googol GLaDOS Simulator on your own machine, you can download the code here:
25+
26+
[Googol GLaDOS Simulator v3.0.1](https://github.com/hako/googol-glados-simulator/releases)
2527

26-
[v3.0.1](https://github.com/hako/googol-glados-simulator/releases)
2728

2829
Installing
2930
-
3031
To run the simulator, you would need to install:
3132

32-
+ Node.js
33-
+ Bower
33+
+ [Node.js](https://nodejs.org)
34+
+ [Bower](http://bower.io)
3435

35-
Once you have these run:
36+
Once you have these, clone this repo, open a Terminal and run:
3637

3738
`[sudo] npm install && [sudo] bower install ; node app.js`
3839

@@ -45,7 +46,7 @@ If you really are in a hurry and want to get started quickly, You can deploy you
4546
Contributions
4647
-
4748

48-
All contributions are welcome, just clone this repo and submit a pull request.
49+
All contributions are welcome, just clone this repo, make some changes and submit a pull request.
4950

5051
If you found a bug or want a feature, submit it [here](https://github.com/hako/googol-glados-simulator/issues).
5152

@@ -60,4 +61,4 @@ License
6061
-
6162
The Googol GLaDOS Simulator by Alex I'Anson and Wesley Hill is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
6263

63-
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
64+
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>

app.js

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -18,67 +18,57 @@ var MobileDetect = require('mobile-detect');
1818
var express = require('express');
1919
var chalk = require('chalk');
2020
var bp = require('body-parser');
21-
var swig = require('swig');
21+
var nunjucks = require('nunjucks');
22+
var morgan = require('morgan');
23+
var ac = require('appcache-node');
2224

23-
24-
//var ac = require('appcache-node');
2525
var app = express();
26+
2627
// Create a cache for offline access, invalidate each hour.
2728
// add manifest="app.cache" to app_layout and index_layout
28-
// var cache = ac.newCache(["components/bootstrap/dist/css/bootstrap.css",
29-
// "components/bootstrap/dist/js/bootstrap.min.js",
30-
// "components/howler/howler.min.js",
31-
// "components/animate.css/animate.css",
32-
// "components/jquery/dist/jquery.min.js",
33-
// "components/ionicons/css/ionicons.css",
34-
// "components/icomoon/dist/css/style.css",
35-
// "css/stylish-portfolio.css",
36-
// "css/modern-buttons.css",
37-
// "css/fonts.css",
38-
// "css/app/index.css",
39-
// "css/real-world.css",
40-
// "css/fonts/Averia/averia_sans_libre_regular.svg",
41-
// "css/fonts/Averia/averia_sans_libre_regular.ttf",
42-
// "css/fonts/Averia/averia_sans_libre_regular.woff",
43-
// "css/fonts/Catull.svg",
44-
// "css/fonts/Catull.ttf",
45-
// "css/fonts/Catull.woff",
46-
// "components/icomoon/dist/fonts/icomoon.svg",
47-
// "components/icomoon/dist/fonts/icomoon.ttf",
48-
// "components/icomoon/dist/fonts/icomoon.woff",
49-
// "components/ionicons/fonts/ionicons.svg?v=2.0.0#Ionicons",
50-
// "components/ionicons/fonts/ionicons.ttf?v=2.0.0",
51-
// "components/ionicons/fonts/ionicons.woff?v=2.0.0",
52-
// "components/bootstrap/dist/css/bootstrap.css.map",
53-
// "components/jquery/dist/jquery.min.map",
54-
// "sounds/chicken.wav",
55-
// "sounds/ignore.wav",
56-
// "sounds/glados_s6.wav",
57-
// "sounds/glados_s7.wav",
58-
// "sounds/glados_s8.wav",
59-
// "sounds/glados_s9.wav",
60-
// "sounds/glados_s10.wav",
61-
// "js/app/index.js",
62-
// ])
63-
// cache += "\nNETWORK:\n*"
29+
var cache = ac.newCache(["components/bootstrap/dist/css/bootstrap.css",
30+
"components/howler/howler.min.js",
31+
"sounds/chicken.wav",
32+
"sounds/ignore.wav",
33+
"sounds/glados_s6.wav",
34+
"sounds/glados_s7.wav",
35+
"sounds/glados_s8.wav",
36+
"sounds/glados_s9.wav",
37+
"sounds/glados_s10.wav",
38+
])
39+
cache += "\nNETWORK:\n*"
6440

6541
var googol = chalk.blue("g") + chalk.red("o") + chalk.yellow("o") + chalk.blue("g") + chalk.red("o") + chalk.green("l");
6642
var glados = chalk.yellow("g") + chalk.green("l") + chalk.red("a") + chalk.blue("d") + chalk.red("o") + chalk.blue("s");
6743

68-
// Express settings.
44+
// Express settings and middleware.
6945
app.set('port', (process.env.PORT || 5000));
70-
app.engine('html', swig.renderFile);
7146
app.set('view engine', 'html');
7247
app.set('views', __dirname + '/views');
7348
app.use(express.static(__dirname + '/public'));
7449
app.disable('x-powered-by');
7550

76-
// Swig custom filters.
51+
if (app.settings.env == "development") {
52+
app.use(morgan('dev'))
53+
} else {
54+
app.use(morgan('combined'))
55+
}
56+
57+
// Configure view template for nunjucks.
58+
var nunjucksTemplate = nunjucks.configure('views', {
59+
autoescape:true,
60+
express:app
61+
});
7762

78-
// Select a random item in an array.
79-
swig.setFilter('random', function(array) {
63+
nunjucksTemplate.addFilter('random', function(array) {
8064
return array[Math.floor(Math.random() * array.length)]
81-
})
65+
});
66+
67+
// Nunjucks custom filters.
68+
nunjucksTemplate.addFilter('json', function(obj) {
69+
return JSON.stringify(obj);
70+
});
71+
8272

8373
// Configuration
8474

@@ -99,22 +89,24 @@ if (!process.env.SHOW_RELEASE_NAME) {
9989
version['show_release_name'] = process.env.SHOW_RELEASE_NAME
10090
}
10191

102-
// Cache
103-
// app.all('/app.cache', function(req, res){
104-
// res.writeHead(200, {'Content-Type': 'text/cache-manifest'});
105-
// res.end(cache);
106-
// })
92+
// Display app cache.
93+
app.all('/app.cache', function(req, res){
94+
res.writeHead(200, {'Content-Type': 'text/cache-manifest'});
95+
res.end(cache);
96+
})
10797

10898
// Routes.
10999

110100
// Index.
111101
app.get('/', function(req, res) {
102+
var ismob = isMobile(req)
112103
on_heroku = process.env.ON_HEROKU
113104
footerWords = ['Made', 'Crafted', 'Designed', 'Built', 'Created']
114105
date = new Date()
115-
res.render("index", {
106+
res.render("index.html", {
116107
words: footerWords,
117108
on_heroku: on_heroku,
109+
mob:ismob,
118110
v: version,
119111
year:date.getFullYear()
120112
})
@@ -131,20 +123,32 @@ app.all('/robots.txt', function(req, res) {
131123
res.end(robotstxt)
132124
});
133125

134-
// Nope.
135-
app.get('/nope', function(req, res, next) {
126+
// User-Agent Checker.
127+
function isMobile(req) {
136128
md = new MobileDetect(req.headers['user-agent'])
137129
if (md.mobile() || md.is("Console") || md.is("Watch") || md.is("MobileBot") || md.match("\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b")) {
130+
return true
131+
} else {
132+
return false
133+
}
134+
}
135+
136+
// Nope.
137+
app.get('/nope', function(req, res, next) {
138+
if(isMobile(req) == true){
138139
res.render("toobad",{device:md.mobile()})
139140
} else {
140141
res.redirect("/")
141142
}
142143
});
143144

145+
app.get('/end', function(req, res) {
146+
res.redirect("/")
147+
})
148+
144149
// App
145150
app.get('/app', function(req, res) {
146-
md = new MobileDetect(req.headers['user-agent'])
147-
if (md.mobile() || md.is("Console") || md.is("Watch") || md.is("MobileBot") || md.match("\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b")) {
151+
if(isMobile(req) == true){
148152
res.render("toobad",{device:md.mobile()})
149153
} else {
150154
exists = req.get('X-IS-GGS')

bower.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"ionicons": "~2.0.1",
2121
"icomoon": "~0.0.3",
2222
"bootstrap": "~3.3.5",
23-
"howler": "~1.1.26"
23+
"howler": "~1.1.26",
24+
"normalize.css": "~3.0.3",
25+
"sweetalert": "~1.1.0"
2426
}
2527
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"express": "^4.13.0",
1616
"lodash": "^3.9.3",
1717
"mobile-detect": "^1.2.0",
18-
"swig": "^1.4.2"
18+
"morgan": "^1.6.1",
19+
"nunjucks": "^1.3.4"
1920
},
2021
"engines": {
2122
"node": "0.12.x"

public/css/app/1.css

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,6 @@ a:hover {
1818
color: #E34C26;
1919
}
2020

21-
html,
22-
body {
23-
/* The html and body elements cannot have any padding or margin. */
24-
}
25-
/* Wrapper for page content to push down footer */
26-
27-
#wrap {
28-
min-height: 100%;
29-
height: auto !important;
30-
height: 100%;
31-
/* Negative indent footer by it's height */
32-
33-
margin: 0 auto -60px;
34-
}
35-
/* Set the fixed height of the footer here */
36-
37-
#push,
38-
#footer {
39-
height: 60px;
40-
}
41-
42-
#footer {
43-
background-color: #f5f5f5;
44-
}
45-
/* Lastly, apply responsive CSS fixes as necessary */
46-
47-
@media (max-width: 767px) {
48-
#footer {
49-
margin-left: -20px;
50-
margin-right: -20px;
51-
padding-left: 20px;
52-
padding-right: 20px;
53-
}
54-
}
55-
5621
.Googol {
5722
font-family: 'Conv_Catull';
5823
text-align: center;
@@ -121,13 +86,14 @@ h1 {
12186

12287
h3 {
12388
font-family: 'Averia Sans Libre', cursive;
124-
font-size: 60px;
89+
font-size: 40px;
12590
color: #2e3436;
126-
-webkit-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
127-
-moz-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
128-
-o-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
129-
-ms-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
130-
transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
91+
92+
-webkit-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
93+
-moz-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
94+
-o-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
95+
-ms-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
96+
transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
13197
}
13298

13399
.Download {

public/js/app/1.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(function() {
12
window.history.replaceState('Object', 'Title', '/app');
23

34
function next() {
@@ -26,6 +27,12 @@ function next() {
2627
}
2728
})
2829
} else {
29-
alert('Please agree with the terms & conditions to continue.')
30+
sweetAlert({title:"Error", text:"Please agree with the terms & conditions to continue.", confirmButtonColor:"#FC2D1E"});
3031
}
31-
}
32+
}
33+
34+
$('#download').click(function() {
35+
next()
36+
})
37+
38+
})();

public/js/app/7.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343

4444
function decrypting() {
45-
$('#gladosbody').append('<div id="decrypting" style="position:absolute;left:10;bottom:10;opacity:1;z-index:5;"><br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <p> Decrypting...</p>');
45+
$('#gladosbody').append('<div id="decrypting" style="position:absolute;left:10;bottom:10;opacity:1;z-index:5;"><br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <p> DECRYPTING...</p>');
4646
setTimeout('next()', 4500);
4747
}
4848

0 commit comments

Comments
 (0)