Skip to content

Commit

Permalink
Improve graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHerve-Descours-Cabaud committed Apr 6, 2024
1 parent 27586d2 commit c3a5ce8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
cursor: pointer;
margin: 10px; /* Espacement entre les boutons */
font-size: 8vh;

position: relative;
overflow: hidden;
}

.timer {
Expand Down Expand Up @@ -57,6 +60,9 @@
cursor: pointer;
margin: 10px; /* Espacement entre les boutons */
font-size: 8vw;

position: relative;
overflow: hidden;
}

.timer {
Expand All @@ -77,6 +83,19 @@
background-color: #3949ab;
}

.loading::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #3949ab; /* Couleur de la barre de chargement */
animation: loading 5.1s linear forwards; /* Animation de la barre de chargement */
z-index: -1; /* Assurez-vous que la barre de chargement est en arrière-plan */
}


.anim {
animation: anim 0.8s;
}
Expand All @@ -93,4 +112,11 @@
}
}


@keyframes loading {
0% {
height: 0; /* Commencez avec une hauteur de 0 */
}
100% {
height: 100%; /* Montez jusqu'à 100% de la hauteur */
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
</div>
-->
<div class="button-container">
<!--
<div *ngIf="currentCooldown < cooldown" class="timer">{{(5 - currentCooldown).toFixed(1)}}</div>
-->
<div class="button" id="0" (click)="click('0')">💡</div>
<div class="button" id="1" (click)="click('1')">🫀</div>
<div class="button" id="2" (click)="click('2')">👻</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,18 @@ export class AsymetricUnityTemplateComponent implements OnInit {
animation(value: string) {
const animated = document.getElementById(value);

animated!.addEventListener("animationend", () => {
animated?.classList.remove('anim');
animated!.addEventListener("animationend", (x) => {
if(x.animationName == "anim") {
animated?.classList.remove('anim');
}
else {
animated?.classList.remove('loading');
}
});
}

click(value: string) {
if(this.currentCooldown == this.cooldown) {
console.log("TEST")
this.currentCooldown = 0;
document.getElementById("0")!.style.backgroundColor = "grey"
document.getElementById("1")!.style.backgroundColor = "grey"
Expand All @@ -70,6 +74,11 @@ export class AsymetricUnityTemplateComponent implements OnInit {
const animated = document.getElementById(value);
animated?.classList.add('anim');
this.urlService.publish(this.variable, value).subscribe((x)=>console.log)

document.getElementById("0")!.classList.add('loading')
document.getElementById("1")!.classList.add('loading')
document.getElementById("2")!.classList.add('loading')
document.getElementById("3")!.classList.add('loading')
}
}
}

0 comments on commit c3a5ce8

Please sign in to comment.