Skip to content

Instantly share code, notes, and snippets.

@StefanNieuwenhuis
Last active April 12, 2019 14:30
Show Gist options
  • Save StefanNieuwenhuis/91b79c101c89745dd6cd5ae10fa55f87 to your computer and use it in GitHub Desktop.
Save StefanNieuwenhuis/91b79c101c89745dd6cd5ae10fa55f87 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Stencil Component Starter</title>
<script src="/build/mycomponent.js"></script>
</head>
<body>
<my-component id="modal">
<h1>Hello world!</h1>
<div>Is it me you're looking for?</div>
</my-component>
<button id="open-modal">Open Modal</button>
<script>
const modal = document.getElementById('modal');
const open = document.getElementById('open-modal');
open.onclick = () => {
modal.open = true;
};
modal.addEventListener('click', () => {
modal.open = false;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment