486CHD commited on
Commit
7377ef4
·
verified ·
1 Parent(s): ccf09b6

Upload 12 files

Browse files
Files changed (2) hide show
  1. index.html +19 -18
  2. style.css +64 -47
index.html CHANGED
@@ -22,7 +22,7 @@
22
  }
23
 
24
  header {
25
- margin-top: 80px; /* 为输入区留空间 */
26
  }
27
 
28
  .history-container {
@@ -48,15 +48,15 @@
48
 
49
  /* 动态调整header间距 */
50
  .has-preview header {
51
- margin-top: 240px;
52
  }
53
 
54
  @media (max-width: 768px) {
55
  header {
56
- margin-top: 110px;
57
  }
58
  .has-preview header {
59
- margin-top: 220px;
60
  }
61
  }
62
  </style>
@@ -98,7 +98,7 @@
98
 
99
  <!-- 下部分:操作栏 -->
100
  <div class="control-bar">
101
- <button class="upload-trigger" id="upload-btn" title="上传参考图">上传</button>
102
  <textarea id="prompt" class="main-input" rows="1" placeholder="描述画面... (支持拖拽图片)"></textarea>
103
  <button class="ghost-btn" id="clear-btn" title="清空输入" aria-label="清空输入">清空</button>
104
  <button class="btn-3d send-btn" id="send-btn">
@@ -108,7 +108,7 @@
108
  </div>
109
  <div class="tips-row" id="tips-row">
110
  <span class="tip-pill">提示:写明主体 + 风格 + 光线</span>
111
- <span class="tip-pill">支持参考图?先上传再描述</span>
112
  <span class="tip-pill">画面比例 / 构图 写清楚更稳定</span>
113
  </div>
114
  </div>
@@ -140,7 +140,7 @@
140
  <p class="section-subtitle" id="public-gallery-hint">分享你的作品,欣赏社区灵感</p>
141
  </div>
142
  <div class="section-actions">
143
- <button class="icon-btn" id="refresh-public-gallery" title="刷新公共画廊" aria-label="刷新公共画廊">⟳</button>
144
  </div>
145
  </div>
146
  <div class="grid-layout public-grid" id="public-gallery"></div>
@@ -173,7 +173,7 @@
173
  // ============================================
174
  const AppState = {
175
  db: null,
176
- currentImages: [], // 当前上传的图片 Base64 数组
177
  galleryData: [], // 个人画廊数据缓存
178
  publicGalleryData: [], // 公共画廊数据缓存
179
  currentModalItem: null // 当前弹窗显示的项目
@@ -311,14 +311,14 @@
311
  });
312
  },
313
 
