added condition to pass the tests

This commit is contained in:
Enelg52 2024-05-26 11:18:43 +02:00
parent 7efbee0646
commit 8f1496cebe
2 changed files with 27 additions and 4 deletions

View File

@ -97,10 +97,12 @@ export const time = signal(id);
*/
let _mouseY = 0,
_mouseX = 0;
document.onmousemove = (e) => {
_mouseY = e.clientY / document.body.clientHeight;
_mouseX = e.clientX / document.body.clientWidth;
};
if (typeof window !== 'undefined') {
document.onmousemove = (e) => {
_mouseY = e.clientY / document.body.clientHeight;
_mouseX = e.clientX / document.body.clientWidth;
};
}
export const mousey = signal(() => _mouseY);
export const mousex = signal(() => _mouseX);

View File

@ -565,6 +565,27 @@ exports[`runs examples > example "_euclidRot" example index 20 1`] = `
]
`;
exports[`runs examples > example "_mouseY" example index 0 1`] = `
[
"[ 0/1 → 1/4 | note:C3 ]",
"[ 1/4 → 1/2 | note:C3 ]",
"[ 1/2 → 3/4 | note:C3 ]",
"[ 3/4 → 1/1 | note:C3 ]",
"[ 1/1 → 5/4 | note:C3 ]",
"[ 5/4 → 3/2 | note:C3 ]",
"[ 3/2 → 7/4 | note:C3 ]",
"[ 7/4 → 2/1 | note:C3 ]",
"[ 2/1 → 9/4 | note:C3 ]",
"[ 9/4 → 5/2 | note:C3 ]",
"[ 5/2 → 11/4 | note:C3 ]",
"[ 11/4 → 3/1 | note:C3 ]",
"[ 3/1 → 13/4 | note:C3 ]",
"[ 13/4 → 7/2 | note:C3 ]",
"[ 7/2 → 15/4 | note:C3 ]",
"[ 15/4 → 4/1 | note:C3 ]",
]
`;
exports[`runs examples > example "accelerate" example index 0 1`] = `
[
"[ 0/1 → 2/1 | s:sax accelerate:0 ]",