Skip to content

Commit 77867cb

Browse files
feat(styles): update styles
1 parent 33c5cb5 commit 77867cb

File tree

3 files changed

+46
-66
lines changed

3 files changed

+46
-66
lines changed

www/index.html

+9-14
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,24 @@
1515
<audio id="splash" preload="auto">
1616
<source src="./src/audio/start.mp3" type="audio/mp3">
1717
</audio>
18-
<!---
18+
1919
<splash-screen class="d-flex flex-column justify-content-center align-items-center vh-100">
2020
<img src="https://raw.githubusercontent.com/sebastianjnuwu/app/refs/heads/android/android/app/src/main/res/drawable/splash_screen.png" alt="splash-screen" class="icon mb-5">
2121
<h1>Click...</h1>
22-
</splash-screen> --->
22+
</splash-screen>
2323

24-
<ui style="display: none;" class="d-flex flex-column justify-content-center align-items-center text-center vh-100">
24+
<ui style="display: none !important;" class="d-flex flex-column justify-content-center align-items-center text-center vh-100">
2525

26-
<div class="stats-container">
27-
<table class="stats-table">
26+
<div class="text-center">
27+
<table class="statistic">
2828
<tbody>
2929
<tr>
30-
<th><i class="fas fa-mouse-pointer"></i> Clicks</th>
31-
<td id="clicks" class="value">0</td>
30+
<th><i class="fas fa-cookie-bite"></i> Cookies</th>
31+
<td id="click-cookie" class="value">0</td>
3232
</tr>
33-
<tr>
33+
<tr>
3434
<th><i class="fas fa-stopwatch"></i> Seconds</th>
35-
<td id="seconds" class="value">0</td>
36-
</tr>
37-
<tr>
38-
<th><i class="fas fa-cookie-bite"></i> Cookies</th>
39-
<td id="cookies" class="value">0</td>
35+
<td id="cps" class="value">0</td>
4036
</tr>
4137
</tbody>
4238
</table>
@@ -51,7 +47,6 @@ <h1>Click...</h1>
5147
</ui>
5248

5349

54-
5550
<script src="./src/js/main.js" defer></script>
5651
<script src="./src/js/cookie/game.js" defer></script>
5752
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>

www/src/js/cookie/game.js

+22-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
let cookies = 0;
2+
let $cps = 0;
3+
4+
const $update_cps = () => {
5+
$('#cps').text($cps);
6+
$cps = 0;
7+
};
8+
9+
const $update_cookies = () => {
10+
cookies++;
11+
$cps++;
12+
$('#click-cookie').text(`${cookies}`);
13+
localStorage.setItem('cookie', cookies);
14+
};
15+
16+
setInterval($update_cps, 1000);
17+
118
$('.cookie').on('click', function (e) {
2-
3-
const a = 1;
4-
5-
const $effect = $(`<div class="click-effect">+${a}</div>`);
19+
20+
$update_cookies();
21+
22+
const $effect = $(`<div class="click-effect">+1</div>`);
623

724
const offset = $(this).offset();
825
const X = e.pageX - offset.left;
@@ -34,4 +51,4 @@ $('.cookie').on('click', function (e) {
3451
$(this).remove();
3552
}
3653
);
37-
});
54+
});

www/src/styles/css/ui.css

+15-47
Original file line numberDiff line numberDiff line change
@@ -89,70 +89,38 @@ body {
8989
pointer-events: none;
9090
}
9191

92-
/* Font Awesome for icons */
93-
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");
94-
95-
/* Estilos para a tabela */
96-
.stats-container {
97-
display: flex;
98-
justify-content: center;
99-
margin-top: 20px;
100-
padding: 0 10px;
101-
}
102-
103-
.stats-table {
104-
width: 100%;
105-
max-width: 400px;
106-
border-collapse: collapse;
107-
text-align: left;
92+
.statistic {
93+
text-align: center;
10894
font-family: "Press Start 2P", cursive;
10995
color: var(--text-color);
110-
background-color: var(--table-row-bg);
111-
border: 2px solid var(--table-border);
112-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
96+
text-shadow: 1px 1px var(--text-color-dark);
11397
}
11498

115-
.stats-table th, .stats-table td {
116-
border: 2px solid var(--table-border);
117-
padding: 10px;
99+
.statistic th, .statistic td {
100+
padding: 5px;
118101
text-align: center;
119102
}
120103

121-
.stats-table th {
122-
background-color: var(--table-header-bg);
123-
font-size: 1em;
104+
.statistic th {
105+
font-size: 0.8em;
124106
}
125107

126-
.stats-table td {
127-
background-color: var(--table-row-bg);
108+
.statistic td {
128109
position: relative;
129-
font-size: 1.2em;
110+
font-size: 1em;
130111
}
131112

132-
.stats-table td .label {
113+
.statistic td .label {
133114
font-weight: bold;
134115
}
135116

136-
.stats-table td .value {
117+
.statistic td .value {
137118
display: block;
138119
margin-top: 5px;
120+
transition: transform 0.2s ease, color 0.2s ease;
139121
}
140122

141-
.stats-table td .animated-number {
142-
position: absolute;
143-
top: 50%;
144-
left: 50%;
145-
transform: translate(-50%, -50%);
146-
animation: rise 1s ease-out;
147-
}
148-
149-
@keyframes rise {
150-
0% {
151-
opacity: 0;
152-
transform: translate(-50%, 50%);
153-
}
154-
100% {
155-
opacity: 1;
156-
transform: translate(-50%, -50%);
157-
}
123+
.statistic td .value.animate {
124+
transform: scale(1.3);
125+
color: #ff4500;
158126
}

0 commit comments

Comments
 (0)