314
- // 处理上传的文件
315
  async processFiles(files) {
316
  const maxImages = 16;
317
  const imageFiles = Array.from(files).filter(f => f.type.startsWith('image/'));
318
 
319
  for (const file of imageFiles) {
320
  if (AppState.currentImages.length >= maxImages) {
321
- alert(`最多只能上传 ${maxImages} 张图片`);
322
  break;
323
  }
324
 
@@ -340,7 +340,7 @@
340
  PreviewManager.render();
341
  },
342
 
343
- // 清空所有上传的图片
344
  clear() {
345
  AppState.currentImages = [];
346
  PreviewManager.render();
@@ -391,7 +391,8 @@
391
 
392
  const removeBtn = document.createElement('div');
393
  removeBtn.className = 'thumb-remove';
394
- removeBtn.textContent = '??';
 
395
  removeBtn.onclick = (e) => {
396
  e.stopPropagation();
397
  ImageHandler.removeAt(index);
@@ -600,7 +601,7 @@ const GalleryManager = {
600
 
601
  const shareBtn = document.createElement('button');
602
  shareBtn.className = 'icon-btn share-btn';
603
- shareBtn.textContent = '';
604
  shareBtn.title = '发布到公共画廊';
605
  shareBtn.setAttribute('aria-label', '发布到公共画廊');
606
  shareBtn.onclick = (e) => {
@@ -610,7 +611,7 @@ const GalleryManager = {
610
 
611
  const downloadBtn = document.createElement('button');
612
  downloadBtn.className = 'icon-btn';
613
- downloadBtn.textContent = '??';
614
  downloadBtn.title = '下载图片';
615
  downloadBtn.onclick = (e) => {
616
  e.stopPropagation();
@@ -620,7 +621,7 @@ const GalleryManager = {
620
  const deleteBtn = document.createElement('button');
621
  deleteBtn.className = 'icon-btn';
622
  deleteBtn.style.background = 'rgba(239,68,68,0.8)';
623
- deleteBtn.textContent = '';
624
  deleteBtn.title = '删除图片';
625
  deleteBtn.onclick = (e) => {
626
  e.stopPropagation();
@@ -951,7 +952,7 @@ const GalleryManager = {
951
  if (this.canDelete(item.id)) {
952
  const deleteBtn = document.createElement('button');
953
  deleteBtn.className = 'icon-btn small public-delete-btn';
954
- deleteBtn.textContent = '';
955
  deleteBtn.title = '删除这张作品';
956
  deleteBtn.onclick = (e) => {
957
  e.stopPropagation();
@@ -1264,7 +1265,7 @@ const GalleryManager = {
1264
  };
1265
 
1266
  // ============================================
1267
- // 拖拽上传模块
1268
  // ============================================
1269
  const DragDrop = {
1270
  dropZone: null,
@@ -1400,4 +1401,4 @@ const GalleryManager = {
1400
  }
1401
  </script>
1402
  </body>
1403
- </html>
 
22
  }
23
 
24
  header {
25
+ margin-top: 190px; /* 为输入区留空间 */
26
  }
27
 
28
  .history-container {
 
48
 
49
  /* 动态调整header间距 */
50
  .has-preview header {
51
+ margin-top: 360px;
52
  }
53
 
54
  @media (max-width: 768px) {
55
  header {
56
+ margin-top: 170px;
57
  }
58
  .has-preview header {
59
+ margin-top: 320px;
60
  }
61
  }
62
  </style>
 
98
 
99
  <!-- 下部分:操作栏 -->
100
  <div class="control-bar">
101
+ <button class="upload-trigger" id="upload-btn" title="上传参考图">上传图片</button>
102
  <textarea id="prompt" class="main-input" rows="1" placeholder="描述画面... (支持拖拽图片)"></textarea>
103
  <button class="ghost-btn" id="clear-btn" title="清空输入" aria-label="清空输入">清空</button>
104
  <button class="btn-3d send-btn" id="send-btn">
 
108
  </div>
109
  <div class="tips-row" id="tips-row">
110
  <span class="tip-pill">提示:写明主体 + 风格 + 光线</span>
111
+ <span class="tip-pill">支持参考图:先上传再描述</span>
112
  <span class="tip-pill">画面比例 / 构图 写清楚更稳定</span>
113
  </div>
114
  </div>
 
140
  <p class="section-subtitle" id="public-gallery-hint">分享你的作品,欣赏社区灵感</p>
141
  </div>
142
  <div class="section-actions">
143
+ <button class="icon-btn" id="refresh-public-gallery" title="刷新公共画廊" aria-label="刷新公共画廊">刷新画廊</button>
144
  </div>
145
  </div>
146
  <div class="grid-layout public-grid" id="public-gallery"></div>
 
173
  // ============================================
174
  const AppState = {
175
  db: null,
176
+ currentImages: [], // 当前上传图片的图片 Base64 数组
177
  galleryData: [], // 个人画廊数据缓存
178
  publicGalleryData: [], // 公共画廊数据缓存
179
  currentModalItem: null // 当前弹窗显示的项目
 
311
  });
312
  },
313
 
314
+ // 处理上传图片的文件
315
  async processFiles(files) {
316
  const maxImages = 16;
317
  const imageFiles = Array.from(files).filter(f => f.type.startsWith('image/'));
318
 
319
  for (const file of imageFiles) {
320
  if (AppState.currentImages.length >= maxImages) {
321
+ alert(`最多只能上传图片 ${maxImages} 张图片`);
322
  break;
323
  }
324
 
 
340
  PreviewManager.render();
341
  },
342
 
343
+ // 清空所有上传图片的图片
344
  clear() {
345
  AppState.currentImages = [];
346
  PreviewManager.render();
 
391
 
392
  const removeBtn = document.createElement('div');
393
  removeBtn.className = 'thumb-remove';
394
+ removeBtn.textContent = '\u00d7';
395
+ removeBtn.title = '移除';
396
  removeBtn.onclick = (e) => {
397
  e.stopPropagation();
398
  ImageHandler.removeAt(index);
 
601
 
602
  const shareBtn = document.createElement('button');
603
  shareBtn.className = 'icon-btn share-btn';
604
+ shareBtn.textContent = '发布';
605
  shareBtn.title = '发布到公共画廊';
606
  shareBtn.setAttribute('aria-label', '发布到公共画廊');
607
  shareBtn.onclick = (e) => {
 
611
 
612
  const downloadBtn = document.createElement('button');
613
  downloadBtn.className = 'icon-btn';
614
+ downloadBtn.textContent = '下载';
615
  downloadBtn.title = '下载图片';
616
  downloadBtn.onclick = (e) => {
617
  e.stopPropagation();
 
621
  const deleteBtn = document.createElement('button');
622
  deleteBtn.className = 'icon-btn';
623
  deleteBtn.style.background = 'rgba(239,68,68,0.8)';
624
+ deleteBtn.textContent = '删除';
625
  deleteBtn.title = '删除图片';
626
  deleteBtn.onclick = (e) => {
627
  e.stopPropagation();
 
952
  if (this.canDelete(item.id)) {
953
  const deleteBtn = document.createElement('button');
954
  deleteBtn.className = 'icon-btn small public-delete-btn';
955
+ deleteBtn.textContent = '删除';
956
  deleteBtn.title = '删除这张作品';
957
  deleteBtn.onclick = (e) => {
958
  e.stopPropagation();
 
1265
  };
1266
 
1267
  // ============================================
1268
+ // 拖拽上传图片模块
1269
  // ============================================
1270
  const DragDrop = {
1271
  dropZone: null,
 
1401
  }
1402
  </script>
1403
  </body>
1404
+ </html>
style.css CHANGED
@@ -25,7 +25,7 @@
25
  }
26
 
27
  body {
28
- font-family: 'Avenir Next', 'Trebuchet MS', 'Segoe UI', sans-serif;
29
  background:
30
  radial-gradient(700px 360px at 10% -10%, rgba(59, 130, 246, 0.25), transparent 60%),
31
  radial-gradient(700px 420px at 90% -20%, rgba(14, 165, 233, 0.18), transparent 55%),
@@ -177,15 +177,15 @@ body {
177
  }
178
  }
179
 
180
- header {
181
- padding: 15px 20px;
182
- display: flex;
183
- justify-content: space-between;
184
- align-items: center;
185
- flex-shrink: 0;
186
- margin-top: 150px;
187
- transition: margin-top var(--transition-normal);
188
- }
189
 
190
  header h2 {
191
  font-size: 1.2rem;
@@ -304,9 +304,9 @@ header h2 {
304
  }
305
 
306
 
307
- body.has-preview header {
308
- margin-top: 280px;
309
- }
310
 
311
  /* --- History Gallery --- */
312
  .history-container {
@@ -517,14 +517,16 @@ body.has-preview header {
517
  margin-bottom: 16px;
518
  }
519
 
520
- .icon-btn.small {
521
- width: 36px;
522
- height: 36px;
523
- font-size: 14px;
524
- background: rgba(239, 68, 68, 0.9);
525
- border-color: rgba(248, 113, 113, 0.7);
526
- transition: all var(--transition-fast);
527
- }
 
 
528
 
529
  .icon-btn.small:hover {
530
  background: rgba(239, 68, 68, 0.95);
@@ -635,10 +637,17 @@ body.has-preview header {
635
  backdrop-filter: blur(8px);
636
  display: flex;
637
  justify-content: flex-end;
638
- gap: 8px;
 
639
  opacity: 0;
640
  transition: opacity var(--transition-normal);
641
  }
 
 
 
 
 
 
642
 
643
  .history-item:hover .item-actions {
644
  opacity: 1;
@@ -648,10 +657,11 @@ body.has-preview header {
648
  .item-actions { opacity: 1; }
649
  }
650
 
651
- .icon-btn {
652
- width: 36px;
653
- height: 36px;
654
- border-radius: 8px;
 
655
  background: rgba(255,255,255,0.15);
656
  color: white;
657
  border: 1px solid rgba(255,255,255,0.2);
@@ -659,10 +669,12 @@ body.has-preview header {
659
  align-items: center;
660
  justify-content: center;
661
  backdrop-filter: blur(8px);
662
- cursor: pointer;
663
- transition: all var(--transition-fast);
664
- font-size: 16px;
665
- }
 
 
666
 
667
  .icon-btn:hover {
668
  background: rgba(255,255,255,0.25);
@@ -831,8 +843,9 @@ body.has-preview header {
831
 
832
 
833
  .upload-trigger {
834
- width: 44px;
835
  height: 44px;
 
836
  border-radius: 12px;
837
  background: rgba(255,255,255,0.05);
838
  border: 2px dashed rgba(255,255,255,0.3);
@@ -840,9 +853,9 @@ body.has-preview header {
840
  display: flex;
841
  align-items: center;
842
  justify-content: center;
843
- font-size: 14px;
844
  font-weight: 600;
845
- letter-spacing: 1px;
846
  flex-shrink: 0;
847
  transition: all var(--transition-normal);
848
  cursor: pointer;
@@ -910,7 +923,8 @@ body.has-preview header {
910
  border: 1px solid rgba(148, 163, 184, 0.2);
911
  border-radius: 12px;
912
  color: white;
913
- font-size: 16px;
 
914
  padding: 10px 12px;
915
  resize: none;
916
  max-height: 120px;
@@ -1246,7 +1260,8 @@ body.has-preview header {
1246
  .login-card .btn-3d {
1247
  width: 100%;
1248
  padding: 14px;
1249
- font-size: 16px;
 
1250
  }
1251
 
1252
  /* --- Mobile Responsive Design --- */
@@ -1298,11 +1313,13 @@ body.has-preview header {
1298
  font-size: 0.7rem;
1299
  }
1300
 
1301
- .icon-btn.small {
1302
- width: 32px;
1303
- height: 32px;
1304
- font-size: 12px;
1305
- }
 
 
1306
 
1307
  .public-gallery-empty {
1308
  padding: 40px 20px;
@@ -1390,13 +1407,13 @@ body.has-preview header {
1390
  height: 85%;
1391
  }
1392
 
1393
- header {
1394
- margin-top: 150px;
1395
- }
1396
-
1397
- body.has-preview header {
1398
- margin-top: 230px;
1399
- }
1400
  }
1401
 
1402
  /* --- Large Screen Optimization --- */
 
25
  }
26
 
27
  body {
28
+ font-family: 'Avenir Next', 'Trebuchet MS', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
29
  background:
30
  radial-gradient(700px 360px at 10% -10%, rgba(59, 130, 246, 0.25), transparent 60%),
31
  radial-gradient(700px 420px at 90% -20%, rgba(14, 165, 233, 0.18), transparent 55%),
 
177
  }
178
  }
179
 
180
+ header {
181
+ padding: 15px 20px;
182
+ display: flex;
183
+ justify-content: space-between;
184
+ align-items: center;
185
+ flex-shrink: 0;
186
+ margin-top: 190px;
187
+ transition: margin-top var(--transition-normal);
188
+ }
189
 
190
  header h2 {
191
  font-size: 1.2rem;
 
304
  }
305
 
306
 
307
+ body.has-preview header {
308
+ margin-top: 360px;
309
+ }
310
 
311
  /* --- History Gallery --- */
312
  .history-container {
 
517
  margin-bottom: 16px;
518
  }
519
 
520
+ .icon-btn.small {
521
+ min-width: 52px;
522
+ width: auto;
523
+ height: 34px;
524
+ padding: 0 8px;
525
+ font-size: 11px;
526
+ background: rgba(239, 68, 68, 0.9);
527
+ border-color: rgba(248, 113, 113, 0.7);
528
+ transition: all var(--transition-fast);
529
+ }
530
 
531
  .icon-btn.small:hover {
532
  background: rgba(239, 68, 68, 0.95);
 
637
  backdrop-filter: blur(8px);
638
  display: flex;
639
  justify-content: flex-end;
640
+ gap: 6px;
641
+ flex-wrap: wrap;
642
  opacity: 0;
643
  transition: opacity var(--transition-normal);
644
  }
645
+ .item-actions .icon-btn {
646
+ min-width: 50px;
647
+ font-size: 11px;
648
+ padding: 0 8px;
649
+ }
650
+
651
 
652
  .history-item:hover .item-actions {
653
  opacity: 1;
 
657
  .item-actions { opacity: 1; }
658
  }
659
 
660
+ .icon-btn {
661
+ min-width: 72px;
662
+ height: 34px;
663
+ padding: 0 10px;
664
+ border-radius: 8px;
665
  background: rgba(255,255,255,0.15);
666
  color: white;
667
  border: 1px solid rgba(255,255,255,0.2);
 
669
  align-items: center;
670
  justify-content: center;
671
  backdrop-filter: blur(8px);
672
+ cursor: pointer;
673
+ transition: all var(--transition-fast);
674
+ font-size: 12px;
675
+ line-height: 1;
676
+ white-space: nowrap;
677
+ }
678
 
679
  .icon-btn:hover {
680
  background: rgba(255,255,255,0.25);
 
843
 
844
 
845
  .upload-trigger {
846
+ min-width: 80px;
847
  height: 44px;
848
+ padding: 0 12px;
849
  border-radius: 12px;
850
  background: rgba(255,255,255,0.05);
851
  border: 2px dashed rgba(255,255,255,0.3);
 
853
  display: flex;
854
  align-items: center;
855
  justify-content: center;
856
+ font-size: 12px;
857
  font-weight: 600;
858
+ letter-spacing: 0.5px;
859
  flex-shrink: 0;
860
  transition: all var(--transition-normal);
861
  cursor: pointer;
 
923
  border: 1px solid rgba(148, 163, 184, 0.2);
924
  border-radius: 12px;
925
  color: white;
926
+ font-size: 12px;
927
+ line-height: 1;
928
  padding: 10px 12px;
929
  resize: none;
930
  max-height: 120px;
 
1260
  .login-card .btn-3d {
1261
  width: 100%;
1262
  padding: 14px;
1263
+ font-size: 12px;
1264
+ line-height: 1;
1265
  }
1266
 
1267
  /* --- Mobile Responsive Design --- */
 
1313
  font-size: 0.7rem;
1314
  }
1315
 
1316
+ .icon-btn.small {
1317
+ min-width: 50px;
1318
+ width: auto;
1319
+ height: 32px;
1320
+ padding: 0 6px;
1321
+ font-size: 11px;
1322
+ }
1323
 
1324
  .public-gallery-empty {
1325
  padding: 40px 20px;
 
1407
  height: 85%;
1408
  }
1409
 
1410
+ header {
1411
+ margin-top: 190px;
1412
+ }
1413
+
1414
+ body.has-preview header {
1415
+ margin-top: 360px;
1416
+ }
1417
  }
1418
 
1419
  /* --- Large Screen Optimization --- */