Skip to content
This repository was archived by the owner on Mar 26, 2023. It is now read-only.

Commit 2db4db6

Browse files
committed
release: v2.0.0
1 parent ed8eaf2 commit 2db4db6

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v2.0.0 (5 Jan 2020)
2+
3+
* feat: theme support
4+
15
# v1.1.2 (1 Sep 2019)
26

37
* fix: remove settings when destroyed

eruda-fps.js

+15-9
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
GRAPH_Y = 40,
2121
GRAPH_WIDTH = w - 24,
2222
GRAPH_HEIGHT = 142,
23-
BACK_COLOR = '#fff',
24-
FORE_COLOR = '#90caf9',
2523
STEP = 2,
2624
NAME = 'FPS'
2725

@@ -38,7 +36,7 @@
3836
this._style = util.evalCss(
3937
[
4038
'.eruda-fps {padding: 10px !important;}',
41-
'canvas {width: 100%; border-radius: 4px; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.05), 0 1px 4px 0 rgba(0, 0, 0, 0.08), 0 3px 1px -2px rgba(0, 0, 0, 0.2);}'
39+
'canvas {width: 100%; border: 1px solid var(--border);}'
4240
].join('.eruda-fps ')
4341
)
4442
this._container = container
@@ -106,8 +104,12 @@
106104
this._ctx = this._canvas.getContext('2d')
107105
},
108106
_initCanvas: function() {
109-
var canvas = this._canvas,
110-
ctx = this._ctx
107+
var canvas = this._canvas
108+
var ctx = this._ctx
109+
110+
var curTheme = util.evalCss.getCurTheme()
111+
var BACK_COLOR = curTheme.background
112+
var FORE_COLOR = curTheme.accent
111113

112114
canvas.width = WIDTH
113115
canvas.height = HEIGHT
@@ -170,10 +172,14 @@
170172
this._min = Math.min(this._min, val)
171173
this._max = Math.max(this._max, val)
172174

173-
var min = this._min,
174-
max = this._max,
175-
canvas = this._canvas,
176-
ctx = this._ctx
175+
var curTheme = util.evalCss.getCurTheme()
176+
var BACK_COLOR = curTheme.background
177+
var FORE_COLOR = curTheme.accent
178+
179+
var min = this._min
180+
var max = this._max
181+
var canvas = this._canvas
182+
var ctx = this._ctx
177183

178184
ctx.fillStyle = BACK_COLOR
179185
ctx.globalAlpha = 1

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
},
2727
"homepage": "https://github.com/liriliri/eruda-fps#readme",
2828
"devDependencies": {
29-
"eruda": "1.5.8",
29+
"eruda": "^2.0.0",
3030
"eslint": "^4.8.0",
3131
"eslint-config-prettier": "^6.1.0",
3232
"nws": "^1.1.1",
33+
"prettier": "^1.19.1",
3334
"uglify-js": "^3.1.3"
3435
}
3536
}

0 commit comments

Comments
 (0)