unictive-angular 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/bin/utils/resource/package.json +1 -0
  2. package/bin/utils/resource/src/app/API/README.md +10 -0
  3. package/bin/utils/resource/src/app/API/user.service.ts +26 -0
  4. package/bin/utils/resource/src/app/MODULES/authentication/login/login.component.html +20 -0
  5. package/bin/utils/resource/src/app/MODULES/authentication/login/login.component.scss +0 -0
  6. package/bin/utils/resource/src/app/MODULES/authentication/login/login.component.ts +35 -0
  7. package/bin/utils/resource/src/app/MODULES/authentication/login/login.module.ts +19 -0
  8. package/bin/utils/resource/src/app/MODULES/authentication/page404/page404.component.html +3 -0
  9. package/bin/utils/resource/src/app/MODULES/authentication/page404/page404.component.scss +0 -0
  10. package/bin/utils/resource/src/app/MODULES/authentication/page404/page404.component.ts +16 -0
  11. package/bin/utils/resource/src/app/MODULES/authentication/page404/page404.module.ts +17 -0
  12. package/bin/utils/resource/src/app/MODULES/authentication/register/register.component.html +3 -0
  13. package/bin/utils/resource/src/app/MODULES/authentication/register/register.component.scss +0 -0
  14. package/bin/utils/resource/src/app/MODULES/authentication/register/register.component.ts +16 -0
  15. package/bin/utils/resource/src/app/MODULES/authentication/register/register.module.ts +18 -0
  16. package/bin/utils/resource/src/app/MODULES/home/home.component.html +4 -0
  17. package/bin/utils/resource/src/app/MODULES/home/home.component.scss +0 -0
  18. package/bin/utils/resource/src/app/MODULES/home/home.component.ts +16 -0
  19. package/bin/utils/resource/src/app/MODULES/home/home.module.ts +19 -0
  20. package/bin/utils/resource/src/app/app.html +0 -262
  21. package/bin/utils/resource/src/app/app.routes.ts +20 -1
  22. package/bin/utils/resource/src/app/app.ts +18 -2
  23. package/bin/utils/resource/src/app/core/config/entity-store.ts +69 -0
  24. package/bin/utils/resource/src/app/core/config/single-store.ts +51 -0
  25. package/bin/utils/resource/src/app/core/interceptors/jwt.interceptor.ts +1 -0
  26. package/bin/utils/resource/src/app/core/models/entities/screen.entity.spec.ts +41 -0
  27. package/bin/utils/resource/src/app/core/models/entities/screen.entity.ts +16 -0
  28. package/bin/utils/resource/src/app/core/models/entities/user.entity.ts +15 -0
  29. package/bin/utils/resource/src/app/core/respositories/screen_repo/screen.repo.ts +19 -0
  30. package/bin/utils/resource/src/app/core/respository/screen_repo/screen.repo.ts +27 -0
  31. package/bin/utils/resource/src/app/core/respository/user/user_repo.ts +26 -0
  32. package/bin/utils/resource/src/app/core/services/helper.service.ts +238 -0
  33. package/bin/utils/resource/src/app/core/services/listener.service.ts +15 -0
  34. package/bin/utils/resource/src/app/shared/libs/library.module.ts +14 -0
  35. package/bin/utils/resource/src/app/shared/ui/input-text/input-text.component.scss +0 -0
  36. package/bin/utils/resource/src/app/shared/ui/input-text/input-text.component.ts +64 -0
  37. package/bin/utils/resource/src/app/shared/utils/validator_pattern.ts +25 -0
  38. package/bin/utils/resource/src/app/shared/widgets/alert-error-input/alert-error-input.component.html +94 -0
  39. package/bin/utils/resource/src/app/shared/widgets/alert-error-input/alert-error-input.component.ts +24 -0
  40. package/bin/utils/resource/src/app/shared/widgets/widget_game/widget_game.component.html +20 -0
  41. package/bin/utils/resource/src/app/shared/widgets/widget_game/widget_game.component.scss +0 -0
  42. package/bin/utils/resource/src/app/shared/widgets/widget_game/widget_game.component.ts +65 -0
  43. package/bin/utils/resource/src/app/shared/widgets/widget_game/widget_game.module.ts +12 -0
  44. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ <div class="fixed inset-0 bgs z-50 flex items-center justify-center">
