diff options
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')); +    }    }  } | 
