Skip to content

Commit

Permalink
fixes to ResetActivity and some fixes to the web page
Browse files Browse the repository at this point in the history
  • Loading branch information
be195 committed Apr 1, 2024
1 parent 6c83f9d commit adf88d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class Artboard {
this.processReceivedMessage = this.processReceivedMessage.bind(this);

window.addEventListener('resize', this.onResize);
document.addEventListener('mouseup', this.onMouseUp);
this.canvas.addEventListener('mouseup', this.onMouseUp);
this.canvas.addEventListener('mouseout', this.onMouseUp);
this.canvas.addEventListener('mousedown', this.onMouseDown);
this.canvas.addEventListener('mousemove', this.onMouseMove);
this.canvas.addEventListener('wheel', this.onWheel);
Expand Down Expand Up @@ -208,7 +209,7 @@ class Artboard {
const { diff, steamId } = /** @type {ImageUpdate} */ data;
for (const position in diff) {
const color = diff[position] - 1;
const xy = parseInt(position);
const xy = +position;
this.data.steamIDs[xy] = steamId;
this.data.image[xy] = color;
}
Expand Down Expand Up @@ -372,7 +373,9 @@ class Artboard {
this.nickname.href = `https://steamcommunity.com/profiles/${steamId}`;

const color = this.data.image[xy];
this.avatar.style.outlineColor = 'rgb(' + this.data.palette[color].join(',') + ')';
this.avatar.style.outlineColor = color === -1 ?
'rgb(' + this.data.palette[color] + ')' :
'transparent';
this.avatar.src = res.avatar;
} else if (!this.lock)
this.info.classList.add('hidden');
Expand Down
5 changes: 3 additions & 2 deletions assets/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,19 @@ a {
flex-direction: row;
gap: 1em;
align-items: center;
opacity: 0.6;
opacity: 0.8;
z-index: 998;
pointer-events: none;
}

.info.locked {
opacity: 1;
transform: translate(-50%, -100%);
pointer-events: all;
}

.info.hidden {
opacity: 0;
pointer-events: none;
transform: translate(-50%, -150%);
}

Expand Down
2 changes: 1 addition & 1 deletion src/activities/ResetActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BaseActivity from './BaseActivity';
import { WEBSOCKET_EVENTS } from '../types';

export default class ResetActivity extends BaseActivity {
public rule = '* * 1,15 * *';
public rule = '0 0 1,15 * *';

public async run() {
const { Game, Web } = this.application.structures;
Expand Down

0 comments on commit adf88d5

Please sign in to comment.