diff --git a/.gitignore b/.gitignore index 3c3629e..f06235c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +dist diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 177a868..c36daa9 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -53,6 +53,19 @@ Cypress.Commands.add("disableTransitions", () => { } `; document.head.appendChild(style); + + // Flag to disable Framer Motion + if (window.framerMotionTestOverride) return; + window.framerMotionTestOverride = true; + window.originalRequestAnimationFrame = window.requestAnimationFrame; + + window.requestAnimationFrame = (callback) => { + return window.setTimeout(() => { + if (callback) callback(0); + }, 0); + }; + + document.body.setAttribute("data-cy-animations-disabled", "true"); }); }); @@ -62,5 +75,17 @@ Cypress.Commands.add("enableTransitions", () => { if (styleElement) { styleElement.remove(); } + + // Remove flags for Framer Motion + if (window.framerMotionTestOverride) { + window.framerMotionTestOverride = false; + + if (window.originalRequestAnimationFrame) { + window.requestAnimationFrame = window.originalRequestAnimationFrame; + delete window.originalRequestAnimationFrame; + } + } + + document.body.removeAttribute("data-cy-animations-disabled"); }); }); diff --git a/index.html b/index.html index cfdbbba..a98b290 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
- +- HCL ({roundTo(state.color.hcl.h, 0)}, {roundTo(state.color.hcl.c, 2)},{" "} - {roundTo(state.color.hcl.l, 2)}) + HCL ({roundTo(state.color.hcl.h, 0, "down")},{" "} + {roundTo(state.color.hcl.c, 2, "down")},{" "} + {roundTo(state.color.hcl.l, 2, "down")})
- HSV ({roundTo(state.color.hsv.h, 0)}, {roundTo(state.color.hsv.s, 2)},{" "} - {roundTo(state.color.hsv.v, 2)}) + HSV ({roundTo(state.color.hsv.h, 0, "down")},{" "} + {roundTo(state.color.hsv.s, 2, "down")},{" "} + {roundTo(state.color.hsv.v, 2, "down")})
- RGB ({roundTo(state.color.rgb.r, 0)}, {roundTo(state.color.rgb.g, 0)},{" "} - {roundTo(state.color.rgb.b, 0)}) + RGB ({roundTo(state.color.rgb.r, 0, "down")},{" "} + {roundTo(state.color.rgb.g, 0, "down")},{" "} + {roundTo(state.color.rgb.b, 0, "down")})
HEX: #{state.color.hex.to_code()}