Skip to content

Commit

Permalink
fix merge conflicts with epic games
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinafyi committed Aug 24, 2019
2 parents fcd9e2f + ccb07d4 commit 9913dd3
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 20 deletions.
36 changes: 25 additions & 11 deletions GameNode/client/app.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
/* global cloak */

var form = document.querySelector('#input-form');
var input = document.querySelector('#input');
//var form = document.querySelector('#input-form');
//var input = document.querySelector('#input');

var lobbyForm = document.querySelector('#lobby-form');
var lobbyInput = document.querySelector('#lobby-input');
//var lobbyForm = document.querySelector('#lobby-form');
//var lobbyInput = document.querySelector('#lobby-input');

//var messages = document.querySelector('#messages');
//var counter = document.querySelector('#counter');

var createLobbyButton = document.querySelector('#createlobby');

var messages = document.querySelector('#messages');
var counter = document.querySelector('#counter');

cloak.configure({
messages: {
chat: function(msg) {
/*chat: function(msg) {
var message = document.createElement('div');
message.textContent = msg;
message.className = 'msg';
messages.appendChild(message);
messages.scrollTop = messages.scrollHeight;
},
userCount: function(count) {
counter.textContent = count;
},
//counter.textContent = count;
},*/
'joinLobbyResponse': function(success) {
console.log('joined lobby');
game.refreshLobby();
},
//
'refreshLobby': function(data) {
/*'refreshLobby': function(data) {
var users = data.users;
var inLobby = data.inLobby;
Expand Down Expand Up @@ -62,7 +65,7 @@ cloak.configure({
roomListElement.innerHTML += '<li>' + escape(room.name) + ' (' + room.users.length + '/' + room.size + ') <a href="#" onclick="game.joinRoom(\'' + room.id + '\')">join</a><li class="indented">' + room.users[0].name + '</li></li>';
});
roomListElement.innerHTML += '</ul>';
},
},*/

'joinRoomResponse': function(result) {
if (result.success) {
Expand Down Expand Up @@ -144,6 +147,7 @@ cloak.configure({
}
});

/*
form.addEventListener('submit', function(e) {
e.preventDefault();
var msg = input.value;
Expand All @@ -163,5 +167,15 @@ lobbyForm.addEventListener('submit', function(e) {
console.log(cloak.getUsers());
console.log(cloak.currentUser());
});
*/
createLobbyButton.addEventListener('click', (function(e) {
console.log('ASUDGAKSJGDJKASGDKJHASGDJKADSG');
}));







cloak.run('http://130.102.176.91:8090');
8 changes: 8 additions & 0 deletions GameNode/client/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,12 @@ body {
font-family: 'Roboto Mono', monospace !important;
font-size: 2em;
text-align: center;
}

.circle {
padding: 1em;
}

.circle-text {
font-size: 4em;
}
14 changes: 8 additions & 6 deletions GameNode/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/progressbar.js/1.0.1/progressbar.min.js"></script>
<script src="js/scripts.js"></script>
<title>YeetBeat</title>
</head>
Expand Down Expand Up @@ -43,13 +44,13 @@ <h1 class="display-bold">Playlists</h1>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Enter name" aria-label="Enter name">
</div>
<a onclick="javascript:changeView('lobby')" class="btn btn-lg btn-block"
style="background-color: #42A5F5">Open Lobby</a>
<a onclick="javascript:changeView('room')" class="btn btn-lg btn-block"
style="background-color: #42A5F5">Open Room</a>
<a onclick="javascript:changeView('settings')" class="btn btn-lg btn-block"
style="background-color: #CCCCCC">Settings</a>
</div>
<div class="padding hideable" id="lobby">
<h1 class="display-bold">Lobby</h1>
<div class="padding hideable" id="room">
<h1 class="display-bold">Room</h1>
<p>Bruh</p>
<a onclick="javascript:changeView('game')" class="btn btn-lg btn-block"
style="background-color: #9CCC65">Start Game</a>
Expand All @@ -63,8 +64,8 @@ <h1 class="display-bold">Join</h1>
<div class="input-group mb-3">
<input type="text" class="form-control mono" placeholder="Enter code" aria-label="Enter code">
</div>
<a onclick="javascript:changeView('lobby')" class="btn btn-lg btn-block"
style="background-color: #42A5F5">Join Lobby</a>
<a onclick="javascript:changeView('room')" class="btn btn-lg btn-block"
style="background-color: #42A5F5">Join Room</a>
</div>
<div class="padding hideable" id="settings">
<h1 class="display-bold">Settings</h1>
Expand All @@ -87,6 +88,7 @@ <h1 class="display-bold">Game over!</h1>
<div class="padding hideable" id="game">
<h1 class="display-bold">The game!</h1>
<!-- Song input -->
<div class="circle"></div>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Guess song" aria-label="Guess song">
</div>
Expand Down
30 changes: 29 additions & 1 deletion GameNode/client/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,32 @@ function changeView(id) {

old.style.animation = 'fadeOut 0.2s ease forwards';
old.classList.remove('active');
}
}

var circle;

function main() {
const duration = 10000;
circle = new ProgressBar.Circle('.circle', {
strokeWidth: 6,
easing: 'linear',
duration: duration,
trailWidth: 1,
svgStyle: {
// transform: 'rotate(180deg)'
},
from: { color: '#dc0000', remaining: 0 },
to: { color: '#32a852', remaining: duration/1000 },
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.setText(Math.ceil(state.remaining));
},
text: {
className: 'circle-text',
}
});
circle.set(1);
circle.animate(0); // Number from 0.0 to 1.0
}

setTimeout(main, 0);
5 changes: 5 additions & 0 deletions GameNode/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ cloak.configure({
roomSize: user.room.size
});
},
createRoom: function(arg, user) {
var room = cloak.createRoom(Math.floor(Math.random()*100000-1), 1000);


}

},

Expand Down
4 changes: 2 additions & 2 deletions mockups/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1 class="display-bold">Guess the song!</h1>
style="background-color: #42A5F5">&rarr;&nbsp; Join</a>
<a onclick="javascript:changeView('playlists')" class="btn btn-lg btn-tall btn-block"
style="background-color: #9CCC65">+&nbsp; New</a>
<p class="minimal-text center">Made by Epic Gamers</p>
<p class="minimal-text center"><a href="https://twitter.com/EpicGames">Made by Epic Gamers</a></p>
</div>
</div>
<div class="padding hideable" id="playlists">
Expand Down Expand Up @@ -89,4 +89,4 @@ <h1 class="display-bold">The game!</h1>
</div>
</body>

</html>
</html>
27 changes: 27 additions & 0 deletions server/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
basedir = os.path.abspath(os.path.dirname(__file__))


class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = 'this-really-needs-to-be-changed'


class ProductionConfig(Config):
DEBUG = False


class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True


class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True


class TestingConfig(Config):
TESTING = True
15 changes: 15 additions & 0 deletions server/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from flask import Flask
app = Flask(__name__)


@app.route('/')
def hello():
return "Hello World!"


@app.route('/<name>')
def hello_name(name):
return "Hello {}!".format(name)

if __name__ == '__main__':
app.run()

0 comments on commit 9913dd3

Please sign in to comment.