diff options
author | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-23 03:01:02 +0200 |
---|---|---|
committer | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-23 03:01:02 +0200 |
commit | 6fe49c5cd6ef20dc477f11dac098e4c18c2584ee (patch) | |
tree | 952de1a3596ca04d17287d8d3593a6020ec2f55d /frontend/src/app/_pages/playground/playground.component.ts | |
parent | 1177f4b29b616a59af39f4aef11b116f9660357d (diff) |
Dodao korisnička podešavanja za pozadinu.
Diffstat (limited to 'frontend/src/app/_pages/playground/playground.component.ts')
-rw-r--r-- | frontend/src/app/_pages/playground/playground.component.ts | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/frontend/src/app/_pages/playground/playground.component.ts b/frontend/src/app/_pages/playground/playground.component.ts index 007a455e..f8ea8bb4 100644 --- a/frontend/src/app/_pages/playground/playground.component.ts +++ b/frontend/src/app/_pages/playground/playground.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { CookieService } from 'ngx-cookie-service'; @Component({ selector: 'app-playground', @@ -7,9 +8,24 @@ import { Component, OnInit } from '@angular/core'; }) export class PlaygroundComponent implements OnInit { - constructor() { } + animateBackground = true; + backgroundFill = 1.0; + + constructor(private cookie: CookieService) { } + + updateBGPrefs() { + this.cookie.set('animateBackground', "" + this.animateBackground); + this.cookie.set('backgroundFill', "" + this.backgroundFill); + console.log(this.animateBackground, this.backgroundFill); + } ngOnInit(): void { + if (this.cookie.check('animateBackground')) { + this.animateBackground = this.cookie.get('animateBackground') == 'true'; + } + if (this.cookie.check('backgroundFill')) { + this.backgroundFill = parseFloat(this.cookie.get('backgroundFill')); + } } } |