diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts deleted file mode 100644 index 4526952..0000000 --- a/src/app/app-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {NgModule} from '@angular/core'; -import {RouterModule, Routes} from '@angular/router'; -import {SimpleComponent} from "./simple/simple.component"; -import {FortuneWheelComponent} from "./fortune-wheel/fortune-wheel.component"; - -const routes: Routes = [ - {path: '', redirectTo: '/simple', pathMatch: 'full'}, - {path: 'simple', component: SimpleComponent}, - {path: 'fortune', component: FortuneWheelComponent}, -]; - -@NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] -}) -export class AppRoutingModule { -} diff --git a/src/app/app.component.html b/src/app/app.component.html deleted file mode 100644 index 0680b43..0000000 --- a/src/app/app.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/app/app.component.scss b/src/app/app.component.scss index 841886b..786ed1f 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -3,6 +3,8 @@ svg { flex-shrink: 0; backdrop-filter: blur(15px); + background-color: transparent; + color: transparent; } image#image1_204_3 { @@ -11,11 +13,11 @@ image#image1_204_3 { animation: fadeIn 4s infinite linear; } -#time-value{ +#time-value { font-size: 110px; } -#username{ +#username { font-size: 100px; } diff --git a/src/app/simple/simple.component.svg b/src/app/app.component.svg similarity index 100% rename from src/app/simple/simple.component.svg rename to src/app/app.component.svg diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dbbb0c1..65bad15 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,77 @@ -import { Component } from '@angular/core'; +import {Component, OnDestroy, OnInit} from '@angular/core'; @Component({ selector: 'app-root', - templateUrl: './app.component.html', + templateUrl: './app.component.svg', styleUrls: ['./app.component.scss'] }) -export class AppComponent { - title = 'auction-plugin-ui'; +export class AppComponent implements OnInit, OnDestroy { + liveData: any; + displayTime: string; + interval: any; + private auctionSocket: WebSocket | undefined; + private timerSocket: WebSocket | undefined; + + constructor() { + this.displayTime = "" + this.connect(); + } + + ngOnInit(): void { + this.loadDefaultData() + } + private connect() { + this.auctionSocket = new WebSocket('ws://localhost:10000/auction'); + this.auctionSocket.onopen = () => { + console.log('Connected to server'); + }; + this.auctionSocket.onmessage = (event) => { + this.liveData = JSON.parse(event.data); + }; + this.auctionSocket.onclose = (event) => { + console.log(`WebSocket disconnected with code ${event.code}`); + setTimeout(() => { + console.log('Attempting to reconnect...'); + this.connect(); + }, 1000); + }; + this.auctionSocket.onerror = (error) => { + this.loadDefaultData() + console.log(`WebSocket error: ${error}`); + }; + + this.timerSocket = new WebSocket('ws://localhost:10000/auctionTimer'); + this.timerSocket.onopen = () => { + console.log('Connected to server'); + }; + this.timerSocket.onmessage = (event) => { + this.displayTime = JSON.parse(event.data).timer; + }; + this.timerSocket.onclose = (event) => { + console.log(`WebSocket disconnected with code ${event.code}`); + setTimeout(() => { + console.log('Attempting to reconnect...'); + this.connect(); + }, 1000); + }; + this.timerSocket.onerror = (error) => { + console.log(`WebSocket error: ${error}`); + }; + } + + private loadDefaultData() { + this.liveData = { + rewardCost: "", + userName: "", + } + } + + ngOnDestroy(): void { + if (this.auctionSocket) { + this.auctionSocket.close(); + } + if (this.timerSocket) { + this.timerSocket.close(); + } + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 35fe6d7..9f78284 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,20 +1,14 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { SimpleComponent } from './simple/simple.component'; -import { FortuneWheelComponent } from './fortune-wheel/fortune-wheel.component'; @NgModule({ declarations: [ AppComponent, - SimpleComponent, - FortuneWheelComponent, ], imports: [ BrowserModule, - AppRoutingModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/fortune-wheel/fortune-wheel.component.html b/src/app/fortune-wheel/fortune-wheel.component.html deleted file mode 100644 index 6121e5b..0000000 --- a/src/app/fortune-wheel/fortune-wheel.component.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
-
-
-
diff --git a/src/app/fortune-wheel/fortune-wheel.component.scss b/src/app/fortune-wheel/fortune-wheel.component.scss deleted file mode 100644 index 29770b1..0000000 --- a/src/app/fortune-wheel/fortune-wheel.component.scss +++ /dev/null @@ -1,35 +0,0 @@ -.wheel-container { - display: flex; - justify-content: center; - align-items: center; - height: 300px; -} - -.wheel { - width: 300px; - height: 300px; - border-radius: 50%; - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADgCAMAAADCMfHtAAABpFBMVEX/////4F//qmT/U0o1bneq22slW17/9Hb/qWb/3WT/4l//rWUxbHX/UEk1b3glZnD/+nYxa3cgZG7/+Hb/SkgtaHel22wxaXD/5l+l4W31+Pmu32oAW1/D0tTq8PH/RkgqYWakur7f6Ol6nKK1yMvuVEwYWF5QgIhAdn7R3d9mjpWQrLFdbXSKa253mqAha3i23GvzqGX+tWaswcT+oWP+d1b+bVT+i133VEtrWVn+xF0+dHekt3ceY3dahXdJdHbj32Wj1G3+12Lz4GN0lXfz7XZkmHT+2GLalVuw1Gy4yWn+mWLihljpfFXe4Xb+o1igWFVTWlvIVlA+Y18LUl6mp1+wv3dPfneQqHfBynd4mXeMonefqHDOxWvczWXq1GLXymd7qXKyl29fknSOiHKPwXBhenS2lW17g3L+vWXYoWjJ3WnQ1naXyG6CtXHNmWnouWzLq2K5YmDcWFPlg1jHtWNvaW6ZaGrLYV3v7//Lr2Pc3f/+fVKFWVhPXF6wTFFaUFlJd2Z5WVh+kV5eel56d2EASF0+aV9ebWCXg2JvhV+Lk14pZHPoAAAVF0lEQVR4nNWd/UPbxhnHYwwikWXJMqg4HnawIX6jhaQEQufYWQt0abOytEAIBId2XZsto0vbrF27dd3aJM3bP707vdh6Tifp7nQG+vzSlgTLn36ft3tOOp05czxWLFerzWaz5FizWa2Wi8VjuvZwrVgtzc0vtOoNXTOMfN6wDf9T0xv11sL8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HUIXE2XVlueqVvf23m38dPjUjBKk3Hr+9MXDBw6oDZsquJY6vNfbefXkWa22XSN+UZnCBdC02m3noWzEV5e5kGC0Ut1lNC3L/iL6oFslMLE+CPXpC2SvDl69evzyyTP0J9sB5Rz5pnT49mLNaAy7RITYXANUDgwZFJJArWHJHGaqzUyNQjzEp1eO2UEHVqwEGCMh4wzjBfi0+RPjC2O0IfkpKXg23zGU+Bibq+cDjPi7TrFrOUOjw/mlcXL+CazUMoJC2pQYM5JzBsFpNDrUgBr1E8ovNKvON/IaBdLB1KYwqG0uFTb0Q22UCmfLp8+eQH2IsmKppdOE7IPqgIX4TwLP0Fpzp8M9oZWXsLeGU7KZZhj1yrH1n9yGIEcTQGpYvVOM51i5hGJSgBLRodibO/nawGTludm6xo6J4Yz67NJpF4+wcrOy0DDymDOMFP+Jgf5Ko1Up/Uq0C1ixWqrMtuqNUawSMISuN+qt2UqpeRqzJq8Vy9VmqTS3tFSxbWlprlRqVsvHgvZ/My4swAvfgA0AAAAASUVORK5CYII='); /* Замените на путь к желаемой текстуре */ - background-size: cover; - position: relative; - overflow: hidden; -} - -.sector { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - font-size: 18px; - font-weight: bold; - text-transform: uppercase; - transition: background-color 0.3s ease; -} - -.sector-text { - color: white; -} diff --git a/src/app/fortune-wheel/fortune-wheel.component.spec.ts b/src/app/fortune-wheel/fortune-wheel.component.spec.ts deleted file mode 100644 index 0ba1dba..0000000 --- a/src/app/fortune-wheel/fortune-wheel.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { FortuneWheelComponent } from './fortune-wheel.component'; - -describe('FortuneWeelComponent', () => { - let component: FortuneWheelComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ FortuneWheelComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(FortuneWheelComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/fortune-wheel/fortune-wheel.component.ts b/src/app/fortune-wheel/fortune-wheel.component.ts deleted file mode 100644 index 2ea0ceb..0000000 --- a/src/app/fortune-wheel/fortune-wheel.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {Component, OnInit} from '@angular/core'; - -@Component({ - selector: 'app-fortune-wheel', - templateUrl: './fortune-wheel.component.html', - styleUrls: ['./fortune-wheel.component.scss'] -}) -export class FortuneWheelComponent implements OnInit { - sectors: any[] = [ - { label: 'Сектор 1', color: '#FF0000' }, - { label: 'Сектор 2', color: '#00FF00' }, - { label: 'Сектор 3', color: '#0000FF' }, - ]; - - rotation: number = 0; - - constructor() { - } - - ngOnInit(): void { - } -} diff --git a/src/app/simple/simple.component.scss b/src/app/simple/simple.component.scss deleted file mode 100644 index 841886b..0000000 --- a/src/app/simple/simple.component.scss +++ /dev/null @@ -1,29 +0,0 @@ -@import url('https://fonts.googleapis.com/css?family=Acme&display=swap'); - -svg { - flex-shrink: 0; - backdrop-filter: blur(15px); -} - -image#image1_204_3 { - background: no-repeat; - box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25) inset; - animation: fadeIn 4s infinite linear; -} - -#time-value{ - font-size: 110px; -} - -#username{ - font-size: 100px; -} - -@keyframes fadeIn { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } -} diff --git a/src/app/simple/simple.component.spec.ts b/src/app/simple/simple.component.spec.ts deleted file mode 100644 index 64d7622..0000000 --- a/src/app/simple/simple.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SimpleComponent } from './simple.component'; - -describe('SimpleComponent', () => { - let component: SimpleComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ SimpleComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(SimpleComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/simple/simple.component.ts b/src/app/simple/simple.component.ts deleted file mode 100644 index 8d6d9df..0000000 --- a/src/app/simple/simple.component.ts +++ /dev/null @@ -1,77 +0,0 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; - -@Component({ - selector: 'app-simple', - templateUrl: './simple.component.svg', - styleUrls: ['./simple.component.scss'] -}) -export class SimpleComponent implements OnInit, OnDestroy { - liveData: any; - displayTime: string; - interval: any; - private auctionSocket: WebSocket | undefined; - private timerSocket: WebSocket | undefined; - - constructor() { - this.displayTime = "" - this.connect(); - } - - ngOnInit(): void { - this.loadDefaultData() - } - private connect() { - this.auctionSocket = new WebSocket('ws://localhost:10000/auction'); - this.auctionSocket.onopen = () => { - console.log('Connected to server'); - }; - this.auctionSocket.onmessage = (event) => { - this.liveData = JSON.parse(event.data); - }; - this.auctionSocket.onclose = (event) => { - console.log(`WebSocket disconnected with code ${event.code}`); - setTimeout(() => { - console.log('Attempting to reconnect...'); - this.connect(); - }, 1000); - }; - this.auctionSocket.onerror = (error) => { - this.loadDefaultData() - console.log(`WebSocket error: ${error}`); - }; - - this.timerSocket = new WebSocket('ws://localhost:10000/auctionTimer'); - this.timerSocket.onopen = () => { - console.log('Connected to server'); - }; - this.timerSocket.onmessage = (event) => { - this.displayTime = JSON.parse(event.data).timer; - }; - this.timerSocket.onclose = (event) => { - console.log(`WebSocket disconnected with code ${event.code}`); - setTimeout(() => { - console.log('Attempting to reconnect...'); - this.connect(); - }, 1000); - }; - this.timerSocket.onerror = (error) => { - console.log(`WebSocket error: ${error}`); - }; - } - - private loadDefaultData() { - this.liveData = { - rewardCost: "", - userName: "", - } - } - - ngOnDestroy(): void { - if (this.auctionSocket) { - this.auctionSocket.close(); - } - if (this.timerSocket) { - this.timerSocket.close(); - } - } -}