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

Merge pull request #14 from hako/v3.0.1-features

merge v3.0.1 features
  • Loading branch information...
hako committed Oct 27, 2015
2 parents f8e2667 + db8ce9a commit 4470e8c40273d38869a9bdec7ed320d28e31632b
View
@@ -2,37 +2,38 @@
#Googol GLaDOS Simulator
-An experimental recreation of the animation _['Googol GLaDOS'](http://www.youtube.com/watch?v=sDhc4mKtMkU)_ written entirely in Javascript.
+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.
[Googol GLaDOS](http://www.youtube.com/watch?v=sDhc4mKtMkU) - YouTube video.
-[http://ggs.hakobaito.co.uk](http://ggs.hakobaito.co.uk) - Googol GLaDOS Simulator
+[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/) - Alex I'Anson's original link to the simulator.
+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:_
+_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:_
[Googol GLaDOS Simulator for Windows](http://googolglados.tumblr.com/download)
Downloads
-
-You can grab the latest release here.
+If you would like to run the Googol GLaDOS Simulator on your own machine, you can download the code here:
+
+[Googol GLaDOS Simulator v3.0.1](https://github.com/hako/googol-glados-simulator/releases)
-[v3.0.1](https://github.com/hako/googol-glados-simulator/releases)
Installing
-
To run the simulator, you would need to install:
-+ Node.js
-+ Bower
++ [Node.js](https://nodejs.org)
++ [Bower](http://bower.io)
-Once you have these run:
+Once you have these, clone this repo, open a Terminal and run:
`[sudo] npm install && [sudo] bower install ; node app.js`
@@ -45,7 +46,7 @@ If you really are in a hurry and want to get started quickly, You can deploy you
Contributions
-
-All contributions are welcome, just clone this repo and submit a pull request.
+All contributions are welcome, just clone this repo, make some changes and submit a pull request.
If you found a bug or want a feature, submit it [here](https://github.com/hako/googol-glados-simulator/issues).
@@ -60,4 +61,4 @@ License
-
The Googol GLaDOS Simulator by Alex I'Anson and Wesley Hill is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
-<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>
+<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>
View
114 app.js
@@ -18,67 +18,57 @@ var MobileDetect = require('mobile-detect');
var express = require('express');
var chalk = require('chalk');
var bp = require('body-parser');
-var swig = require('swig');
+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.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('views', __dirname + '/views');
app.use(express.static(__dirname + '/public'));
app.disable('x-powered-by');
-// Swig custom filters.
+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,
+ express:app
+});
-// Select a random item in an array.
-swig.setFilter('random', function(array) {
+nunjucksTemplate.addFilter('random', function(array) {
return array[Math.floor(Math.random() * array.length)]
-})
+});
+
+// Nunjucks custom filters.
+nunjucksTemplate.addFilter('json', function(obj) {
+ return JSON.stringify(obj);
+});
+
// Configuration
@@ -99,22 +89,24 @@ 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.
// Index.
app.get('/', function(req, res) {
+ var ismob = isMobile(req)
on_heroku = process.env.ON_HEROKU
footerWords = ['Made', 'Crafted', 'Designed', 'Built', 'Created']
date = new Date()
- res.render("index", {
+ res.render("index.html", {
words: footerWords,
on_heroku: on_heroku,
+ mob:ismob,
v: version,
year:date.getFullYear()
})
@@ -131,20 +123,32 @@ app.all('/robots.txt', function(req, res) {
res.end(robotstxt)
});
-// Nope.
-app.get('/nope', function(req, res, next) {
+// User-Agent Checker.
+function isMobile(req) {
md = new MobileDetect(req.headers['user-agent'])
if (md.mobile() || md.is("Console") || md.is("Watch") || md.is("MobileBot") || md.match("\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b")) {
+ return true
+ } else {
+ return false
+ }
+}
+
+// Nope.
+app.get('/nope', function(req, res, next) {
+ if(isMobile(req) == true){
res.render("toobad",{device:md.mobile()})
} else {
res.redirect("/")
}
});
+app.get('/end', function(req, res) {
+ res.redirect("/")
+})
+
// App
app.get('/app', function(req, res) {
- md = new MobileDetect(req.headers['user-agent'])
- if (md.mobile() || md.is("Console") || md.is("Watch") || md.is("MobileBot") || md.match("\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b")) {
+ if(isMobile(req) == true){
res.render("toobad",{device:md.mobile()})
} else {
exists = req.get('X-IS-GGS')
View
@@ -20,6 +20,8 @@
"ionicons": "~2.0.1",
"icomoon": "~0.0.3",
"bootstrap": "~3.3.5",
- "howler": "~1.1.26"
+ "howler": "~1.1.26",
+ "normalize.css": "~3.0.3",
+ "sweetalert": "~1.1.0"
}
}
View
@@ -15,7 +15,8 @@
"express": "^4.13.0",
"lodash": "^3.9.3",
"mobile-detect": "^1.2.0",
- "swig": "^1.4.2"
+ "morgan": "^1.6.1",
+ "nunjucks": "^1.3.4"
},
"engines": {
"node": "0.12.x"
View
@@ -18,41 +18,6 @@ a:hover {
color: #E34C26;
}
-html,
-body {
- /* The html and body elements cannot have any padding or margin. */
-}
-/* Wrapper for page content to push down footer */
-
-#wrap {
- min-height: 100%;
- height: auto !important;
- height: 100%;
- /* Negative indent footer by it's height */
-
- margin: 0 auto -60px;
-}
-/* Set the fixed height of the footer here */
-
-#push,
-#footer {
- height: 60px;
-}
-
-#footer {
- background-color: #f5f5f5;
-}
-/* Lastly, apply responsive CSS fixes as necessary */
-
-@media (max-width: 767px) {
- #footer {
- margin-left: -20px;
- margin-right: -20px;
- padding-left: 20px;
- padding-right: 20px;
- }
-}
-
.Googol {
font-family: 'Conv_Catull';
text-align: center;
@@ -121,13 +86,14 @@ h1 {
h3 {
font-family: 'Averia Sans Libre', cursive;
- font-size: 60px;
+ font-size: 40px;
color: #2e3436;
- -webkit-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
- -moz-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
- -o-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
- -ms-transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
- transform: translate(0px, -66px) rotate(12deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
+
+ -webkit-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
+ -moz-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
+ -o-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
+ -ms-transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
+ transform: translate(0px, -66px) rotate(5.8deg) rotateX(12deg) skew(0deg, 0deg) scale(0.7, 0.7);
}
.Download {
View
@@ -1,3 +1,4 @@
+(function() {
window.history.replaceState('Object', 'Title', '/app');
function next() {
@@ -26,6 +27,12 @@ function next() {
}
})
} else {
- alert('Please agree with the terms & conditions to continue.')
+ sweetAlert({title:"Error", text:"Please agree with the terms & conditions to continue.", confirmButtonColor:"#FC2D1E"});
}
-}
+}
+
+$('#download').click(function() {
+ next()
+})
+
+})();
View
@@ -42,7 +42,7 @@
}
function decrypting() {
- $('#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>');
+ $('#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>');
setTimeout('next()', 4500);
}
Oops, something went wrong.

0 comments on commit 4470e8c

Please sign in to comment.