Compare commits
44 Commits
Author | SHA1 | Date |
---|---|---|
|
a80923012f | ago%!(EXTRA string=10 months) |
|
7350a7b4d2 | ago%!(EXTRA string=10 months) |
|
366bf26f65 | ago%!(EXTRA string=10 months) |
|
5012756649 | ago%!(EXTRA string=10 months) |
|
a4ae9b5665 | ago%!(EXTRA string=10 months) |
|
070fa3a00c | ago%!(EXTRA string=10 months) |
|
82b87a23c2 | ago%!(EXTRA string=10 months) |
|
b5be2968c2 | ago%!(EXTRA string=10 months) |
|
4dbb6cc035 | ago%!(EXTRA string=10 months) |
|
de3a3e66f9 | ago%!(EXTRA string=10 months) |
|
7fdf6c1b75 | ago%!(EXTRA string=10 months) |
|
fc2d56897d | ago%!(EXTRA string=10 months) |
|
2f3efdbed5 | ago%!(EXTRA string=10 months) |
|
02a7885121 | ago%!(EXTRA string=10 months) |
|
dfa1229523 | ago%!(EXTRA string=10 months) |
|
8d4d9d4612 | ago%!(EXTRA string=10 months) |
|
394376f2d2 | ago%!(EXTRA string=10 months) |
|
e3cd361c46 | ago%!(EXTRA string=10 months) |
|
9e58d2a3df | ago%!(EXTRA string=10 months) |
|
737f12c0da | ago%!(EXTRA string=10 months) |
|
9c4e5eaebe | ago%!(EXTRA string=10 months) |
|
6ac1b6139e | ago%!(EXTRA string=10 months) |
|
e852f0c03a | ago%!(EXTRA string=10 months) |
|
cee916fdf0 | ago%!(EXTRA string=10 months) |
|
c294b9dd2d | ago%!(EXTRA string=10 months) |
|
20a1e1f6b9 | ago%!(EXTRA string=10 months) |
|
eda9915c9f | ago%!(EXTRA string=11 months) |
|
8f447e9d4c | ago%!(EXTRA string=11 months) |
|
cbb4bd882b | ago%!(EXTRA string=11 months) |
|
f85469ae25 | ago%!(EXTRA string=11 months) |
|
8b14c5bd29 | ago%!(EXTRA string=11 months) |
|
c6df3d1db2 | ago%!(EXTRA string=11 months) |
|
44c2e837bb | ago%!(EXTRA string=11 months) |
|
b79986cc1b | ago%!(EXTRA string=11 months) |
|
9cf24755f5 | ago%!(EXTRA string=11 months) |
|
be0ff228d1 | ago%!(EXTRA string=11 months) |
|
a3108d3a44 | ago%!(EXTRA string=11 months) |
|
a347f28172 | ago%!(EXTRA string=11 months) |
|
7b000c00a5 | ago%!(EXTRA string=11 months) |
|
03f8a9a30a | ago%!(EXTRA string=11 months) |
|
8985bf48a4 | ago%!(EXTRA string=11 months) |
|
1558238940 | ago%!(EXTRA string=1 year) |
|
d9f08aa7f4 | ago%!(EXTRA string=1 year) |
|
3076db801b | ago%!(EXTRA string=1 year) |
@ -1 +1,2 @@ |
||||
/.vs/ |
||||
/js/skama_code |
@ -1,3 +0,0 @@ |
||||
[submodule "js/skama_code"] |
||||
path = js/skama_code |
||||
url = https://github.com/anulax1225/skama_code |
@ -1,2 +1,2 @@ |
||||
DO NOT USE THIS CODE OR LOOK AT IT IF YOU ARE NOT ALLOWED TO |
||||
IF YOU DO YOU CAN USE OR TEACH THE KNOWLEAGE YOU ACQUEIRED. |
||||
IF YOU DO YOU CAN'T USE OR TEACH THE KNOWLEAGE YOU ACQUEIRED. |
@ -1,15 +0,0 @@ |
||||
# Skamkraft |
||||
|
||||
## Start |
||||
* Start with live server in VsCode to get full functionnality. |
||||
* Start with php : |
||||
``` bash |
||||
cd /.../Skamkraft |
||||
php -S 127.0.0.1:80 |
||||
``` |
||||
|
||||
## Norm |
||||
* ``` ; ``` at the end of each line. |
||||
* snack_case for functions and variables. |
||||
* UpperCamelCase for Classes. |
||||
* all in english. |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 945 B |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 419 B |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 412 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 142 KiB |
@ -1,32 +0,0 @@ |
||||
/* Copyright © 2023 Entreprise SkamKraft */ |
||||
|
||||
.languettes input:hover{ |
||||
animation: slide-left; |
||||
position: relative; |
||||
animation-timing-function: ease; |
||||
animation-fill-mode: forwards; |
||||
animation-duration: 1s; |
||||
} |
||||
@keyframes slide-left { |
||||
0% { |
||||
right: 0px; |
||||
top: 0px; |
||||
} |
||||
100% { |
||||
right: 25px; |
||||
top: 0px; |
||||
} |
||||
} |
||||
|
||||
.ext-modal[open] { |
||||
animation: myFadeIn 0.5s ease normal; |
||||
} |
||||
|
||||
@keyframes myFadeIn{ |
||||
from { |
||||
bottom: 100%; |
||||
} |
||||
to { |
||||
bottom: 0%; |
||||
} |
||||
} |
@ -1,48 +1,32 @@ |
||||
.auth-container { |
||||
height: inherit; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
} |
||||
|
||||
.auth-title |
||||
{ |
||||
font-size: 50px; |
||||
} |
||||
|
||||
.auth{ |
||||
width: 300px; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
justify-content: center; |
||||
background-color: rgba(0, 0, 0, 0.863); |
||||
background-color: var(--main-color); |
||||
padding: 30px; |
||||
border-radius: 5px; |
||||
} |
||||
|
||||
.auth-input { |
||||
border-radius: 2px; |
||||
padding: 5px; |
||||
} |
||||
|
||||
.auth-grp-label { |
||||
font-size: 20px; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
|
||||
.auth-btn { |
||||
margin: 3px; |
||||
padding: 4px; |
||||
font-size: 20px; |
||||
color: white; |
||||
border-radius: 5px; |
||||
} |
||||
|
||||
.auth-btn-val { |
||||
background-color: blue; |
||||
} |
||||
|
||||
.auth-btn-can { |
||||
background-color: red; |
||||
} |
||||
|
||||
.auth-btn-other { |
||||
background-color: darkgreen; |
||||
} |
||||
|
||||
.auth-select { |
||||
margin-top: 1vh; |
||||
border-radius: 3px; |
||||
} |
||||
|
||||
.errors { |
||||
color: red; |
||||
} |
@ -1,83 +0,0 @@ |
||||
/* Copyright © 2023 Entreprise SkamCraft */ |
||||
|
||||
|
||||
|
||||
body, |
||||
html { |
||||
height: 100%; |
||||
} |
||||
|
||||
|
||||
|
||||
.btn-infos { |
||||
margin: 2px; |
||||
/* color: black; */ |
||||
background-color: transparent; |
||||
border: 5px solid #0018e8; |
||||
border-radius: 10px; |
||||
} |
||||
|
||||
.btn-infos:hover { |
||||
border-color: #0018e8; |
||||
background-color: #0018e8; |
||||
; |
||||
} |
||||
|
||||
.btn-accept { |
||||
margin: 2px; |
||||
/* color: black; */ |
||||
background-color: transparent; |
||||
border: 5px solid #0018e8; |
||||
border-radius: 10px; |
||||
} |
||||
|
||||
.btn-accept:hover { |
||||
border-color: rgb(33, 196, 0); |
||||
background-color: rgb(33, 196, 0); |
||||
} |
||||
|
||||
.card { |
||||
margin-bottom: 30px; |
||||
} |
||||
|
||||
.contract-screen { |
||||
display: flex; |
||||
justify-content: center; |
||||
background-image: url("/assets/contracts/contractscreen.png"); |
||||
background-repeat: no-repeat; |
||||
background-position: center; |
||||
height: 100vh; |
||||
|
||||
} |
||||
|
||||
.card-body { |
||||
display: grid; |
||||
grid-template-columns: 1fr 1fr; |
||||
margin-left: 200px; |
||||
margin-top: -160px; |
||||
width: 100%; |
||||
} |
||||
|
||||
.card-body button { |
||||
margin-top: 50px; |
||||
margin-right: 29px; |
||||
margin-left: -11px; |
||||
width: 240px; |
||||
} |
||||
|
||||
.contracts { |
||||
margin-left: 240px; |
||||
margin-top: 250px; |
||||
height: 100vh; |
||||
width: 100vh; |
||||
} |
||||
|
||||
/* Modal */ |
||||
|
||||
.status-onhold { |
||||
color: orange; |
||||
} |
||||
|
||||
.status-accepted { |
||||
color: greenyellow; |
||||
} |
@ -0,0 +1,72 @@ |
||||
.card{ |
||||
display: grid; |
||||
margin-top: 15px; |
||||
grid-template-columns: 1fr 1fr; |
||||
} |
||||
.contracts |
||||
{ |
||||
display: flex; |
||||
justify-content: center; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
height: 50%; |
||||
width: 50%; |
||||
overflow-y: scroll; |
||||
} |
||||
|
||||
.contract-screen |
||||
{ |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
} |
||||
.screen-img { |
||||
z-index: -1; |
||||
position: absolute; |
||||
top: 10%; |
||||
height: 80%; |
||||
bottom: 1%; |
||||
right: 20%; |
||||
left: 20%; |
||||
width: 60%; |
||||
} |
||||
.card-body{ |
||||
margin-left: 50px; |
||||
} |
||||
.card-button{ |
||||
margin-top: 10px; |
||||
} |
||||
|
||||
.img |
||||
{ |
||||
position: absolute; |
||||
top: 10%; |
||||
left: 25%; |
||||
z-index: -1; |
||||
background-repeat: no-repeat; |
||||
display: flex; |
||||
justify-content: center; |
||||
|
||||
} |
||||
|
||||
#contracts-modal |
||||
{ |
||||
background-color: rgba(0, 0, 255, 0.5); |
||||
border: none; |
||||
border-radius: 10px; |
||||
padding: 40px; |
||||
color: white; |
||||
} |
||||
|
||||
/* Modal */ |
||||
|
||||
.status-onhold { |
||||
color: orange; |
||||
} |
||||
|
||||
.status-accepted { |
||||
color: greenyellow; |
||||
} |
@ -1,45 +1,192 @@ |
||||
/* Copyright © 2023 Entreprise SkamCraft */ |
||||
@font-face { |
||||
font-family: pixellari; |
||||
src: url("/assets/fonts/Pixellari.ttf"); |
||||
} |
||||
|
||||
:root { |
||||
--text-color: white; |
||||
--text-color: white; |
||||
--text-familly: pixellari; |
||||
--main-color: black; |
||||
--sec-color: rgba(69, 128, 255, 0.842); |
||||
} |
||||
|
||||
@font-face { |
||||
font-family: pixellari; |
||||
src: url("../assets/fonts/Pixellari.ttf"); |
||||
::-webkit-scrollbar { |
||||
width: 0 !important |
||||
} |
||||
|
||||
body{ |
||||
background-image: url("/assets/img/background.png"); |
||||
background-repeat: no-repeat; |
||||
background-size: cover; |
||||
overflow: hidden; |
||||
font-family: var(--text-familly); |
||||
color: var(--text-color); |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
/* |
||||
button{ |
||||
font-family: var(--text-familly); |
||||
color: var(--text-color); |
||||
} */ |
||||
|
||||
body { |
||||
background-image: url(/assets/img/backgroundfinal.png); |
||||
background-repeat: no-repeat; |
||||
background-size: 100%; |
||||
overflow-x: hidden; |
||||
input{ |
||||
font-family: var(--text-familly); |
||||
color: var(--text-color); |
||||
} |
||||
|
||||
input { |
||||
border: none; |
||||
font-family: pixellari; |
||||
#block-content{ |
||||
margin: 0; |
||||
padding: 0; |
||||
width: 100%; |
||||
height: 100vh; |
||||
} |
||||
|
||||
.modal-disable::backdrop { |
||||
background-color: rgba(0, 0, 0, 0.493); |
||||
} |
||||
|
||||
button { |
||||
border: none; |
||||
font-family: pixellari; |
||||
.ext-modal[open] { |
||||
animation: myFadeIn 0.5s ease normal; |
||||
} |
||||
|
||||
@keyframes myFadeIn{ |
||||
from { |
||||
bottom: 100%; |
||||
} |
||||
to { |
||||
bottom: 0%; |
||||
} |
||||
} |
||||
|
||||
select { |
||||
border: none; |
||||
font-family: pixellari; |
||||
.home-container { |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
text-shadow: 4px 2px black; |
||||
} |
||||
|
||||
.languettes { |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items:flex-end; |
||||
margin: 250px -50px 0px 0px ; |
||||
z-index: 1; |
||||
right: -30px; |
||||
top: 25%; |
||||
width: 80px; |
||||
position: absolute; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items:flex-end; |
||||
} |
||||
|
||||
.languettes input{ |
||||
width: 5%; |
||||
width: 100%; |
||||
} |
||||
.languettes input:hover{ |
||||
animation: slide-left; |
||||
position: relative; |
||||
animation-timing-function: ease; |
||||
animation-fill-mode: forwards; |
||||
animation-duration: 1s; |
||||
} |
||||
|
||||
@keyframes slide-left { |
||||
0% {right: 0px; top: 0px;} |
||||
100% {right: 25px; top: 0px;} |
||||
} |
||||
|
||||
.Title{ |
||||
position: absolute; |
||||
font-size: 50px; |
||||
margin-left: 50px; |
||||
background-color: rgba(0, 0, 0, 0.363); |
||||
border-radius: 5px; |
||||
width: fit-content; |
||||
padding: 10px; |
||||
} |
||||
|
||||
.cont-center { |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
} |
||||
|
||||
.title{ |
||||
font-size: 50px; |
||||
margin-left: 50px; |
||||
} |
||||
|
||||
::placeholder { |
||||
color: var(--text-color); |
||||
} |
||||
|
||||
.base-input{ |
||||
margin: 5px; |
||||
padding: 10px; |
||||
border: none; |
||||
border-radius: 5px; |
||||
background-color: var(--sec-color); |
||||
font-size: 20px; |
||||
} |
||||
.base-input:active{ |
||||
background-color: var(--sec-color); |
||||
font-size: 20px; |
||||
} |
||||
|
||||
/* .base-btn{ |
||||
margin: 2px; |
||||
padding: 10px; |
||||
border: none; |
||||
border-radius: 5px; |
||||
background-color: var(--sec-color); |
||||
font-size: 20px; |
||||
} */ |
||||
button, .button { |
||||
margin: 2px; |
||||
font-family: var(--text-familly); |
||||
background-color: #0000008f; |
||||
color: #ffffff; |
||||
border: 2px solid #ffffff; |
||||
padding: 10px; |
||||
font-size: 13px; |
||||
cursor: pointer; |
||||
border-radius: 5px; |
||||
transition: background-color 0.3s, color 0.3s, border-color 0.3s; |
||||
} |
||||
|
||||
button:hover, .button:hover { |
||||
background-color: #ffffff; |
||||
color: #1a1a1a; |
||||
border-color: #1a1a1a; |
||||
} |
||||
|
||||
button:active, .button:active { |
||||
background-color: #333333; |
||||
color: #ffffff; |
||||
border-color: #ffffff; |
||||
} |
||||
|
||||
button:disabled, .button:disabled { |
||||
background-color: #555555; |
||||
color: #b3b3b3; |
||||
border-color: #b3b3b3; |
||||
cursor: not-allowed; |
||||
opacity: 0.6; |
||||
} |
||||
|
||||
/* .base-btn:hover{ |
||||
box-shadow: 1px 1px 1px 0px rgba(88, 88, 252, 0.842); |
||||
} */ |
||||
|
||||
.base-select { |
||||
margin: 5px; |
||||
padding: 10px; |
||||
border: none; |
||||
border-radius: 3px; |
||||
background-color: var(--sec-color); |
||||
font-size: 15px; |
||||
font-family: var(--text-familly); |
||||
color: var(--text-color); |
||||
} |
@ -0,0 +1,56 @@ |
||||
.container-ldb { |
||||
width: 100%; |
||||
} |
||||
#myVideo { |
||||
position: fixed; |
||||
right: 0; |
||||
bottom: 0; |
||||
min-width: 100%; |
||||
min-height: 100%; |
||||
z-index: -1; |
||||
} |
||||
.head-board { |
||||
display: grid; |
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; |
||||
margin: auto; |
||||
width: 60%; |
||||
padding: 20px; |
||||
font-size:x-large; |
||||
border : 1px solid white; |
||||
border-bottom-color: white; |
||||
border-bottom-width: 1px; |
||||
border-top-right-radius: 5px; |
||||
border-top-left-radius: 5px; |
||||
background-color: rgba(0, 0, 0, 0.5); |
||||
} |
||||
|
||||
.leaderboard { |
||||
display: flex; |
||||
margin: auto; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
border : 1px solid white; |
||||
width: 60%; |
||||
height: 350px; |
||||
overflow-y: scroll; |
||||
overflow-x: visible; |
||||
background-color: rgba(0, 0, 0, 0.5); |
||||
padding: 20px; |
||||
border-bottom-right-radius: 5px; |
||||
border-bottom-left-radius: 5px; |
||||
scrollbar-width: none; |
||||
} |
||||
|
||||
.player { |
||||
width: 100%; |
||||
display: grid; |
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; |
||||
border-bottom: 1px solid rgb(255, 255, 255); |
||||
} |
||||
|
||||
.player p { |
||||
padding: 5px; |
||||
color: white; |
||||
font-size: large; |
||||
text-align: start; |
||||
} |
@ -0,0 +1,41 @@ |
||||
.modal-ships { |
||||
background-image: url("/assets/spaceships/blueprint.png"); |
||||
background-size: cover; |
||||
font-size: 25px; |
||||
width: 1000px; /* Set the width to the image width */ |
||||
height: 560px; /* Set the height to the image height */ |
||||
position: relative; |
||||
margin: auto; |
||||
padding: 40px; |
||||
color: rgb(255, 255, 255); |
||||
} |
||||
|
||||
.infos-ships { |
||||
padding: 20px; |
||||
margin-bottom: 20px; /* Space below the info box */ |
||||
} |
||||
|
||||
.ship-info { |
||||
background-color: rgba(0, 0, 0, 0.363); |
||||
border-radius: 5px; |
||||
width: fit-content; |
||||
padding: 5px; |
||||
} |
||||
|
||||
.btn-close-ships { |
||||
position: absolute; |
||||
font-size:x-large; |
||||
bottom: 20px; |
||||
left: 20px; |
||||
background-color: rgba(255, 255, 255, 0.8); |
||||
border: none; |
||||
color: rgb(252, 252, 252); |
||||
padding: 10px 20px; |
||||
cursor: pointer; |
||||
border-radius: 5px; |
||||
transition: background-color 0.3s ease; |
||||
} |
||||
|
||||
.btn-close-ships:hover { |
||||
background-color: rgba(255, 255, 255, 1); |
||||
} |
@ -0,0 +1,101 @@ |
||||
.cont-profile |
||||
{ |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
#myVideo { |
||||
position: fixed; |
||||
right: 0; |
||||
bottom: 0; |
||||
min-width: 100%; |
||||
min-height: 100%; |
||||
z-index: -1; |
||||
} |
||||
#profile |
||||
{ |
||||
width: 50%; |
||||
height: 90%; |
||||
padding: 10px; |
||||
background-color: rgba(0, 0, 0, 0.637); |
||||
border: none; |
||||
border-radius: 10px; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
color: white; |
||||
} |
||||
|
||||
.profile-header |
||||
{ |
||||
width: 100%; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.profile-header p |
||||
{ |
||||
font-size: 60px; |
||||
} |
||||
|
||||
.profile-header button |
||||
{ |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
border: none; |
||||
} |
||||
|
||||
.profile-header button p |
||||
{ |
||||
font-size: 25px; |
||||
padding: 0; |
||||
margin: 0; |
||||
} |
||||
|
||||
.profile-content |
||||
{ |
||||
width: 80%; |
||||
display: grid; |
||||
grid-template-columns: 1fr 1fr; |
||||
grid-template-rows: 1fr 1fr 1fr 1fr 1fr; |
||||
border: 1px solid white; |
||||
border-radius: 10px; |
||||
padding: 0; |
||||
} |
||||
|
||||
.profile-content p |
||||
{ |
||||
text-align: center; |
||||
} |
||||
|
||||
.tb-r |
||||
{ |
||||
border-right: 1px solid white; |
||||
} |
||||
|
||||
.profile-footer |
||||
{ |
||||
display: flex; |
||||
align-items: center; |
||||
width: 80%; |
||||
padding: 5px; |
||||
} |
||||
|
||||
#btn-logout |
||||
{ |
||||
width: 50px; |
||||
height: 50px; |
||||
padding: 0; |
||||
border: none; |
||||
background: none; |
||||
} |
||||
|
||||
#btn-logout img |
||||
{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
@ -1,85 +0,0 @@ |
||||
* { |
||||
box-sizing: border-box; |
||||
} |
||||
@font-face { |
||||
font-family: M42; |
||||
src: url("/assets/fonts/m42.TTF"); |
||||
} |
||||
.block-ships{ |
||||
display:flex; |
||||
flex-direction: column; |
||||
color: white; |
||||
font-size:large; |
||||
text-align: center; |
||||
padding-top: 80px; |
||||
max-width: 1000px; |
||||
position: relative; |
||||
margin: auto; |
||||
} |
||||
button{ |
||||
color: white; |
||||
font-family: 'M42'; |
||||
background-color: black; |
||||
font-size:x-small; |
||||
box-shadow: 3px 2px white; |
||||
border: 4px solid white; |
||||
border-radius: 10px; |
||||
padding: 10px; |
||||
padding-left: 15px; |
||||
padding-right: 15px; |
||||
} |
||||
button:hover{ |
||||
background-color:aqua ; |
||||
transition: 1s; |
||||
} |
||||
|
||||
|
||||
.my-modal{ |
||||
font-size:small; |
||||
} |
||||
body{ |
||||
background-image: url("/assets/spaceships/hangar.png"); |
||||
background-size: cover; |
||||
} |
||||
|
||||
.ships-list { |
||||
display: none; |
||||
} |
||||
|
||||
/* Next & previous buttons */ |
||||
.prev, .next { |
||||
cursor: pointer; |
||||
position: absolute; |
||||
top: 50%; |
||||
width: auto; |
||||
margin-top: -22px; |
||||
padding: 16px; |
||||
color: white; |
||||
font-weight: bold; |
||||
font-size: 18px; |
||||
transition: 0.6s ease; |
||||
border-radius: 0 3px 3px 0; |
||||
user-select: none; |
||||
} |
||||
|
||||
/* Position the "next button" to the right */ |
||||
.next { |
||||
right: 0; |
||||
border-radius: 3px 0 0 3px; |
||||
} |
||||
|
||||
/* On hover, add a black background color with a little bit see-through */ |
||||
.prev:hover, .next:hover { |
||||
background-color: rgba(0,0,0,0.8); |
||||
} |
||||
|
||||
/* Fading animation */ |
||||
.fade { |
||||
animation-name: fade; |
||||
animation-duration: 1.5s; |
||||
} |
||||
|
||||
@keyframes fade { |
||||
from {opacity: .4} |
||||
to {opacity: 1} |
||||
} |
@ -0,0 +1,55 @@ |
||||
.block-ships{ |
||||
position: relative; |
||||
width: 50%; |
||||
display:flex; |
||||
flex-direction: column; |
||||
color: white; |
||||
font-size:large; |
||||
text-align: center; |
||||
margin: auto; |
||||
} |
||||
|
||||
.ships-modal{ |
||||
font-size:small; |
||||
background-image: url("/assets/spaceships/blueprint.png"); |
||||
background-repeat: no-repeat; |
||||
background-size: contain; |
||||
} |
||||
|
||||
.ships-list { |
||||
display: none; |
||||
} |
||||
|
||||
/* Next & previous buttons */ |
||||
.prev, .next { |
||||
cursor: pointer; |
||||
position: absolute; |
||||
top: 50%; |
||||
margin-top: -22px; |
||||
font-weight: bold; |
||||
font-size: 60px; |
||||
transition: 0.6s ease; |
||||
} |
||||
|
||||
.imgShip { |
||||
left: 0; |
||||
margin-top: 50px; |
||||
width: 70%; |
||||
} |
||||
.ships-list h5 { |
||||
font-size:xx-large; |
||||
background-color: rgba(0, 0, 0, 0.363); |
||||
border-radius: 5px; |
||||
width: fit-content; |
||||
padding: 10px; |
||||
margin:auto; |
||||
} |
||||
/* Position the "next button" to the right */ |
||||
.next { |
||||
right: 0; |
||||
} |
||||
|
||||
/* On hover, add a black background color with a little bit see-through */ |
||||
.btn-ships{ |
||||
font-size:x-large; |
||||
} |
@ -0,0 +1,17 @@ |
||||
.cont-canvas |
||||
{ |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
z-index: -1; |
||||
} |
||||
|
||||
#sys-canvas |
||||
{ |
||||
z-index: -1; |
||||
border: 1px solid black; |
||||
border-radius: 10px; |
||||
background-color: rgba(11, 1, 37, 0.842); |
||||
} |
@ -1,12 +0,0 @@ |
||||
/* Copyright © 2023 Entreprise SkamKraft */ |
||||
|
||||
#block-content { |
||||
margin: 0; |
||||
padding: 0; |
||||
width: 100%; |
||||
height: 100vh; |
||||
} |
||||
|
||||
.modal-disable::backdrop { |
||||
background-color: rgba(0, 0, 0, 0.493); |
||||
} |
@ -1,68 +1,8 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<main> |
||||
<audio id="audio1" controls loop style="display:none" crossorigin="anonymous"> |
||||
<source src="/assets/sounds/skamkraft_main_theme.mp3" type="audio/mpeg"> |
||||
</audio> |
||||
<audio id="audio2" controls loop style="display:none" crossorigin="anonymous"> |
||||
<source src="/assets/sounds/goofy ahh song.mp3" type="audio/mpeg"> |
||||
</audio> |
||||
<body> |
||||
<audio id="audio1" src="1o.mp3"></audio> |
||||
<audio id="audio2" src="2o.mp3"></audio> |
||||
<div>Track one: <span id="playStatus1">stopped</span></div> |
||||
<div>Track two: <span id="playStatus2">stopped</span></div> |
||||
<div>Listening to: <span id="currTrack">nothing</span></div> |
||||
<button id="start">Start the tracks rolling</button> |
||||
<button id="toggle" disabled>Toggle</button> |
||||
|
||||
<script> |
||||
var startButton = document.getElementById("start"); |
||||
var toggleButton = document.getElementById("toggle"); |
||||
var track1 = document.getElementById("audio1"); |
||||
var track2 = document.getElementById("audio2"); |
||||
var status1 = document.getElementById("playStatus1"); |
||||
var status2 = document.getElementById("playStatus2"); |
||||
var currTrack = document.getElementById("currTrack"); |
||||
|
||||
function updatePlayStatus(track, status, t){ |
||||
if (track.paused == true){ |
||||
status.innerHTML = "stopped"; |
||||
clearInterval(t); |
||||
startButton.disabled = false; |
||||
toggleButton.disabled = true; |
||||
currTrack.innerHTML = "nothing"; |
||||
} |
||||
} |
||||
|
||||
startButton.onclick = function(){ |
||||
this.disabled = true; |
||||
track1.play(); |
||||
track2.play(); |
||||
track2.muted = true; |
||||
status1.innerHTML = "playing"; |
||||
status2.innerHTML = "playing"; |
||||
currTrack.innerHTML = "Track 1"; |
||||
toggleButton.disabled = false; |
||||
|
||||
var t1 = window.setInterval(function() { updatePlayStatus(track1, status1, t1) }, 500); |
||||
var t2 = window.setInterval(function() { updatePlayStatus(track2, status2, t2) }, 500); |
||||
} |
||||
|
||||
toggleButton.onclick = function(){ |
||||
track1.currentTime = 0; |
||||
track2.currentTime = 0; |
||||
if (track1.muted == true){ |
||||
track1.muted = false; |
||||
track2.muted = true; |
||||
currTrack.innerHTML = "Track 1"; |
||||
} else { |
||||
track2.muted = false; |
||||
track1.muted = true; |
||||
currTrack.innerHTML = "Track 2"; |
||||
} |
||||
} |
||||
</script> |
||||
</body> |
||||
<main id="block-content"></main> |
||||
<div class="languettes" id="links"></div> |
||||
</main> |
||||
<script> |
||||
// document.getElementById('audio').play(); |
||||
</script> |
||||
<div id="links" class="languettes"> |
||||
|
||||
</div> |
||||
<div id="block-content"> |
||||
</div> |
||||
|
@ -1,20 +1,19 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
|
||||
<div class="container"> |
||||
<div class="auth-container"> |
||||
<p class="title">Login</p> |
||||
<input type="text" placeholder="Agent token" class="auth-input" id="in-token"> |
||||
<div class="auth-container"> |
||||
<div class="auth"> |
||||
<p class="auth-title">LOGIN</p> |
||||
<input type="text" placeholder="Agent token" class="base-input" id="in-token"> |
||||
<div class="auth-grp-label"> |
||||
<p>Remember me ?</p> |
||||
<input type="checkbox" class="auth-input" id="in-remember"> |
||||
<input type="checkbox" class="base-input" id="in-remember"> |
||||
</div> |
||||
<div> |
||||
<button class="auth-btn auth-btn-val" id="btn-login">Validate</button> |
||||
<button class="auth-btn auth-btn-can" id="btn-cancel">Cancel</button> |
||||
<button class="base-btn" id="btn-login">Validate</button> |
||||
<button class="base-btn" id="btn-cancel">Cancel</button> |
||||
</div> |
||||
<div> |
||||
<button class="auth-btn auth-btn-other" id="btn-reg">New agent</button> |
||||
<button class="base-btn" id="btn-register">New agent</button> |
||||
</div> |
||||
<div class="errors"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
@ -1,24 +0,0 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
|
||||
<div class="container"> |
||||
<div class="auth-container"> |
||||
<p class="title">New Agent</p> |
||||
<input type="text" placeholder="Name" class="auth-input" id="in-name"> |
||||
<select class="auth-select" id="in-faction"> |
||||
<option value="" disabled selected>Factions</option> |
||||
<optgroup id="group-faction" label="--------------"></optgroup> |
||||
</select> |
||||
<div class="auth-grp-label"> |
||||
<p>Remember me ?</p> |
||||
<input type="checkbox" class="auth-input" id="in-remember"> |
||||
</div> |
||||
<div> |
||||
<button class="auth-btn auth-btn-val" id="btn-register">Validate</button> |
||||
<button class="auth-btn auth-btn-can" id="btn-cancel">Cancel</button> |
||||
</div> |
||||
<div> |
||||
<button class="auth-btn auth-btn-other" id="btn-log">Login</button> |
||||
</div> |
||||
<div class="errors"></div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,23 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<div class="auth-container"> |
||||
<div class="auth"> |
||||
<p class="auth-title">New Agent</p> |
||||
<input type="text" placeholder="Name" class="base-input" id="in-name"> |
||||
<select class="base-select" id="in-faction"> |
||||
<option value="" disabled selected>Factions</option> |
||||
<optgroup id="group-faction"></optgroup> |
||||
</select> |
||||
<div class="auth-grp-label"> |
||||
<p>Remember me ?</p> |
||||
<input type="checkbox" class="base-input" id="in-remember"> |
||||
</div> |
||||
<div> |
||||
<button class="base-btn" id="btn-register">Validate</button> |
||||
<button class="base-btn" id="btn-cancel">Cancel</button> |
||||
</div> |
||||
<div> |
||||
<button class="base-btn" id="btn-log">Login</button> |
||||
</div> |
||||
<div class="errors"></div> |
||||
</div> |
||||
</div> |
@ -1,4 +1,6 @@ |
||||
<link rel="stylesheet" href="css/global.css"> |
||||
<p class="Title">CONTRACTS</p> |
||||
<div class="contract-screen"> |
||||
<div class="contracts"></div> |
||||
</div> |
||||
<img class="screen-img" src="/assets/contracts/screen.png"> |
||||
<div class="contracts"> |
||||
</div> |
||||
</div> |
||||
|
@ -1,5 +1,6 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<div class="container smooth"> |
||||
<p class="con-title">Bienvenue sur SkamCraft</p> |
||||
<p class="con-content">Application client pour l'API Space Tarders.</p> |
||||
</div> |
||||
<p class="Title">HOME</p> |
||||
<div class="home-container"> |
||||
<h1>WELCOME TO</h1> |
||||
<img src="/assets/logo/spacetradertitle.png" alt="" width="60%"> |
||||
<p>Skamkraft is based on the SpaceTraders API</p> |
||||
</div> |
||||
|
@ -0,0 +1,21 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<p class="Title">LEADERBOARD</p> |
||||
<video autoplay muted loop id="myVideo"> |
||||
<source src="/assets/leaderboard/trophee.mp4" type="video/mp4"> |
||||
</video> |
||||
<div class="cont-center"> |
||||
<div class="container-ldb"> |
||||
<div class="head-board"> |
||||
<p class="num">Rank</p> |
||||
<p class="symbol">Name</p> |
||||
<p class="credits">Credits</p> |
||||
<p class="headquarters">Headquarters</p> |
||||
<p class="faction">Faction</p> |
||||
<p class="ships">Ships</p> |
||||
</div> |
||||
<div class="leaderboard"></div> |
||||
<div> |
||||
<!--- leaderboard content --> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,24 @@ |
||||
<div class="cont-profile"> |
||||
<div id="profile"> |
||||
<div class="profile-header"> |
||||
<p class="">PROFILE</p> |
||||
</div> |
||||
<video autoplay muted loop id="myVideo"> |
||||
<source src="/assets/profile/background.mp4" type="video/mp4"> |
||||
</video> |
||||
<div class="profile-content"> |
||||
<p class="tb-r">Name</p><p id="name"></p> |
||||
<p class="tb-r">Faction</p><p id="faction"></p> |
||||
<p class="tb-r">Credits</p><p id="credit"></p> |
||||
<p class="tb-r">Head Quaters</p><p id="hq"></p> |
||||
<p class="tb-r">Number of ships</p><p id="shipcount"></p> |
||||
</div> |
||||
|
||||
<div class="profile-footer"> |
||||
<button id="btn-logout"> |
||||
<img src="/assets/menu/logout.png" alt=""> |
||||
</button> |
||||
<button id="btn-token">COPY TOKEN</button> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -1,17 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
<link rel="stylesheet" href="css/ship.css"> |
||||
|
||||
|
||||
<title>Ship</title> |
||||
</head> |
||||
<body class="test"> |
||||
<div class="block-ships"> |
||||
<a class="prev">❮</a> |
||||
<a class="next">❯</a> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -1,9 +0,0 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<div class="my-modal"> |
||||
<div class="infos"> |
||||
|
||||
</div> |
||||
<div> |
||||
<button class="btn btn-val btn-close">Close</button> |
||||
</div> |
||||
</div> |
@ -0,0 +1,7 @@ |
||||
<p class="Title">SHIPS</p> |
||||
<div class="cont-center"> |
||||
<div class="block-ships"> |
||||
<button class="prev"><</a> |
||||
<button class="next">></a> |
||||
</div> |
||||
</div> |
@ -0,0 +1,9 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<div class="modal-ships"> |
||||
<div class="infos-ships"> |
||||
|
||||
</div> |
||||
<div> |
||||
<button class="btn btn-val btn-close-ships">Close</button> |
||||
</div> |
||||
</div> |
@ -0,0 +1,3 @@ |
||||
<div class="cont-canvas"> |
||||
<canvas id="sys-canvas"></canvas> |
||||
</div> |
@ -1,4 +0,0 @@ |
||||
<!-- Copyright © 2023 Entreprise SkamKraft --> |
||||
<div class="max-container smooth" id="canvas-container"> |
||||
<canvas id="canvas"></canvas> |
||||
</div> |
@ -1,18 +1,9 @@ |
||||
import { AgentBuilder, My } from "../skama_code/api/agent.js"; |
||||
import { Auth } from "../skama_code/auth/auth.js"; |
||||
import menu_mod from "./menu_mod.js"; |
||||
|
||||
export default function home(temp_engine) { |
||||
//Auto login
|
||||
const auth = new Auth(); |
||||
|
||||
if (auth.relog()) { |
||||
AgentBuilder.get(localStorage.getItem("token"), (agent) => { |
||||
My.agent = agent; |
||||
menu_mod(temp_engine); |
||||
}); |
||||
} |
||||
|
||||
temp_engine.after_render(menu_mod); |
||||
temp_engine.after_render(() => { |
||||
$("body").css("background-image", "url('/assets/img/background.png')") |
||||
menu_mod(temp_engine, null); |
||||
}); |
||||
temp_engine.render("templates/home.html"); |
||||
} |
||||
|
@ -0,0 +1,51 @@ |
||||
import menu_mod from "./menu_mod.js"; |
||||
import { AgentBuilder } from "../skama_code/api/agent.js"; |
||||
|
||||
export default function ldb(temp_engine) { |
||||
temp_engine.after_render((temp_engine) => { |
||||
$("body").css("background-image", "url('/assets/img/background.png')") |
||||
let bagents = new AgentBuilder(); |
||||
menu_mod(temp_engine, bagents); |
||||
bagents.list_all((agents) => { |
||||
drawAgents(agents, sortAgentByCredits); |
||||
}); |
||||
}); |
||||
|
||||
temp_engine.render("templates/leaderboard/leaderboard.html"); |
||||
} |
||||
|
||||
function drawAgents(agents, funcSort) { |
||||
$(".leaderboard").html(""); |
||||
agents.sort(funcSort); |
||||
agents.reverse(); |
||||
let i = 1; |
||||
agents.forEach((agent) => { |
||||
$(".leaderboard").append(` |
||||
<article class="player"> |
||||
<p class="elem num">${i}.</p> |
||||
<p class="elem symbol">${agent.name}</p> |
||||
<p class="elem credits">${agent.credits}</p> |
||||
<p class="elem headquarters">${agent.hq}</p> |
||||
<p class="elem faction">${agent.faction}</p> |
||||
<p class="elem ships">${agent.ships_cpt}</p> |
||||
</article> |
||||
`);
|
||||
i++ |
||||
}); |
||||
} |
||||
|
||||
function sortAgentByCredits(a1, a2) { |
||||
if (a1.credits < a2.credits) |
||||
return -1 |
||||
if (a1.credits > a2.credits) |
||||
return 1 |
||||
return 0 |
||||
} |
||||
|
||||
function sortAgentByShips(a1, a2) { |
||||
if (a1.shipCount < a2.shipCount) |
||||
return -1 |
||||
if (a1.shipCount > a2.shipCount) |
||||
return 1 |
||||
return 0 |
||||
} |
@ -1,43 +1,44 @@ |
||||
import { Auth } from "../skama_code/auth/auth.js"; |
||||
import { My } from "../skama_code/api/agent.js"; |
||||
import { My } from "../skama_code/commun/my.js"; |
||||
import home from "./home.js"; |
||||
import menu_mod from "./menu_mod.js"; |
||||
import reg from "./reg.js" |
||||
import register from "./register.js"; |
||||
|
||||
export default function login(temp_engine) { |
||||
const auth = new Auth(); |
||||
|
||||
temp_engine.after_render((temp_engine) => { |
||||
menu_mod(temp_engine); |
||||
|
||||
temp_engine.add_event("#btn-login", "click", () => { |
||||
const is_checked = $("#in-remember").is(":checked"); |
||||
const token = $("#in-token").val(); |
||||
auth.store = is_checked; |
||||
auth.login(token) |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-cancel", "click", () => { |
||||
$("#in-token").val(""); |
||||
$("#in-remember").prop("checked", false); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-reg", "click", () => { |
||||
reg(temp_engine); |
||||
}); |
||||
}); |
||||
const auth = new Auth(); |
||||
|
||||
auth.done((agent) => { |
||||
My.agent = agent; |
||||
home(temp_engine); |
||||
}) |
||||
temp_engine.after_render((temp_engine) => { |
||||
$("body").css("background-image", "url('/assets/img/background.png')") |
||||
menu_mod(temp_engine, null); |
||||
|
||||
auth.fail((errors) => { |
||||
$(".errors").html(""); |
||||
errors.forEach(error => { |
||||
$(".errors").append(`<p>${error}</p>`); |
||||
}); |
||||
}) |
||||
temp_engine.add_event("#btn-login", "click", () => { |
||||
const is_checked = $("#in-remember").is(":checked"); |
||||
const token = $("#in-token").val(); |
||||
auth.store = is_checked; |
||||
auth.login(token); |
||||
}); |
||||
|
||||
temp_engine.render(`templates/auth/login.html`); |
||||
} |
||||
temp_engine.add_event("#btn-cancel", "click", () => { |
||||
$("#in-token").val(""); |
||||
$("#in-remember").prop("checked", false); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-register", "click", () => { |
||||
register(temp_engine); |
||||
}); |
||||
}); |
||||
|
||||
auth.done((agent) => { |
||||
My.agent = agent; |
||||
home(temp_engine); |
||||
}); |
||||
|
||||
auth.fail((errors) => { |
||||
$(".errors").html(""); |
||||
errors.forEach((error) => { |
||||
$(".errors").append(`<p>${error}</p>`); |
||||
});
|
||||
}); |
||||
|
||||
temp_engine.render("templates/auth/login.html"); |
||||
} |
||||
|
@ -1,56 +1,52 @@ |
||||
import { My } from "../skama_code/api/agent.js"; |
||||
import { My } from "../skama_code/commun/my.js"; |
||||
import home from "./home.js"; |
||||
import login from "./login.js"; |
||||
import reg from "./reg.js"; |
||||
import systems from "./systems.js"; |
||||
import contract from "./contracts.js"; |
||||
|
||||
function init_menu(temp_engine) { |
||||
temp_engine.add_event("#reg-link", "click", () => { |
||||
reg(temp_engine); |
||||
}); |
||||
temp_engine.add_event("#login-link", "click", () => { |
||||
login(temp_engine); |
||||
}); |
||||
temp_engine.add_event("#systems-link", "click", () => { |
||||
systems(temp_engine); |
||||
}); |
||||
import profile from "./profile.js"; |
||||
import contracts from "./contracts.js"; |
||||
import ships from "./ships.js"; |
||||
import leaderboard from "./leaderboard.js"; |
||||
import system from "./system.js"; |
||||
|
||||
function loged_links(temp_engine, lister) { |
||||
$("#links").html(` |
||||
<input type="image" alt="home" id="home-link" src="/assets/menu/home.png"/> |
||||
<input type="image" alt="systems" id="systems-link" src="/assets/menu/systems.png"/> |
||||
<input type="image" alt="contracts" id="contracts-link" src="/assets/menu/contracts.png"/> |
||||
<input type="image" alt="ships" id="ships-link" src="/assets/menu/ships.png"/> |
||||
<input type="image" alt="profile" id="profile-link" src="/assets/menu/info.png"/> |
||||
<input type="image" alt="leaderboard" id="leaderboard-link" src="/assets/menu/leaderboard.png"/> |
||||
`);
|
||||
|
||||
temp_engine.add_event("#home-link", "click", () => { |
||||
if(lister) lister.stop(); |
||||
home(temp_engine); |
||||
}); |
||||
temp_engine.add_event("#logout-link", "click", () => { |
||||
My.agent = null; |
||||
localStorage.removeItem("token"); |
||||
login(temp_engine); |
||||
|
||||
temp_engine.add_event("#profile-link", "click", () => { |
||||
if(lister) lister.stop(); |
||||
profile(temp_engine); |
||||
}); |
||||
|
||||
temp_engine.add_event("#contracts-link", "click", () => { |
||||
contract(temp_engine); |
||||
}) |
||||
} |
||||
if(lister) lister.stop(); |
||||
contracts(temp_engine); |
||||
}); |
||||
|
||||
function loged_links() { |
||||
$("#links").html(` |
||||
<input type="image" alt="home" id="systems-link" src="/assets/menu/home.png"/> |
||||
<input type="image" alt="contracts" id="contracts-link" src="/assets/menu/contracts.png"/> |
||||
<input type="image" alt="ships" id="ships-link" src="/assets/menu/ships.png"/> |
||||
<input type="image" alt="info" src="/assets/menu/info.png"/> |
||||
<input type="image" alt="leaderboard" src="/assets/menu/leaderboard.png"/> |
||||
`);
|
||||
} |
||||
temp_engine.add_event("#ships-link", "click", () => { |
||||
if(lister) lister.stop(); |
||||
ships(temp_engine); |
||||
}); |
||||
|
||||
temp_engine.add_event("#leaderboard-link", "click", () => { |
||||
if(lister) lister.stop(); |
||||
leaderboard(temp_engine); |
||||
}); |
||||
|
||||
function unloged_links() { |
||||
// $(".menu-links").html(`
|
||||
// <li class="nav-link smooth" id="login-link">Log in</li>
|
||||
// <li class="nav-link smooth" id="reg-link">New Agent</li>
|
||||
// `);
|
||||
temp_engine.add_event("#systems-link", "click", () => { |
||||
if(lister) lister.stop(); |
||||
system(temp_engine, My.agent.get_agent_system()); |
||||
}); |
||||
} |
||||
|
||||
export default function menu_mod(temp_engine) { |
||||
init_menu(temp_engine); |
||||
if (My.agent) { |
||||
show_stats(); |
||||
loged_links(); |
||||
} else { |
||||
unloged_links(); |
||||
} |
||||
export default (temp_engine, lister) => { |
||||
if(My.agent) loged_links(temp_engine, lister); |
||||
} |
||||
|
@ -0,0 +1,30 @@ |
||||
import menu_mod from "./menu_mod.js"; |
||||
import { Auth } from "../skama_code/auth/auth.js" |
||||
import { My } from "../skama_code/commun/my.js" |
||||
import login from "./login.js"; |
||||
|
||||
export default function profile(temp_engine) { |
||||
temp_engine.after_render(() => { |
||||
$("body").css("background-image", "url('/assets/profile/background.png')") |
||||
$('#name').append(My.agent.name); |
||||
$('#faction').append(My.agent.faction); |
||||
$('#credit').append(My.agent.credits); |
||||
$('#hq').append(My.agent.hq); |
||||
$('#shipcount').append(My.agent.ships_cpt); |
||||
|
||||
temp_engine.add_event('#btn-token', 'click', () => { |
||||
navigator.clipboard.writeText(My.agent.token); |
||||
alert('Token copied !'); |
||||
}); |
||||
|
||||
temp_engine.add_event('#btn-logout', 'click', () => { |
||||
const auth = new Auth(); |
||||
auth.unload_token(); |
||||
My.agent = null; |
||||
login(temp_engine); |
||||
}); |
||||
|
||||
menu_mod(temp_engine, null); |
||||
}); |
||||
temp_engine.render("/templates/profile/profile.html"); |
||||
} |
@ -1,58 +0,0 @@ |
||||
import { Auth } from "../skama_code/auth/auth.js"; |
||||
import { My } from "../skama_code/api/agent.js"; |
||||
import { Faction } from "../skama_code/api/faction.js"; |
||||
import home from "./home.js"; |
||||
import login from "./login.js"; |
||||
import menu_mod from "./menu_mod.js"; |
||||
|
||||
export default function reg(temp_engine) { |
||||
let auth = new Auth(); |
||||
|
||||
temp_engine.after_render((temp_engine) => { |
||||
menu_mod(temp_engine); |
||||
|
||||
Faction.list_all((factions) => { |
||||
factions.forEach((faction) => { |
||||
let option; |
||||
if (faction.isRecruting) { |
||||
option = `<option>${faction.symbol}</option>`; |
||||
} else { |
||||
option = `<option disabled>${faction.symbol}</option>`; |
||||
} |
||||
|
||||
$("#group-faction").append(option); |
||||
}); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-register", "click", () => { |
||||
const is_checked = $("#in-remember").is(":checked"); |
||||
const symbol = $("#in-name").val(); |
||||
const faction = $("#in-faction").val(); |
||||
auth.store = is_checked; |
||||
auth.register({ name: symbol, faction: faction }); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-cancel", "click", () => { |
||||
$("#in-name").val(""); |
||||
$("#in-remember").prop("checked", false); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-log", "click", () => { |
||||
login(temp_engine); |
||||
}); |
||||
}); |
||||
|
||||
auth.done((agent) => { |
||||
My.agent = agent; |
||||
home(temp_engine); |
||||
}); |
||||
|
||||
auth.fail((errors) => { |
||||
$(".errors").html(""); |
||||
errors.forEach((error) => { |
||||
$(".errors").append(`<p>${error}</p>`); |
||||
}); |
||||
}); |
||||
|
||||
temp_engine.render(`templates/auth/reg.html`); |
||||
} |
@ -0,0 +1,59 @@ |
||||
import { Auth } from "../skama_code/auth/auth.js"; |
||||
import { My } from "../skama_code/commun/my.js"; |
||||
import { Faction } from "../skama_code/api/faction.js"; |
||||
import home from "./home.js"; |
||||
import login from "./login.js"; |
||||
import menu_mod from "./menu_mod.js"; |
||||
|
||||
export default function register(temp_engine) { |
||||
let auth = new Auth(); |
||||
|
||||
temp_engine.after_render((temp_engine) => { |
||||
$("body").css("background-image", "url('/assets/img/background.png')") |
||||
menu_mod(temp_engine, null); |
||||
|
||||
Faction.list_all((factions) => { |
||||
factions.forEach((faction) => { |
||||
let option; |
||||
if (faction.isRecruiting) { |
||||
option = `<option>${faction.symbol}</option>`; |
||||
} else { |
||||
option = `<option disabled>${faction.symbol}</option>`; |
||||
} |
||||
|
||||
$("#group-faction").append(option); |
||||
}); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-register", "click", () => { |
||||
const is_checked = $("#in-remember").is(":checked"); |
||||
const symbol = $("#in-name").val(); |
||||
const faction = $("#in-faction").val(); |
||||
auth.store = is_checked; |
||||
auth.register({ name: symbol, faction: faction }); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-cancel", "click", () => { |
||||
$("#in-name").val(""); |
||||
$("#in-remember").prop("checked", false); |
||||
}); |
||||
|
||||
temp_engine.add_event("#btn-log", "click", () => { |
||||
login(temp_engine); |
||||
}); |
||||
}); |
||||
|
||||
auth.done((agent) => { |
||||
My.agent = agent; |
||||
home(temp_engine); |
||||
}); |
||||
|
||||
auth.fail((errors) => { |
||||
$(".errors").html(""); |
||||
errors.forEach((error) => { |
||||
$(".errors").append(`<p>${error}</p>`); |
||||
}); |
||||
}); |
||||
|
||||
temp_engine.render(`templates/auth/register.html`); |
||||
} |
@ -0,0 +1,103 @@ |
||||
import menu_mod from "./menu_mod.js"; |
||||
import home from "./home.js"; |
||||
import { CanvasRenderer } from "../skama_code/ui/canvas_render.js"; |
||||
import { SystemBuilder } from "../skama_code/api/system.js" |
||||
import { Position } from "../skama_code/commun/position.js"; |
||||
|
||||
|
||||
function get_img_from_type(planet) |
||||
{ |
||||
switch(planet.type) |
||||
{ |
||||
case "PLANET": |
||||
return ["PLANET.png"]; |
||||
case "GAS_GIANT":
|
||||
return ["GAS_GIANT.png"]; |
||||
case "MOON": |
||||
return ["MOON.png"]; |
||||
case "ORBITAL_STATION": |
||||
return ["ORBITAL_STATION.png"]; |
||||
case "JUMP_GATE": |
||||
return ["jumpgate.png"]; |
||||
case "ASTEROID_FIELD": |
||||
return ["ASTEROID_FIELD.png"]; |
||||
case "ASTEROID": |
||||
return ["asteroid1.png", "asteroid2.png", "asteroid3.png", "asteroid4.png"]; |
||||
case "ENGINEERED_ASTEROID": |
||||
return ["ENGINEERED_ASTEROID.png"]; |
||||
case "ASTEROID_BASE": |
||||
return ["ASTEROID_BASE.png"]; |
||||
case "NEBULA": |
||||
return []; |
||||
case "DEBRIS_FIELD": |
||||
return []; |
||||
case "GRAVITY_WELL": |
||||
return ["GRAVITY_WELL.png"]; |
||||
case "ARTIFICIAL_GRAVITY_WELL": |
||||
return ["ARTIFICAL_GRAVITY_WELL.png"]; |
||||
case "FUEL_STATION": |
||||
return ["FUEL_STATION.png"]; |
||||
case _: |
||||
return []; |
||||
} |
||||
} |
||||
|
||||
export default function system(temp_engine, sys_name) { |
||||
temp_engine.after_render(() => { |
||||
$("body").css("background-image", "url('/assets/planets/backgroundcanvas.png')") |
||||
let canvas = new CanvasRenderer("sys-canvas", 1200, 700); |
||||
canvas.resize(window.innerWidth, window.innerHeight); |
||||
SystemBuilder.get(sys_name, (system) => { |
||||
system.list_all_planets((planets) => { |
||||
canvas.clean(); |
||||
console.log(planets) |
||||
planets.forEach((planet) => { |
||||
let urls = get_img_from_type(planet); |
||||
if(urls.length) |
||||
{ |
||||
let url = urls[Math.floor(Math.random() * urls.length)]; |
||||
console.log(url) |
||||
canvas.obj_from_img("assets/planets/" + url, canvas.canvas_pos(planet.position), { |
||||
selectable: false, |
||||
name: planet.name, |
||||
update: null, |
||||
}); |
||||
} |
||||
}); |
||||
}); |
||||
canvas.zoom(new Position(0, 0), 0.5); |
||||
let zoom = 0; |
||||
canvas.on("mouse:wheel", (opt) => { |
||||
if (opt.e.deltaY < 0 && zoom < 30) |
||||
{ |
||||
zoom += 1; |
||||
canvas.zoom(canvas.rel_pos(new Position(opt.e.clientX, opt.e.clientY)), 1.1) |
||||
canvas.offset(new Position(2, 2)) |
||||
} else if (opt.e.deltaY > 0 && zoom > -5) { |
||||
zoom -= 1; |
||||
canvas.zoom(canvas.rel_pos(new Position(opt.e.clientX, opt.e.clientY)), 0.9090) |
||||
canvas.offset(new Position(0.5, 0.5)) |
||||
} |
||||
}); |
||||
|
||||
canvas.on("mouse:over", (e) => { |
||||
e.target.shadow.blur = 100; |
||||
}); |
||||
|
||||
|
||||
canvas.on("mouse:out", (e) => { |
||||
e.target.shadow.blur = 1; |
||||
}); |
||||
|
||||
$(window).on("resize", () => { |
||||
canvas.resize(window.innerWidth, window.innerHeight); |
||||
}); |
||||
|
||||
canvas.start(); |
||||
menu_mod(temp_engine, system); |
||||
}, (err) => { |
||||
home(temp_engine); |
||||
}); |
||||
}); |
||||
temp_engine.render("templates/system/system.html"); |
||||
} |
@ -1,43 +0,0 @@ |
||||
import { CanvasRenderer } from "../skama_code/ui/canvas_render.js"; |
||||
import menu_mod from "./menu_mod.js"; |
||||
import { My } from "../skama_code/api/agent.js"; |
||||
import { SystemBuilder } from "../skama_code/api/system.js"; |
||||
|
||||
export default (temp_engine) => { |
||||
temp_engine.after_render((temp_engine) => { |
||||
menu_mod(temp_engine); |
||||
//create canvas
|
||||
const size = getSize(); |
||||
const canvas = new CanvasRenderer("canvas", size.width, size.height); |
||||
|
||||
//auto resize canvas
|
||||
window.addEventListener("resize", () => { |
||||
const size = getSize(); |
||||
canvas.resize(size.width, size.height); |
||||
}); |
||||
|
||||
//display planets
|
||||
SystemBuilder.get(getAgentSystem(), (system) => { |
||||
system.list_all_planets((planets) => { |
||||
planets.forEach(planet => { |
||||
canvas.obj_from_img('../../assets/planets/planetproto.png', planet.position); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
|
||||
temp_engine.render("templates/systems/systems.html"); |
||||
}; |
||||
|
||||
function getSize() { |
||||
return { |
||||
width: $("#canvas-container").width(), |
||||
height: window.innerHeight, |
||||
}; |
||||
} |
||||
|
||||
function getAgentSystem(){ |
||||
const hq = My.agent.hq; |
||||
const systemName = hq.split('-'); |
||||
return systemName[0] + '-' + systemName[1]; |
||||
} |
@ -1,9 +1,26 @@ |
||||
// Copyright © 2023 Entreprise SkamKraft
|
||||
'use strict'; |
||||
"use strict"; |
||||
import { TemplateEngine } from "./skama_code/ui/templeting_engine.js"; |
||||
import login from "./controllers/login.js"; |
||||
import register from "./controllers/register.js"; |
||||
import { Auth } from "./skama_code/auth/auth.js"; |
||||
import { AgentBuilder } from "./skama_code/api/agent.js"; |
||||
import { My } from "./skama_code/commun/my.js"; |
||||
import home from "./controllers/home.js"; |
||||
|
||||
let temp_engine = new TemplateEngine("html"); |
||||
login(temp_engine); |
||||
|
||||
|
||||
//Auth
|
||||
const auth = new Auth; |
||||
if(auth.relog()) |
||||
{ |
||||
AgentBuilder.get(localStorage.getItem('token'), (agent) => { |
||||
My.agent = agent; |
||||
home(temp_engine); |
||||
}, (err) => { |
||||
register(temp_engine); |
||||
}); |
||||
} |
||||
else
|
||||
{ |
||||
register(temp_engine); |
||||
} |
||||
|
@ -1 +0,0 @@ |
||||
Subproject commit 1e036220813ade9e4114fa6723a3ec90db0c4c31 |
@ -1,105 +0,0 @@ |
||||
// Copyright © 2023 Entreprise SkamKraft
|
||||
'use strict'; |
||||
|
||||
import { Timer } from "../skama_code/ui/timer.js"; |
||||
import { Modal } from "../skama_code/ui/modal.js"; |
||||
import { TemplateEngine } from "../skama_code/ui/templeting_engine.js"; |
||||
import { Initialzer } from "../skama_code/commun/initialzer.js "; |
||||
import { AgentBuilder } from "../skama_code/api/agent.js"; |
||||
import { Auth } from "../skama_code/auth/auth.js"; |
||||
import { PlanetBuilder } from "../skama_code/api/planet.js"; |
||||
|
||||
let temp_path = "html"; |
||||
let token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZGVudGlmaWVyIjoiSEFSRElDSyIsInZlcnNpb24iOiJ2Mi4xLjQiLCJyZXNldF9kYXRlIjoiMjAyMy0xMi0wMiIsImlhdCI6MTcwMjY2Mjc2Mywic3ViIjoiYWdlbnQtdG9rZW4ifQ.PrvaOz3W79acq6RoxryMW53PRRz824_AM0VGLwfXCOsGCOCAIY-rn6-bZTOnLAtp4xPSDqEk4c38oWYAWW59p0iMDDLpur6ONnjT0RjjsQS9zr5BByfBpP36CT23IZSSzk3XxGrFolHJAyU3K1liYfNbsPuNTXlkHGNHq6yMqH4ZQUPFsXEsCkg9cUynkdLw3C39SvWhtJ89oblj_8tQp2k8dxhZemepuXtiI51eFMpv8A0WRAi7pVYo_ajJujY9QDLYn_m5hDZWTlQMIstjPaDl99p2IMweIMO2Q2G-0lKiWQ4sl6VW5tuVrz1HLYU6kyMjFQWNn6kFDE7LWMTrfw"; |
||||
|
||||
let tests = { |
||||
timer: function() { |
||||
let timer = new Timer(1, 0.1666, "m"); |
||||
timer.on("step", (time) => { |
||||
console.log(time); |
||||
}) |
||||
timer.on("end", () => { |
||||
console.log("pattes fini"); |
||||
}); |
||||
timer.start(); |
||||
}, |
||||
render_template: function() { |
||||
let UI = new TemplateEngine(temp_path); |
||||
let initer = new Initialzer(UI); |
||||
|
||||
UI.render("templates/home.html"); |
||||
UI.frag_load("#test", "templates/login.html"); |
||||
|
||||
$(document).ready(() => { |
||||
initer.init_menu_link("#contracts-link", "contracts.html"); |
||||
initer.init_menu_link("#ships-link", "ships.html"); |
||||
initer.init_menu_link("#systems-link", "systems.html"); |
||||
initer.init_menu_link("#signup-link", "register.html"); |
||||
initer.init_menu_link("#signin-link", "login.html"); |
||||
initer.init_menu_link(".nav-brand", "home.html"); |
||||
}); |
||||
}, |
||||
authentication: function() { |
||||
let auth = new Auth(true); |
||||
auth.done((agent) => { |
||||
console.log(agent); |
||||
}).fail((errs) => { |
||||
errs.forEach(err => { |
||||
console.log(err); |
||||
}); |
||||
}); |
||||
auth.login(token); |
||||
auth.relog(); |
||||
|
||||
//auth.register({
|
||||
// symbol: "lkdsjfsjdlfjlk",
|
||||
// faction: "COSMIC"
|
||||
//});
|
||||
}, |
||||
modal: function() { |
||||
|
||||
let template_engine = new TemplateEngine(temp_path); |
||||
|
||||
let timer = new Timer(60, 1, "s"); |
||||
timer.on("step", (time) => { |
||||
$("#timer").html(` |
||||
<p>${time}</p> |
||||
`);
|
||||
}); |
||||
template_engine.render("templates/login.html"); |
||||
|
||||
let modal = new Modal("test-modal", template_engine); |
||||
modal.add_class("ext-modal") |
||||
|
||||
modal.load("templates/test_modal.html"); |
||||
|
||||
template_engine.add_event("#valid", "click", () => { |
||||
modal.show(); |
||||
timer.start(); |
||||
}); |
||||
|
||||
template_engine.add_event("#ok", "click", () => { |
||||
modal.close(); |
||||
timer.stop(); |
||||
}); |
||||
}, |
||||
get_planet: function() { |
||||
PlanetBuilder.get("X1-TT23-FF1E", (planet) => { |
||||
console.log(planet); |
||||
}, (err) => { |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
get_all_planets: function() { |
||||
PlanetBuilder.list_all("X1-AG10", (planets) => { |
||||
console.log(planets); |
||||
}); |
||||
}, |
||||
get_all_agents: function() { |
||||
AgentBuilder.list_all((agents) => { |
||||
console.log(agents); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
export default tests; |