Skip to content

Commit

Permalink
update style
Browse files Browse the repository at this point in the history
  • Loading branch information
deemakuzovkin committed Aug 15, 2023
1 parent 346551c commit ec3577b
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 248 deletions.
17 changes: 0 additions & 17 deletions src/app/app-routing.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/app.component.html

This file was deleted.

6 changes: 4 additions & 2 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
svg {
flex-shrink: 0;
backdrop-filter: blur(15px);
background-color: transparent;
color: transparent;
}

image#image1_204_3 {
Expand All @@ -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;
}

Expand Down
File renamed without changes
75 changes: 71 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
6 changes: 0 additions & 6 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
5 changes: 0 additions & 5 deletions src/app/fortune-wheel/fortune-wheel.component.html

This file was deleted.

35 changes: 0 additions & 35 deletions src/app/fortune-wheel/fortune-wheel.component.scss

This file was deleted.

25 changes: 0 additions & 25 deletions src/app/fortune-wheel/fortune-wheel.component.spec.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/app/fortune-wheel/fortune-wheel.component.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/app/simple/simple.component.scss

This file was deleted.

25 changes: 0 additions & 25 deletions src/app/simple/simple.component.spec.ts

This file was deleted.

77 changes: 0 additions & 77 deletions src/app/simple/simple.component.ts

This file was deleted.

0 comments on commit ec3577b

Please sign in to comment.