Skip to content

Instantly share code, notes, and snippets.

@macro6461
Created January 18, 2023 20:31
Show Gist options
  • Save macro6461/6a54621a199a4713a6c782ac98f10839 to your computer and use it in GitHub Desktop.
Save macro6461/6a54621a199a4713a6c782ac98f10839 to your computer and use it in GitHub Desktop.
JavaScript pertaining to popup blog post
const constructPopup = () => {
// propbably not the most efficient solution to hiding the popup
// but the code is here if for whatever reason you might want to use it
document.body.innerHTML += popupString;
}
const popupString = `
<div class="popup outer">
<div class="popup inner">
<button class="close">x</button>
<img src="giphy.gif"/>
<h3>Here is your popop!</h3>
<p>If you liked this tool, please leave a tip or follow me on Medium!</p>
<p>Thanks for using the custom popup!</p>
<a href="https://paypal.me/mattcroak?country.x=US&amp;locale.x=en_US" target="_blank">Paypal</a>
<a href="https://matt-croak.medium.com/membership" target="_blank">Medium</a>
</div>
<!-- uncomment below to use with full screen popup -->
<!-- <div class="background-mask"></div> -->
</div>
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment