@vbansal67/ip 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/IP.html +57 -0
  2. package/package.json +11 -0
package/IP.html ADDED
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>IP Checker via Cloudflare Backend</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ height: 100vh;
14
+ margin: 0;
15
+ background-color: #fafafa;
16
+ }
17
+ .card {
18
+ text-align: center;
19
+ padding: 30px;
20
+ background: white;
21
+ border-radius: 8px;
22
+ box-shadow: 0 4px 10px rgba(0,0,0,0.05);
23
+ }
24
+ #ip {
25
+ font-size: 24px;
26
+ font-weight: bold;
27
+ color: #ff6b6b;
28
+ margin-top: 10px;
29
+ }
30
+ </style>
31
+ </head>
32
+ <body>
33
+
34
+ <div class="card">
35
+ <h2>Your IP Address</h2>
36
+ <!-- This text will update once the Cloudflare backend responds -->
37
+ <div id="ip">Loading...</div>
38
+ </div>
39
+
40
+ <script>
41
+ // REPLACE THIS URL WITH YOUR LIVE CLOUDFLARE WORKER URL
42
+ const BACKEND_URL = "https://dawn-salad-6ee1.vihaanb0715.workers.dev/";
43
+
44
+ // Fetch the JSON payload from your backend
45
+ fetch(BACKEND_URL)
46
+ .then(response => response.json())
47
+ .then(data => {
48
+ document.getElementById('ip').innerText = data.ip;
49
+ })
50
+ .catch(error => {
51
+ console.error('Error fetching IP:', error);
52
+ document.getElementById('ip').innerText = "Failed to load";
53
+ });
54
+ </script>
55
+
56
+ </body>
57
+ </html>
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@vbansal67/ip",
3
+ "version": "1.0.0",
4
+ "description": "IP",
5
+ "main": "IP.html",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "MIT"
11
+ }