Skip to content

Commit

Permalink
Update helpers.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakarialabib committed Nov 11, 2023
1 parent cc29763 commit 81dacec
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions resources/js/helpers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,4 @@ const share = function () {
}
};

share();

const addAffiliateLink = function () {
const articleContent = document.getElementById('content');

if (!articleContent) {
return;
}

const pTags = document.getElementById('content').querySelectorAll('p');
let i = 0;
pTags.forEach((p) => {
if (i === 7) {
const a = document.createElement('a');
a.setAttribute('href', 'https://www.digitalocean.com/?refcode=d6dca1691fb4&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge');
a.setAttribute('target', '_blank');
a.classList.add('relative', 'affiliate', 'block', 'w-full', 'mb-6', 'overflow-hidden', 'rounded-lg', 'cursor-pointer');
a.innerHTML = `
<img src="/images/affiliate-link.jpg" class="w-full rounded-t-lg" alt="Affiliate link" />
<span class="block w-full h-auto px-3 py-2 font-bold text-center text-white uppercase text-xs bg-gradient-to-r from-green-500 via-indigo-600 to-blue-500">Obtenez le code gratuit en créant votre serveur 🚀</span>
`;
p.parentNode.insertBefore(a, p.nextSibling);
}
i++;
});
};

addAffiliateLink();
share();

0 comments on commit 81dacec

Please sign in to comment.