Common.js
Revision as of 16:57, 5 July 2024 by Wikipatents (talk | contribs) (Created page with "(function() { // Create and append styles var style = document.createElement('style'); style.textContent = ` .patent-popup { position: fixed;...")
(function() {
// Create and append styles var style = document.createElement('style'); style.textContent = ` .patent-popup { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.1); background-color: #f8f9fa; padding: 20px; border-radius: 10px; box-shadow: 0 5px 30px rgba(0,0,0,0.3); width: 300px; opacity: 0; transition: all 0.3s ease-in-out; z-index: 1000; } .patent-popup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); } .patent-popup h2 { margin-top: 0; color: #333; } .patent-popup p { color: #666; } .patent-cta-button { display: block; width: 100%; padding: 10px; background-color: #007bff; color: white; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; transition: background-color 0.2s; } .patent-cta-button:hover { background-color: #0056b3; } `; document.head.appendChild(style);
// Create popup element var popup = document.createElement('div'); popup.className = 'patent-popup'; popup.innerHTML = `
Patent Application Monitoring
Want to monitor Patent Applications? Submit your custom request and get a free weekly report!
<button class="patent-cta-button">Get Alerts</button> `; document.body.appendChild(popup);
// Show popup after a short delay setTimeout(function() { popup.classList.add('show'); }, 1000);
// Add click event to the CTA button popup.querySelector('.patent-cta-button').addEventListener('click', function() { window.open('https://docs.google.com/forms/d/e/1FAIpQLSfvGeHyDW-ND9TqqVhbPOrYsKWsvUgFp9Rl-gfsyZCaLp7fXA/viewform?usp=sf_link', '_blank'); popup.classList.remove('show'); });
})();