Skip to content

Commit

Permalink
updates ads to work smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
edelstone committed Sep 22, 2024
1 parent c07c46a commit 114b43a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ <h2>Export palette</h2>
<script src="/js/main.js" defer></script>
<script src="/js/export.js" defer></script>
<script>
// Show a new Carbon ad every time when certain elements are clicked
// Show a new Carbon ad when certain elements are clicked
document.addEventListener('click', function (event) {
if (event.target.matches('.color-palette__cell, .utility-panel__color-entry, .color-picker, .exportButton, .carbon-img, .carbon-text, .carbon-poweredby')) {
if (event.target.matches('.utility-panel__ripple, .exportButton')) {
// If the ad hasn't loaded yet, don't refresh it while it's still loading, or it will return two (or more) ads
if (!document.getElementById('carbonads')) return;
// If the script hasn't loaded, don't try calling it
Expand Down

0 comments on commit 114b43a

Please sign in to comment.