|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: base64meme |
| 4 | +description: "「侵权专线」" |
| 5 | +header-img: "img/bg-download.jpg" |
| 6 | +header-mask: 0.3 |
| 7 | +--- |
| 8 | + |
| 9 | +<div class="container"> |
| 10 | + <div class="row"> |
| 11 | + <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> |
| 12 | + <h1 class="my-4">base64meme文件下载中心</h1> |
| 13 | + |
| 14 | + <div class="search-box"> |
| 15 | + <input type="text" id="searchInput" class="form-control" |
| 16 | + placeholder="根据描述搜索文件..."> |
| 17 | + </div> |
| 18 | + |
| 19 | + <div class="post-container"> |
| 20 | + <table class="table table-hover table-bordered"> |
| 21 | + <thead class="thead-dark"> |
| 22 | + <tr> |
| 23 | + <th>名称</th> |
| 24 | + <th> 描述 </th> |
| 25 | + <th> 版本 </th> |
| 26 | + <th> 作者 </th> |
| 27 | + <th> 发布时间 </th> |
| 28 | + <th>文件类型</th> |
| 29 | + <th>操作</th> |
| 30 | + </tr> |
| 31 | + </thead> |
| 32 | + <tbody id="fileTableBody"> |
| 33 | + <tr id="loadingRow"> |
| 34 | + <td colspan="6" class="text-center">加载中...</td> |
| 35 | + </tr> |
| 36 | + </tbody> |
| 37 | + </table> |
| 38 | + </div> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | +</div> |
| 42 | + <script src="/js/jquery.min.js"></script> |
| 43 | + <script src="/js/bootstrap.min.js"></script> |
| 44 | + <script> |
| 45 | + // 加载并渲染文件数据 |
| 46 | + function loadFiles() { |
| 47 | + fetch('/base64meme/files.json') |
| 48 | + .then(response => response.json()) |
| 49 | + .then(files => { |
| 50 | + renderTable(files); |
| 51 | + setupSearch(files); |
| 52 | + }); |
| 53 | + } |
| 54 | + |
| 55 | + // 渲染表格数据 |
| 56 | + function renderTable(files) { |
| 57 | + const tbody = document.getElementById('fileTableBody'); |
| 58 | + tbody.innerHTML = files.map(file => ` |
| 59 | + <tr> |
| 60 | + <td>${file.name}</td> |
| 61 | + <td>${file.ds}</td> |
| 62 | + <td>${file.vin}</td> |
| 63 | + <td>${file.wrt}</td> |
| 64 | + <td>${file.time}</td> |
| 65 | + <td>${file.format}</td> |
| 66 | + <td> |
| 67 | + <a href="${file.url}" class="btn btn-primary btn-sm btn-download" download> |
| 68 | + <i class="fa fa-download"></i> |
| 69 | + <span>下载</span> |
| 70 | + </a> |
| 71 | + </td> |
| 72 | + </tr> |
| 73 | + `).join(''); |
| 74 | + } |
| 75 | + |
| 76 | + // 设置搜索功能 |
| 77 | + function setupSearch(files) { |
| 78 | + const searchInput = document.getElementById('searchInput'); |
| 79 | + |
| 80 | + searchInput.addEventListener('input', function(e) { |
| 81 | + const keyword = e.target.value.toLowerCase(); |
| 82 | + const filtered = files.filter(file => |
| 83 | + file.ds.toLowerCase().includes(keyword) || |
| 84 | + file.name.toLowerCase().includes(keyword) |
| 85 | + ); |
| 86 | + |
| 87 | + renderTable(filtered); |
| 88 | + highlightKeyword(keyword); |
| 89 | + }); |
| 90 | + } |
| 91 | + |
| 92 | + // 高亮搜索关键词 |
| 93 | + function highlightKeyword(keyword) { |
| 94 | + if (!keyword) return; |
| 95 | + |
| 96 | + const cells = document.querySelectorAll('td:nth-child(1), td:nth-child(2)'); |
| 97 | + cells.forEach(cell => { |
| 98 | + const text = cell.innerText; |
| 99 | + const regex = new RegExp(`(${keyword})`, 'gi'); |
| 100 | + cell.innerHTML = text.replace(regex, '<span class="highlight">$1</span>'); |
| 101 | + }); |
| 102 | + } |
| 103 | +</script> |
| 104 | + |
| 105 | +{% if site.disqus_username %} |
| 106 | +<!-- 复用about.html的disqus评论系统 --> |
| 107 | +<div class="comment"> |
| 108 | + <div id="disqus_thread" class="disqus-thread"></div> |
| 109 | +</div> |
| 110 | +{% endif %} |
| 111 | + |
| 112 | +<style> |
| 113 | + /* 新增表格尺寸调整样式 */ |
| 114 | + .table { |
| 115 | + font-size: 11px; /* 调大表格字体 */ |
| 116 | + line-height: 2; /* 增加行高 */ |
| 117 | + width: 300%; /* 表格宽度占满容器 */ |
| 118 | + } |
| 119 | + |
| 120 | + .table th, |
| 121 | + .table td { |
| 122 | + padding: 24px 30px; /* 增大单元格内边距 */ |
| 123 | + vertical-align: middle; |
| 124 | + } |
| 125 | + |
| 126 | + .post-container { |
| 127 | + max-width: 10000px; /* 增大表格容器宽度 */ |
| 128 | + margin: 0 auto; |
| 129 | + } |
| 130 | + |
| 131 | + /* 原有下载按钮样式保持不变 */ |
| 132 | + .btn-download { |
| 133 | + padding: 5px 12px; |
| 134 | + border-radius: 15px; |
| 135 | + transition: all 0.3s ease; |
| 136 | + color: #fff !important; /* 强制文字白色 */ |
| 137 | + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* 保持字体统一 */ |
| 138 | + } |
| 139 | + .btn-download i { |
| 140 | + margin-right: 5px; |
| 141 | + vertical-align: middle; /* 图标文字垂直居中 */ |
| 142 | + } |
| 143 | + .btn-download span { |
| 144 | + font-size: 14px; /* 明确字号 */ |
| 145 | + display: inline-block; /* 解决span元素布局问题 */ |
| 146 | + } |
| 147 | + .btn-download:hover { |
| 148 | + transform: translateY(-2px); |
| 149 | + box-shadow: 0 2px 6px rgba(0,0,0,0.15); |
| 150 | + color: #fff; /* 悬浮保持白色 */ |
| 151 | + } |
| 152 | +</style> |
0 commit comments