Skip to content

Commit

Permalink
Update images.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongl committed Jul 19, 2024
1 parent 2c211b5 commit 1beeb67
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 12 deletions.
Binary file modified mpb-activities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mpb-activity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mpb-workout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/mpb-activities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/mpb-activity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/mpb-workout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/workout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions src/inject/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ observe(document.querySelector("div.main-body"), onMutated({
callback: () => {
const prs = [...document.querySelectorAll("td i.icon-pointer-right")].map(p => p.click());
const active = document.querySelector('span[data-value="ACTIVE"]');
if (prs.length == 0 && active != null) {
if (prs.length == 0 && active != null && document.querySelector('div[data-activity-type="running"]') != null) {
flag = false;
const data = intervals(active.innerText);

if (document.querySelector('div[data-activity-type="running"]') != null) {
Plotly.newPlot(
plotPanel("trend", n => document.querySelector("div.activity-map").before(n)),
intervals(active.innerText),
{ title: "速心比变化趋势", height: 200, margin: { l: 50, r: 50, b: 50, t: 50, pad: 4 } },
{ responsive: true, displayModeBar: false }
);
}
console.assert(data.length > 0, `active: ${active.innerText}, rows: ${document.querySelectorAll('tr[class^="IntervalsTable_tableRow"]').length}`);

Plotly.newPlot(
plotPanel("trend", n => document.querySelector("div.activity-map").before(n)),
data,
{ title: "速心比变化趋势", height: 200, margin: { l: 50, r: 50, b: 50, t: 50, pad: 4 } },
{ responsive: true, displayModeBar: false }
);
}
}
}));
Expand All @@ -30,9 +31,8 @@ function intervals(label) {
return [lap, speed, gas, hr, c, d];
}
const rows = nodes.filter(pred).map(extract);
console.log(label);
const detail = ([, speed, gas, hr, c, d]) =>
[unit(hr, "bpm"), unit(c, "cpm"), unit(speed, "km"), unit(gas, "km"), unit(d, "km")].join("<br>");
[unit(hr, "bpm"), unit(c, "cpm"), unit(speed, "/km"), unit(gas, "/km"), unit(d, "km")].join("<br>");
return [{
y: rows.map(metersPerBeat),
x: rows.map(([lap]) => Number(lap)),
Expand Down
3 changes: 2 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"manifest_version": 3,
"name": "Meters Per Beat",
"version": "1.0",
"description": "Calculate and analyse running performance from garmin data.",
"description": "Calculate and analyse running performance from connect.garmin.cn.",
"icons": {
"16": "icons/16x16.png",
"32": "icons/32x32.png",
"128": "icons/128x128.png",
"180": "icons/180x180.png",
"192": "icons/192x192.png",
"512": "icons/512x512.png"
Expand Down

0 comments on commit 1beeb67

Please sign in to comment.