AI 生成: 一个基于浏览器网址的跨设备文件快传工具,支持拖拽上传、二维码扫描、实时传输进度显示。

This commit is contained in:
eeuse
2026-09-28 22:46:55 +08:00
commit 7b09d4b79f
6 changed files with 745 additions and 0 deletions
+291
View File
@@ -0,0 +1,291 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
color: #333;
}
.container {
max-width: 720px;
margin: 0 auto;
}
header {
text-align: center;
color: #fff;
margin-bottom: 30px;
}
header h1 {
font-size: 2.2rem;
margin-bottom: 8px;
}
.subtitle {
opacity: 0.9;
font-size: 1rem;
}
section {
background: #fff;
border-radius: 16px;
padding: 24px;
margin-bottom: 20px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
/* 二维码区域 */
.qr-section {
display: flex;
align-items: center;
gap: 24px;
flex-wrap: wrap;
justify-content: center;
}
.qr-box {
text-align: center;
}
#qrcode {
display: inline-block;
padding: 8px;
background: #fff;
border-radius: 8px;
}
#qrcode img, #qrcode canvas {
display: block;
}
.qr-tip {
margin-top: 8px;
color: #666;
font-size: 0.85rem;
}
.url-box {
flex: 1;
min-width: 240px;
}
.url-label {
color: #666;
font-size: 0.85rem;
margin-bottom: 6px;
}
.url-value {
background: #f5f5f7;
padding: 12px 14px;
border-radius: 8px;
font-family: monospace;
font-size: 0.95rem;
word-break: break-all;
margin-bottom: 10px;
color: #667eea;
font-weight: 600;
}
.btn-copy, .btn-refresh {
background: #667eea;
color: #fff;
border: none;
padding: 8px 18px;
border-radius: 8px;
cursor: pointer;
font-size: 0.9rem;
transition: background 0.2s;
}
.btn-copy:hover, .btn-refresh:hover {
background: #5568d3;
}
/* 上传区域 */
.drop-zone {
border: 2px dashed #c0c4cc;
border-radius: 12px;
padding: 40px 20px;
text-align: center;
cursor: pointer;
transition: all 0.2s;
color: #666;
}
.drop-zone:hover, .drop-zone.dragover {
border-color: #667eea;
background: #f8f9ff;
}
.drop-icon {
font-size: 3rem;
margin-bottom: 12px;
}
.link {
color: #667eea;
font-weight: 600;
text-decoration: underline;
}
.hint {
margin-top: 8px;
font-size: 0.85rem;
color: #999;
}
/* 进度条 */
.progress-container {
margin-top: 16px;
}
.progress-info {
display: flex;
justify-content: space-between;
font-size: 0.9rem;
color: #555;
margin-bottom: 6px;
}
.progress-bar {
height: 8px;
background: #eef0f5;
border-radius: 4px;
overflow: hidden;
}
.progress-fill {
height: 100%;
width: 0;
background: linear-gradient(90deg, #667eea, #764ba2);
transition: width 0.15s;
}
/* 文件列表 */
.files-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.files-header h2 {
font-size: 1.15rem;
color: #333;
}
.file-list {
list-style: none;
}
.file-list li {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 14px;
border-radius: 10px;
background: #f8f9fb;
margin-bottom: 8px;
transition: background 0.2s;
}
.file-list li:hover {
background: #eef0f5;
}
.file-list li.empty {
justify-content: center;
color: #999;
background: transparent;
}
.file-info {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
min-width: 0;
}
.file-icon {
font-size: 1.4rem;
flex-shrink: 0;
}
.file-meta {
min-width: 0;
flex: 1;
}
.file-name {
font-size: 0.95rem;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
}
.file-size {
font-size: 0.8rem;
color: #999;
margin-top: 2px;
}
.file-actions {
display: flex;
gap: 8px;
flex-shrink: 0;
}
.btn-download, .btn-delete {
border: none;
padding: 6px 12px;
border-radius: 6px;
font-size: 0.85rem;
cursor: pointer;
text-decoration: none;
transition: all 0.2s;
}
.btn-download {
background: #667eea;
color: #fff;
}
.btn-download:hover {
background: #5568d3;
}
.btn-delete {
background: #fee;
color: #e74c3c;
}
.btn-delete:hover {
background: #fdd;
}
/* 移动端 */
@media (max-width: 600px) {
header h1 {
font-size: 1.6rem;
}
section {
padding: 18px;
}
.qr-section {
flex-direction: column;
}
.file-actions {
flex-direction: column;
}
}