Commit f096b7f9 authored by isabell.Heider's avatar isabell.Heider
Browse files

Add and Remove points

parent fc9c0a6a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -34,9 +34,7 @@
              "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
              "src/styles.scss"
            ],
            "scripts": [
              "./src/assets/JavaScript/Timer.js"
            ]
            "scripts": []
          },
          "configurations": {
            "production": {
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ export class TabuMiddlewareService {
  }

  addPoint(req: any): Promise<any> {
    console.log(req);
    console.log('TestAddPoint: ', req);
    return this.request('POST', `${environment.tabuMiddlewareURL}addPoint`, req);
  }

+16 −3
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ export class GameComponent implements OnInit {
  ngOnInit(): void {
    this.activatedRoute.paramMap.subscribe(params => {
      this.sessionName = String(params.get('sessionName'));
      this.service.getGamestatus({'spielname': this.sessionName}).then(value => {
      this.service.getGamestatus({spielname: this.sessionName}).then(value => {
        const status = JSON.parse(value.status);
        if (status) {
          this.gameStatus.sessionID = JSON.parse(value.sessionID);
@@ -61,12 +61,25 @@ export class GameComponent implements OnInit {

  rightAnswer(): void{
    this.newCard();
    this.service.addPoint({spielname: this.sessionName, team: this.team});
    this.service.addPoint
    ({
      spielname: this.sessionName, team: this.team, red: this.gameStatus.red, blue: this.gameStatus.blue}).then(value => {
      this.gameStatus.red = JSON.parse(value.red);
      this.gameStatus.blue = JSON.parse(value.blue);
    });
    console.log(this.gameStatus);
  }

  wrongAnswer(): void{
    this.newCard();
    this.service.removePoint({spielname: this.sessionName, team: this.team});
    this.service.removePoint
    ({
      spielname: this.sessionName, team: this.team, red: this.gameStatus.red, blue: this.gameStatus.blue
    }).then(value => {
      this.gameStatus.red = JSON.parse(value.red);
      this.gameStatus.blue = JSON.parse(value.blue);
    });
    console.log(this.gameStatus);
  }

  newCard(): void{
+4 −3
Original line number Diff line number Diff line
<div style="text-align: center; margin-left: 15em; margin-right: 15em; margin-top: 5em;">
  <mat-card class="transparent">
    <mat-card-title> Du musst raten!

      <br>
      <br>
      <br>
      Spielstand</mat-card-title>
    <mat-card-content>
      <br>
@@ -17,10 +19,9 @@
      </table>
    </mat-card-content>
    <br>
    <mat-progress-spinner color="primary" mode="determinate" value="value">
    <mat-progress-spinner class = "center" color="primary" mode="determinate" value={{timeLeft}}>
    </mat-progress-spinner>
  </mat-card>
</div>
<div id="app"></div>

+7 −50
Original line number Diff line number Diff line
@@ -2,56 +2,13 @@
  opacity: 0.9;
}

.base-timer {
  position: relative;
  width: 300px;
  height: 300px;
table{
  width: 50%;
  margin-left: auto;
  margin-right: auto;
}

.base-timer__svg {
  transform: scaleX(-1);
.center{
  margin-left: auto;
  margin-right: auto;
}

.base-timer__circle {
  fill: none;
  stroke: none;
}

.base-timer__path-elapsed {
  stroke-width: 7px;
  stroke: grey;
}

.base-timer__path-remaining {
  stroke-width: 7px;
  stroke-linecap: round;
  transform: rotate(90deg);
  transform-origin: center;
  transition: 1s linear all;
  fill-rule: nonzero;
  stroke: currentColor;
}

.base-timer__path-remaining.green {
  color: rgb(65, 184, 131);
}

.base-timer__path-remaining.orange {
  color: orange;
}

.base-timer__path-remaining.red {
  color: red;
}

.base-timer__label {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
Loading