bbc123321 commited on
Commit
ddb34b2
·
verified ·
1 Parent(s): f379074

Make a web browser that can load any website and can run as a proxy to unblock websites.

Browse files
Files changed (7) hide show
  1. README.md +8 -5
  2. components/navbar.js +97 -0
  3. components/proxy-form.js +127 -0
  4. components/quick-links.js +116 -0
  5. index.html +62 -19
  6. script.js +38 -0
  7. style.css +15 -19
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Proxypirate Browser
3
- emoji: 🐢
4
- colorFrom: pink
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: ProxyPirate Browser 🏴‍☠️
3
+ colorFrom: blue
4
+ colorTo: pink
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
components/navbar.js ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ width: 100%;
9
+ background-color: rgba(17, 24, 39, 0.95);
10
+ backdrop-filter: blur(8px);
11
+ position: sticky;
12
+ top: 0;
13
+ z-index: 50;
14
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
15
+ }
16
+ .nav-container {
17
+ max-width: 100%;
18
+ margin: 0 auto;
19
+ padding: 0.75rem 1rem;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: space-between;
23
+ }
24
+ .logo {
25
+ display: flex;
26
+ align-items: center;
27
+ font-weight: 700;
28
+ font-size: 1.25rem;
29
+ }
30
+ .logo-icon {
31
+ margin-right: 0.5rem;
32
+ color: #60a5fa;
33
+ }
34
+ .nav-items {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 1rem;
38
+ }
39
+ .nav-link {
40
+ display: flex;
41
+ align-items: center;
42
+ padding: 0.5rem 1rem;
43
+ border-radius: 0.375rem;
44
+ transition: all 0.2s;
45
+ color: rgba(156, 163, 175, 1);
46
+ font-weight: 500;
47
+ }
48
+ .nav-link:hover {
49
+ color: white;
50
+ background-color: rgba(31, 41, 55, 0.5);
51
+ }
52
+ .proxy-indicator {
53
+ display: flex;
54
+ align-items: center;
55
+ padding: 0.25rem 0.75rem;
56
+ border-radius: 9999px;
57
+ background-color: rgba(59, 130, 246, 0.1);
58
+ color: #60a5fa;
59
+ font-size: 0.875rem;
60
+ margin-right: 1rem;
61
+ }
62
+ .proxy-icon {
63
+ margin-right: 0.25rem;
64
+ width: 0.875rem;
65
+ height: 0.875rem;
66
+ }
67
+ </style>
68
+ <div class="nav-container">
69
+ <a href="/" class="logo">
70
+ <i data-feather="anchor" class="logo-icon"></i>
71
+ ProxyPirate
72
+ </a>
73
+
74
+ <div class="nav-items">
75
+ <div class="proxy-indicator hidden">
76
+ <i data-feather="shield" class="proxy-icon"></i>
77
+ Proxy Active
78
+ </div>
79
+ <a href="#" class="nav-link">
80
+ <i data-feather="home" class="mr-2"></i>
81
+ Home
82
+ </a>
83
+ <a href="#" class="nav-link">
84
+ <i data-feather="settings" class="mr-2"></i>
85
+ Settings
86
+ </a>
87
+ <a href="#" class="nav-link">
88
+ <i data-feather="help-circle" class="mr-2"></i>
89
+ Help
90
+ </a>
91
+ </div>
92
+ </div>
93
+ `;
94
+ }
95
+ }
96
+
97
+ customElements.define('custom-navbar', CustomNavbar);
components/proxy-form.js ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomProxyForm extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ }
9
+ .form-container {
10
+ background-color: rgba(31, 41, 55, 0.8);
11
+ border-radius: 0.75rem;
12
+ padding: 1.5rem;
13
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
14
+ }
15
+ .form-title {
16
+ font-size: 1.125rem;
17
+ font-weight: 600;
18
+ margin-bottom: 1rem;
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+ .form-icon {
23
+ margin-right: 0.5rem;
24
+ color: #60a5fa;
25
+ }
26
+ .input-group {
27
+ display: flex;
28
+ gap: 0.5rem;
29
+ }
30
+ .url-input {
31
+ flex: 1;
32
+ padding: 0.75rem 1rem;
33
+ border-radius: 0.5rem;
34
+ background-color: rgba(55, 65, 81, 0.8);
35
+ border: 1px solid rgba(75, 85, 99, 0.5);
36
+ color: white;
37
+ outline: none;
38
+ transition: border-color 0.2s;
39
+ }
40
+ .url-input:focus {
41
+ border-color: #60a5fa;
42
+ }
43
+ .proxy-toggle {
44
+ display: flex;
45
+ align-items: center;
46
+ margin-top: 1rem;
47
+ }
48
+ .toggle-label {
49
+ margin-left: 0.5rem;
50
+ font-size: 0.875rem;
51
+ color: rgba(156, 163, 175, 1);
52
+ }
53
+ .submit-btn {
54
+ background-color: #3b82f6;
55
+ color: white;
56
+ padding: 0.75rem 1.5rem;
57
+ border-radius: 0.5rem;
58
+ font-weight: 600;
59
+ border: none;
60
+ cursor: pointer;
61
+ transition: background-color 0.2s;
62
+ }
63
+ .submit-btn:hover {
64
+ background-color: #2563eb;
65
+ }
66
+ </style>
67
+ <div class="form-container">
68
+ <h3 class="form-title">
69
+ <i data-feather="navigation" class="form-icon"></i>
70
+ Browse Anywhere
71
+ </h3>
72
+
73
+ <div class="input-group">
74
+ <input
75
+ type="text"
76
+ class="url-input"
77
+ placeholder="Enter URL (e.g. https://example.com)"
78
+ id="url-input"
79
+ >
80
+ <button class="submit-btn" id="submit-btn">
81
+ Go
82
+ </button>
83
+ </div>
84
+
85
+ <div class="proxy-toggle">
86
+ <input type="checkbox" id="proxy-toggle" class="rounded">
87
+ <label for="proxy-toggle" class="toggle-label">
88
+ Use Proxy Server
89
+ </label>
90
+ </div>
91
+ </div>
92
+ `;
93
+
94
+ // Add event listeners
95
+ const submitBtn = this.shadowRoot.getElementById('submit-btn');
96
+ const urlInput = this.shadowRoot.getElementById('url-input');
97
+ const proxyToggle = this.shadowRoot.getElementById('proxy-toggle');
98
+
99
+ const handleSubmit = () => {
100
+ let url = urlInput.value.trim();
101
+
102
+ // Add https:// if not present
103
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
104
+ url = 'https://' + url;
105
+ }
106
+
107
+ // Dispatch custom event
108
+ this.dispatchEvent(new CustomEvent('proxy-submit', {
109
+ detail: {
110
+ url: url,
111
+ useProxy: proxyToggle.checked
112
+ },
113
+ bubbles: true,
114
+ composed: true
115
+ }));
116
+ };
117
+
118
+ submitBtn.addEventListener('click', handleSubmit);
119
+ urlInput.addEventListener('keypress', (e) => {
120
+ if (e.key === 'Enter') {
121
+ handleSubmit();
122
+ }
123
+ });
124
+ }
125
+ }
126
+
127
+ customElements.define('custom-proxy-form', CustomProxyForm);
components/quick-links.js ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomQuickLinks extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ :host {
7
+ display: block;
8
+ }
9
+ .quick-links-container {
10
+ background-color: rgba(31, 41, 55, 0.8);
11
+ border-radius: 0.75rem;
12
+ padding: 1.5rem;
13
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
14
+ }
15
+ .links-title {
16
+ font-size: 1.125rem;
17
+ font-weight: 600;
18
+ margin-bottom: 1rem;
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+ .links-icon {
23
+ margin-right: 0.5rem;
24
+ color: #60a5fa;
25
+ }
26
+ .links-grid {
27
+ display: grid;
28
+ grid-template-columns: repeat(2, 1fr);
29
+ gap: 0.75rem;
30
+ }
31
+ .link-item {
32
+ display: flex;
33
+ align-items: center;
34
+ padding: 0.75rem;
35
+ border-radius: 0.5rem;
36
+ background-color: rgba(55, 65, 81, 0.8);
37
+ transition: background-color 0.2s;
38
+ cursor: pointer;
39
+ }
40
+ .link-item:hover {
41
+ background-color: rgba(75, 85, 99, 0.8);
42
+ }
43
+ .link-icon {
44
+ margin-right: 0.75rem;
45
+ color: #60a5fa;
46
+ }
47
+ .link-text {
48
+ font-size: 0.875rem;
49
+ }
50
+ .proxy-badge {
51
+ margin-left: auto;
52
+ font-size: 0.625rem;
53
+ padding: 0.125rem 0.375rem;
54
+ border-radius: 9999px;
55
+ background-color: rgba(59, 130, 246, 0.1);
56
+ color: #60a5fa;
57
+ }
58
+ </style>
59
+ <div class="quick-links-container">
60
+ <h3 class="links-title">
61
+ <i data-feather="zap" class="links-icon"></i>
62
+ Quick Links
63
+ </h3>
64
+
65
+ <div class="links-grid">
66
+ <div class="link-item" data-url="https://www.google.com">
67
+ <i data-feather="search" class="link-icon"></i>
68
+ <span class="link-text">Google</span>
69
+ </div>
70
+ <div class="link-item" data-url="https://www.youtube.com" data-proxy="true">
71
+ <i data-feather="youtube" class="link-icon"></i>
72
+ <span class="link-text">YouTube</span>
73
+ <span class="proxy-badge">Proxy</span>
74
+ </div>
75
+ <div class="link-item" data-url="https://www.wikipedia.org">
76
+ <i data-feather="book" class="link-icon"></i>
77
+ <span class="link-text">Wikipedia</span>
78
+ </div>
79
+ <div class="link-item" data-url="https://www.reddit.com" data-proxy="true">
80
+ <i data-feather="message-square" class="link-icon"></i>
81
+ <span class="link-text">Reddit</span>
82
+ <span class="proxy-badge">Proxy</span>
83
+ </div>
84
+ <div class="link-item" data-url="https://www.twitter.com">
85
+ <i data-feather="twitter" class="link-icon"></i>
86
+ <span class="link-text">Twitter</span>
87
+ </div>
88
+ <div class="link-item" data-url="https://www.github.com">
89
+ <i data-feather="github" class="link-icon"></i>
90
+ <span class="link-text">GitHub</span>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ `;
95
+
96
+ // Add click handlers for quick links
97
+ const linkItems = this.shadowRoot.querySelectorAll('.link-item');
98
+ linkItems.forEach(item => {
99
+ item.addEventListener('click', () => {
100
+ const url = item.getAttribute('data-url');
101
+ const useProxy = item.hasAttribute('data-proxy');
102
+
103
+ this.dispatchEvent(new CustomEvent('quick-link-click', {
104
+ detail: {
105
+ url: url,
106
+ useProxy: useProxy
107
+ },
108
+ bubbles: true,
109
+ composed: true
110
+ }));
111
+ });
112
+ });
113
+ }
114
+ }
115
+
116
+ customElements.define('custom-quick-links', CustomQuickLinks);
index.html CHANGED
@@ -1,19 +1,62 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en" class="dark">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ProxyPirate Browser 🏴‍☠️</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <script src="components/navbar.js"></script>
12
+ <script src="components/proxy-form.js"></script>
13
+ <script src="components/quick-links.js"></script>
14
+ </head>
15
+ <body class="bg-gray-900 text-gray-100 min-h-screen">
16
+ <custom-navbar></custom-navbar>
17
+
18
+ <main class="container mx-auto px-4 py-8">
19
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
20
+ <div class="lg:col-span-2">
21
+ <div class="bg-gray-800 rounded-xl shadow-2xl overflow-hidden">
22
+ <iframe
23
+ id="browser-frame"
24
+ class="w-full h-[70vh] border-0"
25
+ sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
26
+ allowfullscreen
27
+ ></iframe>
28
+ </div>
29
+
30
+ <custom-proxy-form class="mt-6"></custom-proxy-form>
31
+ </div>
32
+
33
+ <div class="lg:col-span-1">
34
+ <custom-quick-links></custom-quick-links>
35
+
36
+ <div class="bg-gray-800 rounded-xl p-6 mt-6">
37
+ <h2 class="text-xl font-bold mb-4 flex items-center">
38
+ <i data-feather="shield" class="mr-2"></i> Privacy Tools
39
+ </h2>
40
+ <div class="space-y-3">
41
+ <a href="#" class="flex items-center text-blue-400 hover:text-blue-300">
42
+ <i data-feather="lock" class="mr-2"></i> VPN Settings
43
+ </a>
44
+ <a href="#" class="flex items-center text-blue-400 hover:text-blue-300">
45
+ <i data-feather="eye-off" class="mr-2"></i> Clear Tracking Cookies
46
+ </a>
47
+ <a href="#" class="flex items-center text-blue-400 hover:text-blue-300">
48
+ <i data-feather="user" class="mr-2"></i> Anonymous Mode
49
+ </a>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </main>
55
+
56
+ <script src="script.js"></script>
57
+ <script>
58
+ feather.replace();
59
+ </script>
60
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
61
+ </body>
62
+ </html>
script.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', () => {
2
+ const browserFrame = document.getElementById('browser-frame');
3
+ const proxyForm = document.querySelector('custom-proxy-form');
4
+
5
+ // Default page to load
6
+ loadUrl('https://www.google.com');
7
+
8
+ // Handle URL loading
9
+ function loadUrl(url, useProxy = false) {
10
+ browserFrame.classList.add('loading');
11
+
12
+ if (useProxy) {
13
+ // In a real implementation, this would route through your proxy server
14
+ const proxyUrl = `https://cors-anywhere.herokuapp.com/${url}`;
15
+ browserFrame.src = proxyUrl;
16
+ document.querySelector('.proxy-indicator').classList.remove('hidden');
17
+ } else {
18
+ browserFrame.src = url;
19
+ document.querySelector('.proxy-indicator').classList.add('hidden');
20
+ }
21
+
22
+ // Remove loading class when page is loaded
23
+ browserFrame.onload = () => {
24
+ browserFrame.classList.remove('loading');
25
+ };
26
+ }
27
+
28
+ // Handle proxy form submission
29
+ proxyForm.addEventListener('proxy-submit', (e) => {
30
+ const { url, useProxy } = e.detail;
31
+ loadUrl(url, useProxy);
32
+ });
33
+
34
+ // Handle quick link clicks
35
+ document.addEventListener('quick-link-click', (e) => {
36
+ loadUrl(e.detail.url, e.detail.useProxy);
37
+ });
38
+ });
style.css CHANGED
@@ -1,28 +1,24 @@
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
28
- }
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
2
+
3
  body {
4
+ font-family: 'Inter', sans-serif;
 
5
  }
6
 
7
+ #browser-frame.loading {
8
+ background: url('https://i.gifer.com/origin/b4/b4d657e7ef262b88eb5f7ac021edda87.gif') center center no-repeat;
9
+ background-size: 50px 50px;
10
  }
11
 
12
+ .proxy-indicator {
13
+ animation: pulse 2s infinite;
 
 
 
14
  }
15
 
16
+ @keyframes pulse {
17
+ 0% { opacity: 0.6; }
18
+ 50% { opacity: 1; }
19
+ 100% { opacity: 0.6; }
 
 
20
  }
21
 
22
+ .dark .custom-shadow {
23
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
24
+ }