-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhost.html
More file actions
163 lines (149 loc) · 7.33 KB
/
host.html
File metadata and controls
163 lines (149 loc) · 7.33 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PyShare Host</title>
<link rel="icon" type="image/x-icon" href="app_icon.ico">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="host_styles.css">
<style>
/* INLINE OVERRIDES to fix layout issues */
.qr-card-inner {
display: flex;
flex-direction: column;
overflow: hidden; /* Prevent scrolling inside the card */
height: 100%;
}
.qr-content {
flex: 0 0 auto; /* Allow this to shrink/grow based on content only */
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 10px;
}
/* Make PIN card smaller */
.pin-card {
margin: 10px auto;
width: 90%;
padding: 8px 12px;
background: var(--input-bg);
border-radius: 12px;
border: 1px solid var(--border-color);
position: relative;
overflow: hidden;
}
/* Make notification box fill remaining space */
.notification-box {
flex: 1; /* Grow to fill space */
margin-top: 0 !important;
min-height: 0; /* Allow shrinking */
height: auto !important; /* Override fixed height */
background: rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<div class="app-container">
<nav class="navbar">
<div style="display:flex; gap:10px;">
<button class="icon-btn" onclick="toggleTheme()" title="Theme">🌓</button>
</div>
<div style="display:flex; gap:15px; align-items: center;">
<div class="logo">
<span class="icon-emoji">
<img src="app_icon.ico" alt="App icon">
</span>
PyShare
</div>
</div>
<div style="display:flex; gap:10px;">
<button class="icon-btn" onclick="disconnectServer()"
style="color:var(--accent-red); border-color:rgba(239, 68, 68, 0.3);" title="Shutdown">🛑</button>
</div>
</nav>
<div class="status-bar">
<div class="status-pill" style="padding: 8px 25px;">
<span class="status-dot"></span>
<span>Server IP: <span id="host-ip"
style="font-weight:bold; color:var(--text-main); font-family:monospace;">...</span></span>
</div>
</div>
<div class="upload-card send-area" id="dropZone">
<div class="upload-icon" style="font-size: 64px; margin-bottom: 20px;">📤</div>
<h2 style="margin: 0 0 10px 0;">Add to Shared</h2>
<p style="color: var(--text-sub); margin-bottom: 25px;">Drag & Drop files here or click below</p>
<button class="btn-primary" onclick="document.getElementById('fileInput').click()"
style="padding: 15px 40px; font-size: 16px;">Select Files</button>
<input type="file" id="fileInput" multiple hidden onchange="handleFilesHost(this.files)">
<div id="progress-container" class="progress-wrapper" style="width: 80%; margin-top: 25px;">
<div class="progress-labels"><span id="status">Adding...</span><span id="percent-text">0%</span></div>
<div class="progress-track">
<div id="progress-bar" class="progress-fill"></div>
</div>
</div>
</div>
<div class="files-section qr-area" style="padding: 0;">
<div class="qr-card-inner">
<div class="qr-content">
<h3 style="margin-bottom: 10px;">📱 Connect Device</h3>
<img src="/qrcode.png" class="qr-img" alt="Scan QR" style="width: 140px; height: 140px;">
<p style="font-size: 12px; color: var(--text-sub); margin: 8px 0;">Scan to connect</p>
<div class="pin-card">
<div id="pin-timer-bar" style="position: absolute; bottom: 0; left: 0; height: 3px; background: var(--accent-blue); width: 100%; transition: width 1s linear;"></div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<div style="font-size: 10px; color: var(--text-sub); font-weight: bold; text-transform: uppercase;">Pin Code</div>
<div id="pin-timer-text" style="font-size: 10px; color: var(--accent-blue);">30s</div>
</div>
<div id="live-pin" style="font-size: 24px; font-weight: bold; letter-spacing: 4px; color: var(--text-main); text-align: center; margin-top: 2px;">----</div>
</div>
<div id="rx-container" class="rx-progress" style="width: 100%; margin-top: 10px;">
<div style="font-size:11px; margin-bottom:4px; font-weight:bold; display:flex; justify-content:space-between;">
<span>⬇️ Receiving...</span>
<span id="rx-filename" style="opacity:0.8">file.ext</span>
</div>
<div class="progress-track">
<div id="rx-bar" class="progress-fill" style="width:0%"></div>
</div>
</div>
</div>
<div class="notification-box" id="notif-log">
<div class="log-entry"><span class="log-time">--:--</span> <span class="log-msg">Server started. Waiting...</span></div>
</div>
</div>
</div>
<div class="files-area">
<div class="files-section file-list-card">
<div class="card-header">
<h3>📥 Received Files</h3>
<button class="btn-folder" onclick="fetch('/api/open?folder=received')">📂 Open Folder</button>
</div>
<div class="search-bar-wrapper">
<input type="text" id="searchMobile" placeholder="🔍 Search received..." onkeyup="filterMobile()">
</div>
<div class="file-scroll-area">
<ul id="mobile-list" class="file-list">
<li class="loading-state">No uploads yet</li>
</ul>
</div>
</div>
<div class="files-section file-list-card">
<div class="card-header">
<h3>📤 Shared Files</h3>
<button class="btn-folder" onclick="fetch('/api/open?folder=shared')">📂 Open Folder</button>
</div>
<div class="search-bar-wrapper">
<input type="text" id="searchPC" placeholder="🔍 Search shared..." onkeyup="filterPC()">
</div>
<div class="file-scroll-area">
<ul id="file-list" class="file-list">
<li class="loading-state">Loading files...</li>
</ul>
</div>
</div>
</div>
</div>
<script src="scripts.js"></script>
<script src="host_scripts.js"></script>
</body>
</html>