summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-08-11 02:10:39 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-08-11 02:10:39 +0900
commit009ffef942dc82274fec45fabe36c177aac41398 (patch)
tree002174e394c14842e662c63f607cf0f638dcedfe /src/web
parentRefactor (diff)
downloadsharkey-009ffef942dc82274fec45fabe36c177aac41398.tar.gz
sharkey-009ffef942dc82274fec45fabe36c177aac41398.tar.bz2
sharkey-009ffef942dc82274fec45fabe36c177aac41398.zip
#630
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/tags/activity-table.tag9
-rw-r--r--src/web/app/desktop/tags/home-widgets/activity.tag9
2 files changed, 14 insertions, 4 deletions
diff --git a/src/web/app/common/tags/activity-table.tag b/src/web/app/common/tags/activity-table.tag
index 2ecfc3b110..29eb69f036 100644
--- a/src/web/app/common/tags/activity-table.tag
+++ b/src/web/app/common/tags/activity-table.tag
@@ -40,10 +40,15 @@
let x = 0;
data.reverse().forEach(d => {
d.x = x;
+ d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay();
+
d.v = d.total / this.peak;
if (d.v > 1) d.v = 1;
- d.color = `hsl(170, ${d.v * 100}%, ${15 + ((1 - d.v) * 80)}%)`;
- d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay();
+ const ch = d.date.weekday == 0 || d.date.weekday == 6 ? 30 : 170;
+ const cs = d.v * 100;
+ const cl = 15 + ((1 - d.v) * 80);
+ d.color = `hsl(${ch}, ${cs}%, ${cl}%)`;
+
if (d.date.weekday == 6) x++;
});
this.update({ data });
diff --git a/src/web/app/desktop/tags/home-widgets/activity.tag b/src/web/app/desktop/tags/home-widgets/activity.tag
index 29ce8760fd..294650a487 100644
--- a/src/web/app/desktop/tags/home-widgets/activity.tag
+++ b/src/web/app/desktop/tags/home-widgets/activity.tag
@@ -123,10 +123,15 @@
let x = 0;
this.data.reverse().forEach(d => {
d.x = x;
+ d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay();
+
d.v = d.total / (peak / 2);
if (d.v > 1) d.v = 1;
- d.color = `hsl(170, ${d.v * 100}%, ${15 + ((1 - d.v) * 80)}%)`;
- d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay();
+ const ch = d.date.weekday == 0 || d.date.weekday == 6 ? 30 : 170;
+ const cs = d.v * 100;
+ const cl = 15 + ((1 - d.v) * 80);
+ d.color = `hsl(${ch}, ${cs}%, ${cl}%)`;
+
if (d.date.weekday == 6) x++;
});
</script>