2
+ <div class="absolute transition-all duration-100 ease-in-out transform hover:scale-110"
3
+ style="padding: 50px; box-sizing: content-box;"
4
+ [ngStyle]="{ top: boxPosition.top, left: boxPosition.left, position: 'absolute' }" (mouseenter)="onMouseEnterBox()">
5
+
6
+ <div (click)="onLogout()"
7
+ class=" w-40 h-20 bg-black text-white flex items-center text-center justify-center cursor-pointer rounded-xl shadow-lg">
8
+ Tangkap
9
+ </div>
10
+ </div>
11
+
12
+ <div class="absolute top-5 right-5 text-white text-xl space-y-2 text-right bg-amber-900 p-2 rounded-2xl">
13
+ <div>Waktu: {{ timer }} detik</div>
14
+ <div>Skor: {{ score }}</div>
15
+ </div>
16
+
17
+ <div *ngIf="gameEnded" class="absolute bottom-10 text-white text-2xl font-bold">
18
+ Permainan Selesai! Skor akhir: {{ score }}
19
+ </div>
20
+ </div>
@@ -0,0 +1,65 @@
1
+ import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-widget_game',
5
+ templateUrl: './widget_game.component.html',
6
+ styleUrls: ['./widget_game.component.scss'],
7
+ standalone: false
8
+ })
9
+ export class Widget_gameComponent implements OnInit {
10
+
11
+ boxPosition = { top: '50%', left: '50%' };
12
+ gameStarted = false;
13
+ gameEnded = false;
14
+ timer = 60;
15
+ score = 0;
16
+ intervalId: any;
17
+ constructor(
18
+ private cdr: ChangeDetectorRef
19
+ ) { }
20
+
21
+ ngOnInit() {
22
+ this.startGame();
23
+ }
24
+ startGame() {
25
+ this.gameStarted = true;
26
+ this.timer = 60;
27
+ this.score = 0;
28
+ this.gameEnded = false;
29
+ this.moveBoxRandomly();
30
+
31
+ this.intervalId = setInterval(() => {
32
+ this.timer--;
33
+ if (this.timer <= 0) {
34
+ clearInterval(this.intervalId);
35
+ this.gameEnded = true;
36
+ }
37
+ this.cdr.detectChanges();
38
+ }, 1000);
39
+ }
40
+
41
+ onMouseEnterBox() {
42
+ if (!this.gameEnded) {
43
+ this.score++;
44
+ this.moveBoxRandomly();
45
+ // this.cdr.detectChanges();
46
+
47
+ }
48
+ }
49
+
50
+ moveBoxRandomly() {
51
+ const top = Math.random() * 90;
52
+ const left = Math.random() * 90;
53
+ this.boxPosition = {
54
+ top: `${top}%`,
55
+ left: `${left}%`,
56
+ };
57
+ this.cdr.detectChanges();
58
+
59
+ }
60
+
61
+ onLogout() {
62
+ // this.auth.onLogout();
63
+ }
64
+
65
+ }
@@ -0,0 +1,12 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { Widget_gameComponent } from './widget_game.component';
4
+
5
+ @NgModule({
6
+ imports: [
7
+ CommonModule
8
+ ],
9
+ exports: [Widget_gameComponent],
10
+ declarations: [Widget_gameComponent]
11
+ })
12
+ export class Widget_gameModule { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unictive-angular",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "CLI untuk membuat project Angular dengan struktur kustom (Modules, Core, API, Shared).",
5
5
  "scripts": {
6
6
  "build": "npm version patch && npm publish --access public"