2 |
3 |
4 | Scan QR code to play with a mobile phone
5 |
6 |

7 |
8 |
13 |
18 |
23 |
28 |
33 |
34 |
36 |
37 |
--------------------------------------------------------------------------------
/src/app/components/github/github.component.scss:
--------------------------------------------------------------------------------
1 | .d-flex {
2 | position: fixed;
3 | top: 50%;
4 | transform: translateY(-50%);
5 | left: -300px;
6 |
7 | .qr {
8 | left: auto;
9 | top: 5%;
10 | text-align: left;
11 | cursor: pointer;
12 |
13 | .hint {
14 | margin-bottom: 10px;
15 | font-size: 14px;
16 | max-width: 300px;
17 | color: #cfd2d6;
18 | opacity: 0;
19 | }
20 |
21 | img {
22 | width: 60px;
23 | height: 60px;
24 | transition: transform 0.2s;
25 | transform-origin: 0 0;
26 | &:hover {
27 | transform: scale(4.5);
28 | }
29 | }
30 | }
31 |
32 | display: flex;
33 | flex-direction: column;
34 | }
35 |
36 | .tweet-button {
37 | cursor: pointer;
38 | margin-top: 7px;
39 | margin-bottom: 10px;
40 |
41 | &.top {
42 | margin-top: 15px;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/app/components/github/github.component.ts:
--------------------------------------------------------------------------------
1 | import { GoogleAnalyticsService } from '@angular-tetris/services/google-analytics.service';
2 | import { TetrisStateService } from '@angular-tetris/state/tetris/tetris.state';
3 | import { NgIf } from '@angular/common';
4 | import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
5 | import { SharedButtonComponent } from '../shared-button/shared-button.component';
6 | const HASHTAG = 'angular,angulartetris,akita,typescript';
7 |
8 | @Component({
9 | selector: 't-github',
10 | standalone: true,
11 | imports: [SharedButtonComponent, NgIf],
12 | templateUrl: './github.component.html',
13 | styleUrls: ['./github.component.scss'],
14 | changeDetection: ChangeDetectionStrategy.OnPush
15 | })
16 | export class GithubComponent {
17 | private tetrisState = inject(TetrisStateService);
18 | private googleAnalytics = inject(GoogleAnalyticsService);
19 |
20 | max = this.tetrisState.max;
21 |
22 | tweetMaxScoreShareUrl = computed(() => {
23 | const text = encodeURIComponent(
24 | `Woo-hoo! I got a ${this.max()} points on Angular Tetris @trungvose. Wanna join the party?`
25 | );
26 | return `https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Ftrungk18%2Fangular-tetris&text=${text}&hashtags=${HASHTAG}`;
27 | });
28 |
29 | //eslint-disable-next-line max-len
30 | tweetAngularTetrisUrl = `https://twitter.com/intent/tweet?url=https%3A%2F%2Fgithub.com%2Ftrungk18%2Fangular-tetris&text=Awesome%20Tetris%20game%20built%20with%20Angular%2010%20and%20Akita%2C%20can%20you%20get%20999999%20points%3F&hashtags=${HASHTAG}`;
31 |
32 | sendTwitterShareMaxScoreEvent() {
33 | this.googleAnalytics.sendEvent('Share Twitter High Score', 'button');
34 | }
35 |
36 | sendTwitterShareEvent() {
37 | this.googleAnalytics.sendEvent('Share Twitter', 'button');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/app/components/hold/hold.component.html:
--------------------------------------------------------------------------------
1 |