Skip to content

Instantly share code, notes, and snippets.

@ShilpaLalwani
Last active April 15, 2020 06:39
Show Gist options
  • Save ShilpaLalwani/b8a5346dea5ffb2e5483b186471f2381 to your computer and use it in GitHub Desktop.
Save ShilpaLalwani/b8a5346dea5ffb2e5483b186471f2381 to your computer and use it in GitHub Desktop.
<custom-card
title="Custom Element"
sub-title="Donna Marshall"
caption="Lorem ipsum dolor sit, amet consectetur adipisicing elit."
avtar="https://uinames.com/api/photos/female/15.jpg"
image="https://images.pexels.com/photos/169193/pexels-photo-169193.jpeg?w=940&h=650&auto=compress&cs=tinysrgb"
>
</custom-card>
<script>
const el = document.querySelector('custom-card');
el.addEventListener('likeNotify', e => {
console.log('Like Cliked');
});
el.addEventListener('shareNotify', e => {
console.log('Share Cliked');
});
el.addEventListener('learnMoreNotify', e => {
console.log('learn more Cliked');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment