Spaces:
Sleeping
Sleeping
eithney
Update book cover styling: change object-fit property from 'cover' to 'contain' for better image display in index.html
5c7a51a | <html lang="zh-CN"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>交互式学习 - 书籍目录</title> | |
| <link rel="stylesheet" href="static/css/style.css"> | |
| <link rel="stylesheet" href="static/css/inter.css"> | |
| <link rel="stylesheet" href="static/css/all.min.css"> | |
| <style> | |
| /* 书籍目录页面专用样式 */ | |
| .catalog-container { | |
| min-height: 100vh; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| padding: 2rem 1rem; | |
| } | |
| .catalog-header { | |
| max-width: 1200px; | |
| margin: 0 auto 2rem; | |
| text-align: center; | |
| color: white; | |
| } | |
| .catalog-header h1 { | |
| font-size: 2.5rem; | |
| font-weight: 700; | |
| margin-bottom: 0.5rem; | |
| text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); | |
| } | |
| .catalog-header p { | |
| font-size: 1.1rem; | |
| opacity: 0.9; | |
| } | |
| .statistics { | |
| max-width: 1200px; | |
| margin: 0 auto 2rem; | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | |
| gap: 1rem; | |
| } | |
| .stat-card { | |
| background: rgba(255, 255, 255, 0.95); | |
| padding: 1.5rem; | |
| border-radius: 12px; | |
| text-align: center; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| transition: transform 0.2s; | |
| } | |
| .stat-card:hover { | |
| transform: translateY(-4px); | |
| } | |
| .stat-card .icon { | |
| font-size: 2rem; | |
| color: #667eea; | |
| margin-bottom: 0.5rem; | |
| } | |
| .stat-card .number { | |
| font-size: 2rem; | |
| font-weight: 700; | |
| color: #333; | |
| margin-bottom: 0.25rem; | |
| } | |
| .stat-card .label { | |
| font-size: 0.9rem; | |
| color: #666; | |
| } | |
| .search-bar { | |
| max-width: 800px; | |
| margin: 0 auto 2rem; | |
| position: relative; | |
| } | |
| .search-bar input { | |
| width: 100%; | |
| padding: 1rem 3rem 1rem 1.5rem; | |
| font-size: 1.1rem; | |
| border: none; | |
| border-radius: 50px; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| outline: none; | |
| } | |
| .search-bar button { | |
| position: absolute; | |
| right: 0.5rem; | |
| top: 50%; | |
| transform: translateY(-50%); | |
| background: #667eea; | |
| color: white; | |
| border: none; | |
| padding: 0.75rem 1.5rem; | |
| border-radius: 50px; | |
| cursor: pointer; | |
| transition: background 0.3s; | |
| } | |
| .search-bar button:hover { | |
| background: #5568d3; | |
| } | |
| .books-container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| background: rgba(255, 255, 255, 0.95); | |
| border-radius: 12px; | |
| padding: 2rem; | |
| box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); | |
| } | |
| .books-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); | |
| gap: 1.5rem; | |
| } | |
| .book-card { | |
| background: white; | |
| border-radius: 12px; | |
| overflow: hidden; | |
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
| transition: all 0.3s; | |
| cursor: pointer; | |
| border: 2px solid transparent; | |
| } | |
| .book-card:hover { | |
| transform: translateY(-8px); | |
| box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); | |
| border-color: #667eea; | |
| } | |
| .book-cover { | |
| width: 100%; | |
| height: 200px; | |
| object-fit: contain; | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| } | |
| .book-info { | |
| padding: 1.25rem; | |
| } | |
| .book-name { | |
| font-size: 1.2rem; | |
| font-weight: 600; | |
| color: #333; | |
| margin-bottom: 0.5rem; | |
| white-space: nowrap; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| } | |
| .book-meta { | |
| display: flex; | |
| justify-content: space-between; | |
| color: #666; | |
| font-size: 0.9rem; | |
| margin-bottom: 0.75rem; | |
| } | |
| .book-classify { | |
| color: #667eea; | |
| font-size: 0.85rem; | |
| font-weight: 500; | |
| } | |
| .loading { | |
| text-align: center; | |
| padding: 3rem; | |
| color: white; | |
| font-size: 1.2rem; | |
| } | |
| .loading i { | |
| font-size: 2rem; | |
| margin-bottom: 1rem; | |
| } | |
| .empty-state { | |
| text-align: center; | |
| padding: 3rem; | |
| color: #666; | |
| } | |
| .empty-state i { | |
| font-size: 4rem; | |
| color: #ccc; | |
| margin-bottom: 1rem; | |
| } | |
| .toast { | |
| position: fixed; | |
| bottom: 2rem; | |
| right: 2rem; | |
| background: #333; | |
| color: white; | |
| padding: 1rem 1.5rem; | |
| border-radius: 8px; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| opacity: 0; | |
| transition: opacity 0.3s; | |
| z-index: 1000; | |
| } | |
| .toast.show { | |
| opacity: 1; | |
| } | |
| .toast.error { | |
| background: #e74c3c; | |
| } | |
| .toast.success { | |
| background: #27ae60; | |
| } | |
| .toast.info { | |
| background: #3498db; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="catalog-container"> | |
| <!-- 头部 --> | |
| <div class="catalog-header"> | |
| <h1> | |
| <i class="fas fa-book-reader"></i> | |
| 交互式学习平台 | |
| </h1> | |
| <p>选择一本教材开始学习</p> | |
| </div> | |
| <!-- 统计信息 --> | |
| <div class="statistics" id="statistics" style="display: none;"> | |
| <div class="stat-card"> | |
| <div class="icon"><i class="fas fa-book"></i></div> | |
| <div class="number" id="totalBooks">0</div> | |
| <div class="label">教材总数</div> | |
| </div> | |
| <div class="stat-card"> | |
| <div class="icon"><i class="fas fa-file-alt"></i></div> | |
| <div class="number" id="totalPages">0</div> | |
| <div class="label">页面总数</div> | |
| </div> | |
| <div class="stat-card"> | |
| <div class="icon"><i class="fas fa-puzzle-piece"></i></div> | |
| <div class="number" id="totalPieces">0</div> | |
| <div class="label">内容片段</div> | |
| </div> | |
| <div class="stat-card"> | |
| <div class="icon"><i class="fas fa-list"></i></div> | |
| <div class="number" id="totalCatalogs">0</div> | |
| <div class="label">目录项</div> | |
| </div> | |
| </div> | |
| <!-- 搜索栏 --> | |
| <div class="search-bar"> | |
| <input type="text" id="searchInput" placeholder="搜索教材名称..." /> | |
| <button id="searchBtn"> | |
| <i class="fas fa-search"></i> | |
| </button> | |
| </div> | |
| <!-- 书籍容器 --> | |
| <div class="books-container"> | |
| <div id="loading" class="loading"> | |
| <div><i class="fas fa-spinner fa-spin"></i></div> | |
| <div>加载中...</div> | |
| </div> | |
| <div id="booksGrid" class="books-grid" style="display: none;"></div> | |
| <div id="emptyState" class="empty-state" style="display: none;"> | |
| <div><i class="fas fa-inbox"></i></div> | |
| <div>暂无教材数据</div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- 消息提示 --> | |
| <div class="toast" id="toast"></div> | |
| <script src="static/js/catalog.js"></script> | |
| </body> | |
| </html> | |