// Get references to the pop-up container and close button // Function to calculate the difference in days between two timestamps // Function to show or hide the popup based on visit history and closing action // Check if the popup has been closed before const popupClosed = localStorage.getItem('popupClosed'); // Boolean value stored as string // If the popup hasn't been closed, show it immediately popupContainer.style.display = 'flex'; // Show the pop-up sliderAdvertisement.style.display = 'none'; // Hide the slider while the pop-up is shown }, 5000); // Show after 5 seconds // Now apply the timing logic after the user has closed the popup // Calculate the days since the popup was last shown let showPopup = false; // Flag to track whether we should show the popup // Determine if the popup should be shown: // - First time visit (no lastShown value) // - Shown once per day for 3 days // - After 3 days, show every 3 days popupData.lastShown === null || // First time visitor (popupData.timesShown < 3 && daysSinceLastShown >= 1) || // Show once a day for first 3 days (popupData.timesShown >= 3 && daysSinceLastShown >= 3) // Show once every 3 days afterward showPopup = true; // The popup should be shown // Show the popup after 5 seconds popupContainer.style.display = 'flex'; // Show the pop-up sliderAdvertisement.style.display = 'none'; // Hide the slider while the pop-up is shown // Update popupData and store it // Show the slider if the popup is not shown // Ensure elements exist before using them // Call the function to handle popup display logic // Add click event listener to the close button popupContainer.style.display = 'none'; // Hide the pop-up sliderAdvertisement.style.display = 'flex'; // Show the slider advertisement when pop-up is closed localStorage.setItem('popupClosed', true); // Set popup as closed in localStorage // Reset timing logic after the popup is closed timesShown: 0 // Reset counter for daily/3-day logic

Sort by

CrowdSwap, world’s first price search engine for cryptocurrencies launches

The trading of cryptocurrencies in so-called decentralized financial markets (DeFi) based on blockchains and smart

News and Updates

How CrowdSwap helps to solve the problems of today’s Decentralized Finance (Defi)

News and Updates

Report from the engine room of CrowdSwap I

MANA Price Prediction
Crypto Basics

MANA Price Prediction

In the realm of cryptocurrencies, few have captured the imagination quite like MANA (Decentraland). As a virtual reality platform built

CrowdSwap Partners with MoneyFoxx: Empowering the Crypto Community Together
News and Updates

CrowdSwap Partners with MoneyFoxx

CrowdSwap Partners with MoneyFoxx: Empowering the Crypto Community Together CrowdSwap, an industry-leading decentralized exchange, is pleased to announce its strategic

What Happened in May
Monthly Highlights

What Happened in May

As we seal off May, the month of growth, we’re happy to report that it was not a stale springtime.

What is zkSync
Crypto Basics

What is zkSync?

In the crypto world, layer-2 protocols or scaling solutions take on the role of sidekicks to the main blockchain as

ADA Price Prediction
Crypto Basics

ADA Price Prediction

Welcome to a riveting discussion about the captivating world of Cardano and its native token, ADA! Cardano, a proof-of-stake blockchain

CrowdSwap Partners with KyberSwap
News and Updates

CrowdSwap Partners with KyberSwap

CrowdSwap x KyberSwap: A Powerful Partnership for Liquidity and Cross-Chain Swaps on zkSync At CrowdSwap, we take pride in our

CrowdSwap partners with Work X
News and Updates

CrowdSwap partners with Work X

We are thrilled to unveil our upcoming pre-sale token event in partnership with Work X,  a decentralized and cost-based job

Stay tuned with CrowdSwap Newsletter

No worries, we will never spam you. Join now and stay up to date on defi

CrowdSwap Newsletter

Ready to Supercharge Your Financial Knowledge?

Drop your email, and we'll deliver the Ultimate DeFi Guide straight to your inbox! πŸš€