-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (35 loc) · 1.33 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crypto Wallet Ads</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<div class="content">
<h1 class="title">Crypto Wallet Ads</h1>
<button id="connectWalletButton">Connect Wallet</button>
<div id="ad-container" hidden>
<button class="close-btn" onclick="document.getElementById('ad-container').hidden = true">×</button>
<p id="ad-message">Discover rare NFTs on Marketplace Y!</p>
<button class="cta-btn" onclick="window.open('https://example.com', '_blank')">Learn More</button>
</div>
</div>
</div>
<script>
document.getElementById("connectWalletButton").addEventListener("click", async () => {
try {
const response = await fetch('https://crypto-wallet-ads.onrender.com/api/ads'); // Call Render backend
const data = await response.json();
document.getElementById("ad-message").textContent = data.ad.message; // Update ad message
document.getElementById("ad-container").hidden = false;
} catch (error) {
console.error("Error fetching ad:", error);
alert("Failed to load ad. Please try again later.");
}
});
</script>
</body>
</html>