Skip to content

Commit 041d060

Browse files
committed
update: for new graph dom
1 parent 0e17b8f commit 041d060

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-breakout",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"main": "index.js",
55
"license": "MIT",
66
"scripts": {

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "GitHub Breakout",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"manifest_version": 2,
55
"description": "Breakout!",
66
"permissions": ["storage"],

src/objects/block.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Block implements GameObject, Rect {
1010
bottom: number
1111

1212
origianlLife: number
13-
originalColor: string
13+
originalColorLevel: string
1414

1515
life: number
1616

@@ -27,8 +27,7 @@ export class Block implements GameObject, Rect {
2727

2828
this.origianlLife = Number(el.getAttribute('data-count'))
2929
this.life = this.origianlLife
30-
this.originalColor =
31-
el.getAttribute('fill') || 'var(--color-calendar-graph-day-bg)'
30+
this.originalColorLevel = el.getAttribute('data-level') || '0'
3231
}
3332

3433
update(delta: number) {}
@@ -40,11 +39,12 @@ export class Block implements GameObject, Rect {
4039
this.life = 0 // breaks at once
4140
this.blockElement.setAttribute('fill', 'var(--color-calendar-graph-day-bg)')
4241
this.blockElement.setAttribute('data-count', '0')
42+
this.blockElement.setAttribute('data-level', '0')
4343
}
4444

4545
reset() {
4646
this.life = this.origianlLife
47-
this.blockElement.setAttribute('fill', this.originalColor)
47+
this.blockElement.setAttribute('data-level', this.originalColorLevel)
4848
this.blockElement.setAttribute('data-count', this.origianlLife.toString())
4949
}
5050
}

0 commit comments

Comments
 (0)