mirror of
https://github.com/MaciejkaG/statki.git
synced 2024-11-30 04:42:55 +01:00
Added privacy policy and more enhancements to the landing page
This commit is contained in:
parent
8e5682dad8
commit
260383cd11
14
index.js
14
index.js
@ -88,6 +88,10 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|||||||
|
|
||||||
io.engine.use(sessionMiddleware);
|
io.engine.use(sessionMiddleware);
|
||||||
|
|
||||||
|
app.get('/privacy', (req, res) => {
|
||||||
|
res.render("privacy");
|
||||||
|
});
|
||||||
|
|
||||||
app.get('/', async (req, res) => {
|
app.get('/', async (req, res) => {
|
||||||
let login = loginState(req);
|
let login = loginState(req);
|
||||||
|
|
||||||
@ -355,11 +359,11 @@ io.on('connection', async (socket) => {
|
|||||||
const req = socket.request;
|
const req = socket.request;
|
||||||
const session = req.session;
|
const session = req.session;
|
||||||
socket.session = session;
|
socket.session = session;
|
||||||
if (session.loginState != 2) {
|
// if (session.loginState != 2) {
|
||||||
socket.on('email login', (email, callback) => {
|
// socket.on('email login', (email, callback) => {
|
||||||
callback(session.nickname);
|
// callback(session.nickname);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!await GInfo.isPlayerInGame(socket)) {
|
if (!await GInfo.isPlayerInGame(socket)) {
|
||||||
if (session.nickname == null) {
|
if (session.nickname == null) {
|
||||||
|
@ -9,6 +9,13 @@
|
|||||||
"Connection error": "Connection error"
|
"Connection error": "Connection error"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"landing": {
|
||||||
|
"The #1 online multiplayer battleships game": "The #1 online multiplayer battleships game",
|
||||||
|
"SCROLL DOWN": "SCROLL DOWN",
|
||||||
|
|
||||||
|
"Privacy policy": "Privacy policy"
|
||||||
|
},
|
||||||
|
|
||||||
"menu": {
|
"menu": {
|
||||||
"navbar": {
|
"navbar": {
|
||||||
"Main menu": "Main menu",
|
"Main menu": "Main menu",
|
||||||
|
@ -9,6 +9,13 @@
|
|||||||
"Connection error": "Błąd połączenia"
|
"Connection error": "Błąd połączenia"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"landing": {
|
||||||
|
"The #1 online multiplayer battleships game": "Najlepsza wielosobowa gra w statki",
|
||||||
|
"SCROLL DOWN": "SCROLLUJ W DÓŁ",
|
||||||
|
|
||||||
|
"Privacy policy": "Polityka prywatności"
|
||||||
|
},
|
||||||
|
|
||||||
"menu": {
|
"menu": {
|
||||||
"navbar": {
|
"navbar": {
|
||||||
"Main menu": "Menu główne",
|
"Main menu": "Menu główne",
|
||||||
|
@ -38,10 +38,14 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.4rem;
|
gap: 0.4rem;
|
||||||
|
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
transition: translate 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bgShip#bgs1 {
|
.bgShip#bgs1 {
|
||||||
left: 15vw;
|
left: 25vw;
|
||||||
rotate: -15deg;
|
rotate: -15deg;
|
||||||
top: 15vh;
|
top: 15vh;
|
||||||
}
|
}
|
||||||
@ -53,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bgShip#bgs3 {
|
.bgShip#bgs3 {
|
||||||
left: 20vw;
|
left: 30vw;
|
||||||
rotate: 65deg;
|
rotate: 65deg;
|
||||||
bottom: 25vh;
|
bottom: 25vh;
|
||||||
}
|
}
|
||||||
@ -64,8 +68,19 @@
|
|||||||
bottom: 25vh;
|
bottom: 25vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bgShip#bgs5 {
|
||||||
|
right: -15vw;
|
||||||
|
rotate: 20deg;
|
||||||
|
top: 25vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgShip#bgs6 {
|
||||||
|
right: -15vw;
|
||||||
|
rotate: 70deg;
|
||||||
|
bottom: 25vh;
|
||||||
|
}
|
||||||
|
|
||||||
.bgShip .field {
|
.bgShip .field {
|
||||||
/* background-color: var(--field); */
|
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
border-radius: 20%;
|
border-radius: 20%;
|
||||||
@ -112,9 +127,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
opacity: 1;
|
z-index: 10;
|
||||||
|
/* opacity: 1; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.container div.outer {
|
.container div.outer {
|
||||||
@ -123,5 +138,128 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
z-index: 10;
|
||||||
|
|
||||||
transform: translateY(-3rem);
|
transform: translateY(-3rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes OutAnim {
|
||||||
|
from {transform: translateX(0)}
|
||||||
|
to {transform: translateX(-5%);}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes InAnim {
|
||||||
|
from {transform: translateX(5%)}
|
||||||
|
to {transform: translateX(0%);}
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView .modes {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView .modes div {
|
||||||
|
height: 7rem;
|
||||||
|
width: 15rem;
|
||||||
|
background-color: black;
|
||||||
|
border: solid 1px white;
|
||||||
|
border-radius: 15px;
|
||||||
|
user-select: none;
|
||||||
|
padding: 2rem 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView form input {
|
||||||
|
background-color: black;
|
||||||
|
color: white;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid white;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0.5rem 2rem;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView form input[type=submit] {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loginView form input[type=submit]:hover {
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#authView .modes {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#authView .modes div {
|
||||||
|
height: 13rem;
|
||||||
|
width: 15rem;
|
||||||
|
background-color: black;
|
||||||
|
border: solid 1px white;
|
||||||
|
border-radius: 15px;
|
||||||
|
user-select: none;
|
||||||
|
padding: 2rem 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#authView form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#authView form input {
|
||||||
|
background-color: black;
|
||||||
|
color: white;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid white;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0.5rem 2rem;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#authView form input[type=submit] {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#authView form input[type=submit]:hover {
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
/* margin: 0; */
|
||||||
|
left: 50vw;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 50;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Roboto Mono', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a {
|
||||||
|
color: white;
|
||||||
|
margin: 0 1rem;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
@ -37,7 +37,32 @@ document.addEventListener("wheel", (event) => {
|
|||||||
}, 100 * (i - 1));
|
}, 100 * (i - 1));
|
||||||
}
|
}
|
||||||
}, 400);
|
}, 400);
|
||||||
|
const fields = document.querySelectorAll(".field");
|
||||||
|
fields.forEach(field => {
|
||||||
|
if (!field.id) {
|
||||||
|
$(field).css("scale", "1");
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (event.deltaY < 0) {
|
} else if (event.deltaY < 0) {
|
||||||
$(".loginContainer").removeClass("active");
|
$(".loginContainer").removeClass("active");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
switchView("loginView");
|
||||||
|
|
||||||
|
const form = document.getElementById('loginForm');
|
||||||
|
form.addEventListener('submit', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
console.log("a");
|
||||||
|
switchView("authView");
|
||||||
|
progressParalax();
|
||||||
|
});
|
||||||
|
|
||||||
|
var parallaxTranslateX = 0;
|
||||||
|
|
||||||
|
function progressParalax() {
|
||||||
|
parallaxTranslateX -= 30;
|
||||||
|
$(".bgShip.big").css("translate", `${parallaxTranslateX}vw`);
|
||||||
|
$(".bgShip.small").css("translate", `${parallaxTranslateX * 0.625}vw`);
|
||||||
|
}
|
@ -39,11 +39,9 @@ window.addEventListener("load", () => {
|
|||||||
|
|
||||||
// if (elem != null) {
|
// if (elem != null) {
|
||||||
// switchView(elem.id, true);
|
// switchView(elem.id, true);
|
||||||
// activeView = elem.id;
|
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
switchView("mainMenuView");
|
// switchView("mainMenuView");
|
||||||
activeView = "mainMenuView";
|
|
||||||
//}
|
//}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<h2>{{ t 'menu.PvP/Join.PvP / Join' }}</h2>
|
<h2>{{ t 'menu.PvP/Join.PvP / Join' }}</h2>
|
||||||
<div class="modes">
|
<div class="modes">
|
||||||
<div>
|
<div>
|
||||||
<form action="/api/joinme" id="pvpJoinForm">
|
<form action="#" id="pvpJoinForm">
|
||||||
<input type="text" maxlength="6" id="pvpJoinCode" placeholder="{{ t 'menu.PvP/Join.Room code' }}" autocomplete="off">
|
<input type="text" maxlength="6" id="pvpJoinCode" placeholder="{{ t 'menu.PvP/Join.Room code' }}" autocomplete="off">
|
||||||
<input type="submit" value="{{ t 'menu.PvP/Join.Join' }}">
|
<input type="submit" value="{{ t 'menu.PvP/Join.Join' }}">
|
||||||
</form>
|
</form>
|
||||||
|
@ -20,14 +20,26 @@
|
|||||||
<div class="field" id="f9"></div>
|
<div class="field" id="f9"></div>
|
||||||
<div class="field" id="f10"></div>
|
<div class="field" id="f10"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="bgShip small ally" id="bgs5">
|
||||||
|
<div class="field"></div>
|
||||||
|
<div class="field"></div>
|
||||||
|
<div class="field"></div>
|
||||||
|
</div>
|
||||||
|
<div class="bgShip big enemy" id="bgs6">
|
||||||
|
<div class="field"></div>
|
||||||
|
<div class="field"></div>
|
||||||
|
<div class="field"></div>
|
||||||
|
<div class="field"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container" id="pvpJoinView">
|
<div class="container" id="loginView">
|
||||||
<div class="outer">
|
<div class="outer">
|
||||||
<h2>{{ t 'login.Login' }}</h2>
|
<h2>{{ t 'login.Login' }}</h2>
|
||||||
<div class="modes">
|
<div class="modes">
|
||||||
<div>
|
<div>
|
||||||
<form action="/api/login" method="post">
|
<form action="#" method="post" id="loginForm">
|
||||||
<input type="email" name="email" placeholder="{{ t 'login.E-mail address' }}"
|
<input type="email" name="email" placeholder="{{ t 'login.E-mail address' }}"
|
||||||
style="font-size: 1rem;">
|
style="font-size: 1rem;">
|
||||||
<input type="submit" value="{{ t 'login.Proceed' }}">
|
<input type="submit" value="{{ t 'login.Proceed' }}">
|
||||||
@ -37,26 +49,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container" id="pvpJoinView">
|
<div class="container" id="authView">
|
||||||
<div class="outer">
|
<div class="outer">
|
||||||
<h2>{{ t 'login.Login' }}</h2>
|
<h2>{{ t 'auth.Authorisation' }}</h2>
|
||||||
<div class="modes">
|
<div class="modes">
|
||||||
<div>
|
<div>
|
||||||
<form action="/api/login" method="post">
|
<p>{{ t 'auth.Enter the code sent to your e-mail box' }}</p>
|
||||||
<input type="email" name="email" placeholder="{{ t 'login.E-mail address' }}"
|
<form action="/api/auth" method="post">
|
||||||
style="font-size: 1rem;">
|
<input type="text" name="code" placeholder="{{ t 'auth.Code' }}" style="font-size: 1rem;"
|
||||||
<input type="submit" value="{{ t 'login.Proceed' }}">
|
minlength="8" maxlength="10" autocomplete="off">
|
||||||
|
<input type="submit" value="{{ t 'auth.Login' }}">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p class="footer">© 2024 MCJK <a href="/privacy">{{ t 'landing.Privacy policy' }}</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="landing">
|
<div class="landing">
|
||||||
<h1>Statki</h1>
|
<h1>Statki</h1>
|
||||||
<p>The #1 online multiplayer battleships game</p>
|
<p>{{ t 'landing.The #1 online multiplayer battleships game' }}</p>
|
||||||
<span id="scrolldowntext">SCROLL DOWN</span>
|
<span id="scrolldowntext">{{ t 'landing.SCROLL DOWN' }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.locale = {
|
||||||
|
"Reconnecting": "{{ t 'errors.Reconnecting' }}",
|
||||||
|
"Reconnected": "{{ t 'errors.Reconnected' }}",
|
||||||
|
"Reconnection error occured": "{{ t 'errors.Reconnection error occured' }}",
|
||||||
|
"Reconnection failed": "{{ t 'errors.Reconnection failed' }}",
|
||||||
|
"Disconnected": "{{ t 'errors.Disconnected' }}",
|
||||||
|
"Try to refresh the page if this error reoccurs": "{{ t 'errors.Try to refresh the page if this error reoccurs' }}",
|
||||||
|
"Connection error": "{{ t 'errors.Connection error' }}",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="/assets/js/spa_lib.js"></script>
|
||||||
<script src="/assets/js/landing.js"></script>
|
<script src="/assets/js/landing.js"></script>
|
||||||
|
<script src="/assets/js/socket-err-handler.js"></script>
|
32
views/privacy.handlebars
Normal file
32
views/privacy.handlebars
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<style>
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<h1 class="title">Statki - Privacy policy</h1>
|
||||||
|
<h2>Who we are</h2>
|
||||||
|
<p>
|
||||||
|
When referencing to "us" we mean the developer(s) of Statki - An online multiplayer browser game at statki.maciejka.xyz. We do not work commercially and are not related to any company.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Data we collect</h2>
|
||||||
|
<p>
|
||||||
|
All of the data we collect is used for functionality features. Some is provided by you and some is collected automatically.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3>Information you provide us:</h3>
|
||||||
|
<p>
|
||||||
|
- Account information: E-mail address, nickname.<br>
|
||||||
|
- Settings, this includes: Preffered language.<br>
|
||||||
|
- Information from actions taken by you: Matches you have played (which includes: your opponent, duration of the match, date of the match, your match statistics)<br>
|
||||||
|
- Optional information: Badges you own - they are shown on your profile and strictly associated with it, you can obtain them optionally from various events. This includes the badge type and the achievement date.<br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3>Information collected automatically:</h3>
|
||||||
|
<p>
|
||||||
|
- Information about your device (IP address, browser version, device operating system, device language)<br>
|
||||||
|
- Information on how you use our service. How often you visit the website, on which page.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Our use of your data</h2>
|
||||||
|
<p>We use your data only to provide you with services. We do not share it with third parties, nor use it for advertising.</p>
|
Loading…
Reference in New Issue
Block a user