<commit_before>import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { PlayerState } from './models';

@Component({
  selector: '[in-c-player]',
  template: `
    <svg:circle [attr.cx]="getX()" cy="100" r="50"></svg:circle>
  `,
  styles: [`
    circle {
      fill: white;
    }
  `],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class PlayerComponent {
  @Input() playerState: PlayerState;
  @Input() screenWidth: number;

  getX() {
    const relativeX = (this.playerState.player.position + 1) / 2;
    return relativeX * this.screenWidth;
  }
}
<commit_msg>animation PoC<commit_after>import {
  ChangeDetectionStrategy,
  Component,
  Input,
  animate,
  state,
  style,
  transition,
  trigger
} from '@angular/core';
import { PlayerState } from './models';

@Component({
  selector: '[in-c-player]',
  template: `
    <svg:circle [attr.cx]="getX()"
                cy="100"
                r="50"
                [@nowPlaying]="isPlaying() ? 'yes' : 'no'">
    </svg:circle>
  `,
  styles: [`
    circle {
      fill: white;
    }
  `],
  animations: [
    trigger('nowPlaying', [
      state('yes', style({opacity: 1})),
      state('no',  style({opacity: 0.5})),
      transition('* => *', animate('1000ms'))
    ])
  ],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class PlayerComponent {
  @Input() playerState: PlayerState;
  @Input() screenWidth: number;

  playing = true;

  constructor() {
    setTimeout(() => this.playing = false, 1000);
  }
  getX() {
    const relativeX = (this.playerState.player.position + 1) / 2;
    return relativeX * this.screenWidth;
  }

  isPlaying() {
    return this.playing;
  }

}

{'fraction_non_alphanumeric': 0.1670616113744076, 'fraction_numerical': 0.01481042654028436, 'mean_word_length': 3.0895883777239708, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6483015', 'n_tokens_mistral': 591, 'n_tokens_neox': 551, 'n_words': 114}