<!– wp:html –>
<script src=”https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js”></script>

<style>
header, footer, .site-header, .site-footer, .elementor-header, .elementor-footer, .wp-block-cover, .page-header {
display: none !important;
}
#container {
background: white;
padding: 30px 40px;
border-radius: 12px;
max-width: 100%;
text-align: center;
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
h4 {
color: #333;
margin-bottom: 20px;
}
p {
font-size: 16px;
color: #555;
margin: 12px 0;
}
a.button-whatsapp {
display: inline-block;
background: #25D366;
color: white !important;
text-decoration: none;
padding: 12px 25px;
border-radius: 6px;
font-weight: bold;
margin-top: 20px;
transition: background 0.3s ease;
}
a.button-whatsapp:hover {
background: #1ebe57;
}
#progress-bar {
margin-top: 30px;
width: 100%;
height: 16px;
background: #ddd;
border-radius: 8px;
overflow: hidden;
}
#progress {
height: 100%;
width: 0;
background: #8a3ffc;
border-radius: 8px;
transition: width 0.5s ease;
}
</style>

<div id=”container”>
<h4 id=”greeting”>Checking access…</h4>
<div id=”message”></div>
<div id=”progress-bar” style=”display:none;”>
<div id=”progress”></div>
</div>
<div id=”whatsapp-link”></div>
</div>

<script>
(function() {
const greeting = document.getElementById(‘greeting’);
const messageDiv = document.getElementById(‘message’);
const whatsappDiv = document.getElementById(‘whatsapp-link’);
const progressBar = document.getElementById(‘progress-bar’);
const progress = document.getElementById(‘progress’);

const canvaJoinLink = “https://www.canva.com/brand/join?token=USC4riAgv_EB0UFQsyKNsw&brandingVariant=edu&referrer=team-invite”;
const storageKey = “canva_access_used_v3”;

// 🔒 Already used check
if (localStorage.getItem(storageKey) === “used”) {
greeting.textContent = “Link Already Used ⚠️”;
messageDiv.innerHTML = `
<p>You already used this link.</p>
<p>You can’t use this link again.</p>
<p>Please contact admin for further help.</p>
`;
whatsappDiv.innerHTML = `
<a
href=”https://wa.me/8801335818214?text=${encodeURIComponent(‘Hi, I already used my Canva Pro activation link but need help.’)}”
target=”_blank” class=”button-whatsapp”>
Message Admin on WhatsApp
</a>
`;
return;
}

// ✅ First-time access: run animation & redirect
greeting.textContent = `Hi there 👋`;
const steps = [
“Requesting Canva…”,
“Activating your premium access…”,
“Finalizing setup…”,
“Redirecting to Canva…”
];
let stepIndex = 0;
progressBar.style.display = ‘block’;
messageDiv.innerHTML = “”;

function animateSteps() {
if (stepIndex < steps.length) {
messageDiv.innerHTML = `<p>${steps[stepIndex]}</p>`;
progress.style.width = `${((stepIndex + 1) / steps.length) * 100}%`;
stepIndex++;
setTimeout(animateSteps, 1800);
} else {
// ✅ Mark as used only after animation finishes
localStorage.setItem(storageKey, “used”);
setTimeout(() => {
window.location.href = canvaJoinLink;
}, 1000);
}
}

animateSteps();

})();
</script>
<!– /wp:html –>

<!– wp:paragraph –>
<p></p>
<!– /wp:paragraph –>