diff --git a/googletrendsgame/JQueryReWork/README.md b/googletrendsgame/JQueryReWork/README.md new file mode 100644 index 0000000..8215528 --- /dev/null +++ b/googletrendsgame/JQueryReWork/README.md @@ -0,0 +1,7 @@ +```bash +npm install express --save +npm install express-session --save +npm install url --save +npm install whiskers --save +npm install fs --save +``` \ No newline at end of file diff --git a/googletrendsgame/src/App.css b/googletrendsgame/JQueryReWork/css/app.css similarity index 98% rename from googletrendsgame/src/App.css rename to googletrendsgame/JQueryReWork/css/app.css index ee8a6d5..5636ce4 100644 --- a/googletrendsgame/src/App.css +++ b/googletrendsgame/JQueryReWork/css/app.css @@ -7,7 +7,7 @@ body { .logo { width: auto; flex: 0; - padding: 20px; + padding: 5px; color: #0459ed; font-size: 50px; text-transform: uppercase; @@ -285,7 +285,6 @@ a { .game__phrase--entry, .game__phrase--clue { - float: left; padding: 0 0 15px 0; padding-left: 0; font-size: 100px; @@ -293,9 +292,6 @@ a { vertical-align: baseline; } .game__phrase--entry { - min-width: 100px; - margin: 0 15px 10px 0; - border-right: none; background: transparent; box-shadow: 0; text-align: right; diff --git a/googletrendsgame/JQueryReWork/html/home.html b/googletrendsgame/JQueryReWork/html/home.html new file mode 100644 index 0000000..7905c44 --- /dev/null +++ b/googletrendsgame/JQueryReWork/html/home.html @@ -0,0 +1,84 @@ + + + + + + + Trend Spotter | Game + + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+ + +
+
Round 4/7
+
+
+ +
+
+
car
+
+ +
+ + + +
You're in dave61's room | 12/20 players
+ Leave Game + +
+ + + +
+
60 seconds
+
    +
  1. + John Daniels + 10,000 points + X +
  2. +
  3. + John Daniels + 10,000 points + X +
  4. +
  5. + John Daniels + 10,000 points + X +
  6. +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/googletrendsgame/JQueryReWork/server.js b/googletrendsgame/JQueryReWork/server.js new file mode 100644 index 0000000..4b6b311 --- /dev/null +++ b/googletrendsgame/JQueryReWork/server.js @@ -0,0 +1,44 @@ +/** express app */ +const express = require("express"); + +/**session data for login */ +const session = require('express-session'); + + +/** used to parse the request URL */ +const url = require('url'); + +const app = express(); + +const fs = require('fs'); + + +app.use(express.urlencoded()); +app.use(express.json()); // if needed +/**Initializes sessions for login */ +app.use(session({ secret: "changeWithConfigLater", cookie: { maxAge: 6000000 }})); + + +const PORT = 5000; + + +const whiskers = require('whiskers'); + + +function fetchHTML(templateContext, templateKey, filename) +{ + templateContext[templateKey] = fs.readFileSync(filename) +} + + +app.get('/', (requst, result) => +{ + result.write(fs.readFileSync("./html/home.html")); + result.end(); +}); + + + +app.use(express.static('css')); +app.use(express.static('js')); +app.listen(PORT, () => console.log(`App listening on port ${PORT}!`)); diff --git a/googletrendsgame/package.json b/googletrendsgame/package.json index 1da9c00..4aa94ad 100644 --- a/googletrendsgame/package.json +++ b/googletrendsgame/package.json @@ -3,7 +3,9 @@ "version": "0.1.0", "private": true, "dependencies": { - "express": "^4.16.2", + "express": "^4.16.4", + "express-session": "^1.15.6", + "fs": "0.0.2", "google-trends-api": "^4.4.0", "mysql": "^2.15.0", "promise": "^8.0.1", @@ -13,7 +15,9 @@ "react-scripts": "1.1.0", "sanitizer": "^0.1.3", "socket.io": "^2.0.4", - "socket.io-client": "^2.0.4" + "socket.io-client": "^2.0.4", + "url": "^0.11.0", + "whiskers": "^0.4.0" }, "scripts": { "start": "react-scripts start", diff --git a/googletrendsgame/public/index.html b/googletrendsgame/public/index.html index 006ce37..cb9f4d7 100644 --- a/googletrendsgame/public/index.html +++ b/googletrendsgame/public/index.html @@ -11,7 +11,7 @@ - + diff --git a/googletrendsgame/server/package.json b/googletrendsgame/server/package.json index ffb31bd..2ccb0de 100644 --- a/googletrendsgame/server/package.json +++ b/googletrendsgame/server/package.json @@ -1,7 +1,6 @@ { "name": "server", "version": "1.0.0", - "description": "", "main": "server.js", "directories": { "test": "test" @@ -15,14 +14,14 @@ "author": "", "license": "ISC", "dependencies": { - "async": "^2.6.0", - "express": "^4.16.2", - "google-trends-api": "^4.5.0", - "morgan": "^1.9.0", - "mysql": "^2.15.0", - "promise": "^8.0.1", + "async": "^2.6.1", + "express": "^4.16.4", + "google-trends-api": "^4.8.0", + "morgan": "^1.9.1", + "mysql": "^2.16.0", + "promise": "^8.0.2", "sanitizer": "^0.1.3", - "socket.io": "^2.0.4" + "socket.io": "^2.2.0" }, "devDependencies": { "babel-cli": "^6.26.0", diff --git a/googletrendsgame/src/App.js b/googletrendsgame/src/App.js index ca7eeae..663597b 100644 --- a/googletrendsgame/src/App.js +++ b/googletrendsgame/src/App.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import logo from './logo.svg'; -import './App.css'; +import '../JQueryReWork/css/app.css'; import openSocket from 'socket.io-client'; import NicknameInput from './components/nicknameInput'; import CreateRoomInput from './components/createRoomInput';