Skip to content

Commit 482abf1

Browse files
feat(version): v1.0.1 - add room public
1 parent 7c116bd commit 482abf1

File tree

12 files changed

+188
-218
lines changed

12 files changed

+188
-218
lines changed

server/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ io.on("connection", (socket: Socket) => {
7373
* Handles player joining or creating a room.
7474
* @param data - The data for creating or joining a room.
7575
*/
76-
socket.on("room", ({ room_code, room_time, room_player }: RoomData) => {
76+
socket.on("room", ({ room_public, room_code, room_time, room_player }: RoomData) => {
7777
if (!room_code) {
7878
room_code = generateCode();
7979
ROOMS[room_code] = {
8080
code: room_code,
8181
date: new Date(),
8282
players: [],
8383
owner: room_player,
84+
public: room_public,
8485
time: room_time || 11,
8586
state: "waiting",
8687
};

www/index.html

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919
<meta property="og:site_name" content="Cookie Clicker Brasil">
2020
<meta property="og:title" content="Cookie Clicker Brasil">
2121
<meta property="og:description" content="Cookie Clicker Brasil - Não confie em ímpar ou par, ou cara ou coroa!">
22-
<meta property="og:image" content="https://i.imgur.com/EOzKknx.webp">
22+
<meta property="og:image" content="favicon.ico">
2323
<meta property="og:url" content="https://cookie-clicker-brasil.vercel.app">
2424
<meta property="og:locale" content="pt_BR">
2525
<meta property="og:type" content="website">
2626
<meta property="og:title" lang="en" content="Cookie Clicker Brazil - Addictive Game of Clicking to Earn Cookies">
2727
<meta property="og:description" lang="en" content="Cookie Clicker Brazil - Don’t rely on ODD or EVEN, or HEADS or TAILS!">
28-
<meta property="og:image" lang="en" content="https://i.imgur.com/EOzKknx.webp">
28+
<meta property="og:image" lang="en" content="favicon.ico">
2929
<meta property="og:url" lang="en" content="https://cookie-clicker-brasil.vercel.app/en">
3030
<meta property="og:locale" lang="en" content="en_US">
3131
<meta property="og:type" lang="en" content="website">
3232
<meta property="og:title" lang="es" content="Cookie Clicker Brasil - Juego Adictivo de Hacer Clic para Ganar Galletas">
3333
<meta property="og:description" lang="es" content="Cookie Clicker Brasil - ¡No confíes en IMPAR o PAR, ni en CARA o CRUZ!">
34-
<meta property="og:image" lang="es" content="https://i.imgur.com/EOzKknx.webp">
34+
<meta property="og:image" lang="es" content="favicon.ico">
3535
<meta property="og:url" lang="es" content="https://cookie-clicker-brasil.vercel.app">
3636
<meta property="og:locale" lang="es" content="es_ES">
3737
<meta property="og:type" lang="es" content="website">
3838
<meta name="google-adsense-account" content="ca-pub-6690516270288705">
3939
<link rel="canonical" href="https://cookie-clicker-brasil.vercel.app">
40-
<link rel="apple-touch-icon" href="https://i.imgur.com/EOzKknx.webp" />
41-
<link rel="shortcut icon" href="https://i.imgur.com/EOzKknx.webp" type="image/webp">
40+
<link rel="apple-touch-icon" href="favicon.ico" />
41+
<link rel="shortcut icon" href="favicon.ico" type="image/webp">
4242
<script src="https://cdnjs.cloudflare.com/ajax/libs/eruda/3.4.1/eruda.min.js" integrity="sha512-3RVqOZtMevFOLeXCp0/Wl7np/l3J3MMysaFDUhNh+hdKx+Wb0lMXuHwA6CZ/+4DfYZM01Om1as8g+mnTaQH9vA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
4343
<script type="text/javascript" charset="utf-8">
4444
if (new URLSearchParams(window.location.search).get('debug') === 'true') {
@@ -55,7 +55,7 @@
5555
</div>
5656

5757
<div id="splash-screen">
58-
<img src="https://i.imgur.com/EOzKknx.webp" alt="splash-screen" class="icon mb-5">
58+
<img src="favicon.ico" alt="splash-screen" class="icon mb-5">
5959
<h1><i18next i18next-id="splashScreen.splashClick">Click...</i18next></h1>
6060
</div>
6161

@@ -181,7 +181,7 @@ <h5 class="modal-title" id="room_modalLabel">
181181
<i18next i18next-id="game.gameOptionLabel">Choose an option:</i18next>
182182
</label>
183183
<div>
184-
<div class="form-check">
184+
<div class="form-check">
185185
<input class="form-check-input" type="radio" name="option_game" id="randomRoom" value="random" disabled>
186186
<label class="form-check-label" for="randomRoom">
187187
<i class="fas fa-random"></i>
@@ -196,6 +196,9 @@ <h5 class="modal-title" id="room_modalLabel">
196196
<i18next i18next-id="game.createRoom">Create a room</i18next>
197197
</label>
198198
</div>
199+
200+
201+
199202
<div class="form-check">
200203
<input class="form-check-input" type="radio" name="option_game" id="room_join" value="join">
201204
<label class="form-check-label" for="room_join">
@@ -214,21 +217,37 @@ <h5 class="modal-title" id="room_modalLabel">
214217
<input type="text" class="form-control" id="room_code" name="room_code" placeholder="XN4ZXP">
215218
</div>
216219

217-
<div class="mb-3" id="game_container">
218-
<label for="gameTime" class="form-label">
219-
<i class="fas fa-clock"></i>
220-
<i18next i18next-id="game.gameTimeLabel">Game Time (in seconds)</i18next>
221-
</label>
222-
<input type="number" class="form-control" id="room_time" name="gameTime" placeholder="e.g. 11">
223-
</div>
220+
221+
<div id="game_container">
222+
223+
<div class="mb-3">
224+
<label for="gameTime" class="form-label">
225+
<i class="fas fa-clock"></i>
226+
<i18next i18next-id="game.gameTimeLabel">Game Time</i18next>
227+
</label>
228+
<input type="number" class="form-control" id="room_time" name="gameTime" placeholder="e.g. 11">
229+
</div>
230+
231+
<div class="mb-3">
232+
<label for="publicRoom" class="form-label">
233+
<i class="fas fa-users"></i>
234+
<i18next i18next-id="game.publicRoomLabel">Public Room</i18next>
235+
</label>
236+
<input type="checkbox" class="form-check-input me-2" id="room_public" name="room_public">
237+
</div>
238+
239+
240+
</div>
241+
242+
224243
</form>
225244
</div>
226245
<div class="modal-footer">
227-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
246+
<button type="button" class="close" data-bs-dismiss="modal">
228247
<i class="fas fa-times"></i>
229248
<i18next i18next-id="modal.cancel">Cancel</i18next>
230249
</button>
231-
<button id="form_button" class="btn btn-primary">
250+
<button id="form_button" class="confirm">
232251
<i class="fas fa-check"></i>
233252
<i18next i18next-id="modal.confirm">Confirm</i18next>
234253
</button>

www/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import "@language/main.ts";
2-
import "@scss/ui.scss";
32
import "@plugin/admob.ts";
3+
import "@scss/ui.scss";
4+
import "@scss/modal.scss";
45
import "@ts/main.ts";
56
import "@ts/game.ts";
67
import "bootstrap/dist/css/bootstrap.min.css";

www/public/favicon.ico

871 KB
Binary file not shown.

www/src/locales/lang/en-US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const translation = {
2626
nicknameLabel: "Nickname",
2727
gameOptionLabel: "Choose an option:",
2828
randomRoom: "Join a random room",
29+
publicRoomLabel: "Public room:",
2930
createRoom: "Create a room",
3031
joinRoom: "Join a room",
3132
roomCodeLabel: "Room Code",

www/src/locales/lang/es-ES.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

www/src/locales/lang/pt-BR.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ const translation = {
2323
leaveButton: "Sair",
2424
},
2525
game: {
26-
nicknameLabel: "Apelido",
26+
nicknameLabel: "Nome do Jogador",
2727
gameOptionLabel: "Escolha uma opção:",
2828
randomRoom: "Entre em uma sala aleatória",
29+
publicRoomLabel: "Sala pública:",
2930
createRoom: "Criar uma sala",
3031
joinRoom: "Entrar em uma sala",
3132
roomCodeLabel: "Código da Sala",
32-
gameTimeLabel: "Tempo de Jogo (em segundos)",
33+
gameTimeLabel: "Tempo de Jogo",
3334
},
3435
room: {
3536
no_room_player: "Parece que você não definiu seu nickname!",

www/src/locales/main.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import $ from "jquery";
33

44
import pt from "@lang/pt-BR.ts";
55
import en from "@lang/en-US.ts";
6-
import es from "@lang/es-ES.ts";
76

87
i18next.init({
98
lng: "pt-BR",
@@ -16,9 +15,6 @@ i18next.init({
1615
"pt-BR": {
1716
translation: pt,
1817
},
19-
"es-ES": {
20-
translation: es,
21-
},
2218
},
2319
interpolation: {
2420
escapeValue: false,
@@ -36,9 +32,6 @@ switch (window.navigator.language) {
3632
case "en-US":
3733
lang = i18next.getFixedT("en-US");
3834
break;
39-
case "es-ES":
40-
lang = i18next.getFixedT("en-US");
41-
break;
4235
default:
4336
lang = i18next.getFixedT("en-US");
4437
}

www/src/styles/css/ui.css

Lines changed: 4 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ ui .statistic td .value {
290290
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
291291
animation: pulse 2s infinite;
292292
gap: 0.5rem;
293-
z-index: 999999999999999999999999999999;
293+
z-index: 1;
294294
}
295295

296296
.game-time h3 {
@@ -323,138 +323,14 @@ ui .statistic td .value {
323323
}
324324
}
325325

326-
.modal {
327-
background-color: rgba(0, 0, 0, 0.5);
328-
}
329-
330-
.modal-dialog {
331-
max-width: 500px;
332-
margin: 2rem auto;
333-
}
334-
335-
.modal-content {
336-
font-family: "minecraftia", cursive;
337-
border-radius: 12px;
338-
border: none;
339-
background: linear-gradient(to bottom, var(--layout), var(--layout-dark));
340-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
341-
}
342-
343-
.modal-header {
344-
background-color: var(--layout-dark);
345-
color: var(--text-color-dark);
346-
padding: 16px;
347-
border-radius: 12px 12px 0 0;
348-
}
349-
350-
.modal-header .modal-title {
351-
font-size: 18px;
352-
font-weight: bold;
353-
display: flex;
354-
align-items: center;
355-
gap: 8px;
356-
}
357-
358-
.modal-body {
359-
padding: 20px;
360-
}
361-
362-
.modal-body .form-check-input {
363-
width: 20px;
364-
height: 20px;
365-
border: 1.5px solid var(--text-color-dark);
366-
border-radius: 50%;
367-
border: none;
368-
background-color: var(--layout);
369-
transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
370-
cursor: pointer;
371-
}
372-
373-
.modal-body .form-check-input:checked {
374-
background-color: var(--btn-primary-bg);
375-
border-color: var(--btn-primary-bg);
376-
box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
377-
}
378-
379-
.modal-body .form-label {
380-
font-size: 0.85rem;
381-
font-weight: bold;
382-
color: var(--text-color-dark);
383-
margin-bottom: 8px;
384-
display: inline-block;
385-
}
386-
387-
.modal-body .form-check-label {
388-
font-size: 0.8rem;
389-
color: var(--text-color-dark);
390-
margin-bottom: 0;
391-
line-height: 1.4;
392-
cursor: pointer;
393-
transition: color 0.3s ease;
394-
}
395-
396-
.modal-body .form-control {
397-
font-size: 0.8rem;
398-
border-radius: 8px;
399-
border: 1px solid var(--text-color);
400-
padding: 8px 12px;
401-
background-color: var(--layout);
402-
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
403-
}
404-
405-
.modal-body .form-control:focus {
406-
border-color: var(--layout-dark);
407-
box-shadow: 0 0 4px rgba(0, 123, 255, 0.4);
408-
}
409-
410-
.modal-footer {
411-
padding: 16px;
412-
display: flex;
413-
justify-content: space-between;
414-
}
415-
416-
.modal-footer .btn {
417-
border-radius: 8px;
418-
padding: 8px 16px;
419-
font-size: 14px;
420-
}
421-
422-
.modal-footer .btn-secondary {
423-
background-color: var(--btn-secondary-bg);
424-
color: #fff;
425-
font-weight: 500;
426-
border: none;
427-
border-radius: 8px;
428-
padding: 10px 20px;
429-
transition: background-color 0.3s ease, box-shadow 0.3s ease;
430-
}
431-
432-
.modal-footer .btn-secondary:hover {
433-
background-color: var(--btn-secondary-hover-bg);
434-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
435-
}
436-
437-
.modal-footer .btn-primary {
438-
background-color: var(--btn-primary-bg);
439-
color: #fff;
440-
font-weight: 600;
441-
border: none;
442-
border-radius: 8px;
443-
padding: 10px 20px;
444-
transition: background-color 0.3s ease, transform 0.2s, box-shadow 0.3s ease;
445-
}
446-
447-
.modal-footer .btn-primary:hover {
448-
background-color: var(--btn-primary-hover-bg);
449-
transform: scale(1.05);
450-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
451-
}
452326

327+
/* END - MODAL FOOTER BUTTON STYLE */
328+
453329
.toast,
454330
.toast .toast-header,
455331
.toast .btn-close {
456332
background-color: var(--layout);
457333
color: var(--text-color-dark) !important;
458334
border-radius: 12px;
459335
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
460-
}
336+
}

0 commit comments

Comments
 (0)