Skip to content

Commit

Permalink
feat(styles): UI
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianjnuwu committed Dec 29, 2024
1 parent aa1437a commit f0297b9
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 57 deletions.
37 changes: 32 additions & 5 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,45 @@
</head>

<body class="ui-cookie">

<audio id="splash" preload="auto" loop>
<source src="./src/audio/start.mp3" type="audio/mp3">
</audio>


<audio id="click" preload="auto">
<source src="./src/audio/click.mp3" type="audio/mp3">
</audio>

<splash-screen class="d-flex flex-column justify-content-center align-items-center vh-100">
<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">
<h1>Click...</h1>
</splash-screen>

<start-screen style="display: none !important;" class="d-flex flex-column justify-content-center align-items-center vh-100">
<h1 class="title">
<i class="fas fa-cookie-bite"></i> Cookie
</h1>
<div class="menu-buttons">
<button id="play">
<i class="fas fa-gamepad"></i> Jogar
</button>
<button id="shop">
<i class="fas fa-store"></i> Loja
</button>
<button id="stats">
<i class="fas fa-chart-line"></i> Estatísticas
</button>
<button id="settings" disabled>
<i class="fas fa-cog"></i> Configurações
</button>
<button id="help">
<i class="fas fa-question-circle"></i> Ajuda
</button>
</div>

</start-screen>


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

<div class="text-center">
Expand All @@ -37,15 +66,13 @@ <h1>Click...</h1>
</tbody>
</table>
</div>



<cookie class="cookie position-relative">
<img src="https://raw.githubusercontent.com/sebastianjnuwu/sebastianjnuwu/refs/heads/main/website/7_Sem_Titulo_20241227172134.png"
alt="cookie"
class="icon mb-4">
</cookie>
</ui>


<script src="./src/js/main.js" defer></script>
<script src="./src/js/cookie/game.js" defer></script>
Expand Down
Binary file added www/src/audio/click.mp3
Binary file not shown.
12 changes: 11 additions & 1 deletion www/src/js/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
$(() => {

$("splash-screen").on("click", () => {
$("#splash")[0].volume = 0.1;
$("#splash")[0].play();
setTimeout(() => {
$("splash-screen").remove();
$("ui").show();
$("start-screen").show();
}, 1000);
});

$("start-screen button").on("click", () => $("#click")[0].play());

$("#play").on("click", () => {
$("start-screen").remove();
$("ui").show();
});

});
145 changes: 94 additions & 51 deletions www/src/styles/css/ui.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");

@import url("https://fonts.cdnfonts.com/css/minecraftia");

@import url("https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css");

@import url("https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css");

@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap');
@import url("https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap");

:root {
--layout: #fffbde;
--layout-dark: #fbf0c1;
--text-color: #fdd388;
--text-color-dark: #7c3d18;
--layout: #fffbde;
--layout-dark: #fbf0c1;
--text-color: #fdd388;
--text-color-dark: #7c3d18;
}

*,
*:before,
*:after {
margin: 0;
padding: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
padding: 0;
margin: 0;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
background: linear-gradient(to bottom, var(--layout), var(--layout-dark));
padding: 0;
margin: 0;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
background: linear-gradient(to bottom, var(--layout), var(--layout-dark));
}

.ui-cookie splash-screen .icon {
Expand Down Expand Up @@ -69,58 +71,99 @@ body {
}
}

.cookie img {
width: 15rem;
transition: transform 0.02s ease-in-out;
will-change: transform;
position: relative;
start-screen .title {
font-family: "MedievalSharp", cursive;
font-size: 4.5rem;
font-weight: bold;
margin: 2rem;
color: var(--text-color);
text-shadow: 2px 2px 8px var(--text-color-dark);
animation: start-screen-title 1s ease-in-out;
}

start-screen .menu-buttons {
display: flex;
flex-direction: column;
gap: 1.5rem;
}

start-screen .menu-buttons button {
font-size: 1.6rem;
padding: 0.8rem 3rem;
border: none;
border-radius: 50px;
font-weight: bold;
font-family: "MedievalSharp", cursive;
border: 0.5px solid var(--text-color-dark);
text-shadow: 1px 1px 0.5px var(--text-color-dark);
background-color: var(--layout-dark);
color: var(--text-color);
cursor: pointer;
transition: all 0.08s ease-in-out;
}

start-screen .menu-buttons button:hover {
transform: translateY(-5px);
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

@keyframes start-screen-title {
from {
transform: translateY(-50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}

.cookie img:active {
transform: scale(0.8);
ui .cookie img {
width: 15rem;
transition: transform 0.02s ease-in-out;
will-change: transform;
position: relative;
}

.click-effect {
position: absolute;
color: white;
font-size: 2rem;
font-weight: bold;
text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
pointer-events: none;
ui .cookie img:active {
transform: scale(0.8);
}

.statistic {
text-align: center;
font-family: "Press Start 2P", cursive;
color: var(--text-color);
text-shadow: 1px 1px var(--text-color-dark);
ui .click-effect {
position: absolute;
color: white;
font-size: 2rem;
font-weight: bold;
text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
pointer-events: none;
}

.statistic th, .statistic td {
padding: 5px;
text-align: center;
ui .statistic {
text-align: center;
font-family: "Press Start 2P", cursive;
color: var(--text-color);
text-shadow: 1px 1px var(--text-color-dark);
}

.statistic th {
font-size: 0.8em;
ui .statistic th, ui .statistic td {
padding: 5px;
text-align: center;
}

.statistic td {
position: relative;
font-size: 1em;
ui .statistic th {
font-size: 0.8em;
}

.statistic td .label {
font-weight: bold;
ui .statistic td {
position: relative;
font-size: 1em;
}

.statistic td .value {
display: block;
margin-top: 5px;
transition: transform 0.2s ease, color 0.2s ease;
ui .statistic td .label {
font-weight: bold;
}

.statistic td .value.animate {
transform: scale(1.3);
color: #ff4500;
ui .statistic td .value {
display: block;
margin-top: 5px;
}

0 comments on commit f0297b9

Please sign in to comment.