Skip to content

Instantly share code, notes, and snippets.

@ZachSaucier
Created December 4, 2023 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZachSaucier/ea8ebf65079febbde4f2f9190ae6644a to your computer and use it in GitHub Desktop.
Save ZachSaucier/ea8ebf65079febbde4f2f9190ae6644a to your computer and use it in GitHub Desktop.
devtools-detect console.info animation setup
<script type="module" defer>
import devtools from '/devtools-detect.js';
const consoleInfoAnimation = () => {
// console.info animation here
};
const handleDevtoolsChange = (e) => {
if (e.detail.isOpen) {
consoleInfoAnimation();
window.removeEventListener('devtoolschange', handleDevtoolsChange);
}
};
if (devtools.isOpen) {
consoleInfoAnimation();
} else {
window.addEventListener('devtoolschange', handleDevtoolsChange);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment