Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions docs/about.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ body {
float: right;
}

#faq-link {
position: sticky;
top: 0.25vh;
margin-right: 0.15vw;
margin-top: 0.5vh;
border: none;
background-color: #fffaea;
padding-top: 1.25vh;
padding-right: 1vw;
padding-left: 1vw;
padding-bottom: 1.25vh;
display: block;
width: 10vw;
border-style: none;
text-decoration: none;
font-family: 'Josefin Sans', sans-serif;
border-radius: 0.25em;
float: right;
}

#text {
margin-left: 2.5vw;
margin-right: 2.5vw;
Expand All @@ -57,27 +77,6 @@ body {
text-decoration: none;
}

footer {
color: #fffaea;
text-align: center;
width: 99%;
position: absolute;
bottom: 1vh;
font-family: 'Josefin Sans', sans-serif;
overflow-x: hidden;
font-size: 1em;
}

#git_image {
height: 2vh;
width: 2vh;
vertical-align: middle;
}

#footer_text {
display: inline-block;
}

@media only screen and (max-device-width: 480px) {
body {
background-color: #0d0d0d;
Expand Down
7 changes: 2 additions & 5 deletions docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

<body>
<header>
<button id="back" type="button" value="Back" onclick="backToMain()">Back</button>
<button id="faq" type="button" value="FAQ" onclick="window.location='faq.html'">FAQ</button>
<button id="back" type="button" value="Back">Back</button>
<button id="faq" type="button" value="FAQ">FAQ</button>
</header>

<main>
Expand Down Expand Up @@ -95,8 +95,5 @@ <h2>Tips for Success</h2>
</article>
</main>

<footer>
<p id="footer_text">Source code: <a href="https://github.com/DannyOppenheimer/SpyFall" target="_blank" rel="noopener noreferrer"><img id="git_image" src="git_image.png" alt="GitHub repository"></a></p>
</footer>
</body>
</html>
6 changes: 6 additions & 0 deletions docs/about.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('back')?.addEventListener('click', backToMain);
document.getElementById('faq')?.addEventListener('click', function () { window.location = 'faq.html'; });
document.getElementById('faq-link')?.addEventListener('click', function () { window.location = 'about.html'; });
});

function backToMain() {
window.location = '/';
}
3 changes: 1 addition & 2 deletions docs/create_room.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(() => {
// Connect to the backend server
var socket_link = io('https://spyfall-production-5f2b.up.railway.app');
var socket_link = io(location.hostname === 'localhost' ? location.origin : 'https://spyfall-production-5f2b.up.railway.app');

var params = new URLSearchParams(location.search);
var name = params.get('name') || '';
Expand Down
7 changes: 2 additions & 5 deletions docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@

<body>
<header>
<button id="back" type="button" value="Back" onclick="backToMain()">Back</button>
<button id="faq-link" type="button" value="How To Play" onclick="window.location='about.html'">How To Play</button>
<button id="back" type="button" value="Back">Back</button>
<button id="faq-link" type="button" value="How To Play">How To Play</button>
</header>

<main>
Expand Down Expand Up @@ -176,8 +176,5 @@ <h3>Can the spy vote?</h3>
</article>
</main>

<footer>
<p id="footer_text">Source code: <a href="https://github.com/DannyOppenheimer/SpyFall" target="_blank" rel="noopener noreferrer"><img id="git_image" src="git_image.png" alt="GitHub repository"></a></p>
</footer>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/game_room.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(() => {
var socket_link = io('https://spyfall-production-5f2b.up.railway.app');
var socket_link = io(location.hostname === 'localhost' ? location.origin : 'https://spyfall-production-5f2b.up.railway.app');

var params = new URLSearchParams(location.search);
var room_key = params.get('key') || '';
Expand Down
7 changes: 4 additions & 3 deletions docs/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ body {
font-size: 1em;
}

.footer {
footer {
color: #fffaea;
text-align: center;
width: 99%;
width: 100%;
position: absolute;
bottom: 1vh;
bottom: 0;
left: 0;
font-family: 'Josefin Sans', sans-serif;
overflow-x: hidden;
font-size: 1em;
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<body>
<header>
<nav>
<button id="button_rules" type="button" value="How To Play" onclick="rules()">How To Play</button>
<button id="button_rules" type="button" value="How To Play">How To Play</button>
</nav>
</header>

Expand All @@ -74,12 +74,12 @@ <h1>SpyFall</h1>

<br>
<div class="buttons">
<input type="text" id="name_field" placeholder="Please enter your name." maxlength="25" onkeypress="enterPress(event)">
<input type="text" id="name_field" placeholder="Please enter your name." maxlength="25">
<p id="error_message"></p>

<button type="button" id="create_room_button" onclick="createRoom()">Create Room</button>
<button type="button" id="create_room_button">Create Room</button>
<br>
<button type="button" id="join_room_button" onclick="joinRoom()">Join Room</button>
<button type="button" id="join_room_button">Join Room</button>
</div>
</div>
</main>
Expand Down
7 changes: 7 additions & 0 deletions docs/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('button_rules').addEventListener('click', rules);
document.getElementById('create_room_button').addEventListener('click', createRoom);
document.getElementById('join_room_button').addEventListener('click', joinRoom);
document.getElementById('name_field').addEventListener('keypress', enterPress);
});

function createRoom() {
if (nameIntegrity()) {
let query = new URLSearchParams({ name: document.getElementById('name_field').value });
Expand Down
17 changes: 17 additions & 0 deletions docs/join_room.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ body {
border-radius: 0.125em;
}

label {
display: block;
color: #fffaea;
font-family: 'Josefin Sans', sans-serif;
text-align: center;
margin-bottom: 2vh;
}

#no_key_err {
color: lightcoral;
font-family: 'Josefin Sans', sans-serif;
Expand Down Expand Up @@ -134,4 +142,13 @@ body {
border-radius: 0.25em;
font-size: 2em;
}

label {
display: block;
color: #fffaea;
font-family: 'Josefin Sans', sans-serif;
text-align: center;
margin-bottom: 2vh;
font-size: 1.5em;
}
}
2 changes: 1 addition & 1 deletion docs/join_room.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(() => {
var socket_link = io('https://spyfall-production-5f2b.up.railway.app');
var socket_link = io(location.hostname === 'localhost' ? location.origin : 'https://spyfall-production-5f2b.up.railway.app');

var params = new URLSearchParams(location.search);
var name = params.get('name') || '';
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ app.use(helmet({
contentSecurityPolicy: {
directives: {
...helmet.contentSecurityPolicy.getDefaultDirectives(),
"script-src": ["'self'", "https://spyfall-production-5f2b.up.railway.app"]
"script-src": ["'self'", "https://spyfall-production-5f2b.up.railway.app"],
"connect-src": ["'self'", "https://spyfall-production-5f2b.up.railway.app", "wss://spyfall-production-5f2b.up.railway.app"]
}
}
}));
Expand Down