2024-08-22 17:56:09 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<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="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css">
|
|
|
|
<style>
|
2024-08-22 20:33:21 +08:00
|
|
|
:root {
|
|
|
|
--tile-size: 120px; /* 固定宽度为120px */
|
|
|
|
}
|
2024-08-22 17:56:09 +08:00
|
|
|
body {
|
|
|
|
margin: 0;
|
|
|
|
font-family: Arial, sans-serif;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: flex-start; /* 对齐到顶部 */
|
|
|
|
height: 100vh;
|
|
|
|
padding-top: 50px; /* 距离上边距50像素 */
|
|
|
|
}
|
|
|
|
.tile-container {
|
2024-08-22 20:33:21 +08:00
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(var(--tile-size), 1fr)); /* 自动填充列 */
|
|
|
|
max-width: 90%;
|
|
|
|
padding: 10px;
|
|
|
|
grid-row-gap: 10px;
|
|
|
|
grid-column-gap: 10px;
|
|
|
|
justify-content: center;
|
2024-08-22 17:56:09 +08:00
|
|
|
}
|
|
|
|
.tile {
|
2024-08-22 20:33:21 +08:00
|
|
|
width: var(--tile-size);
|
|
|
|
height: var(--tile-size);
|
2024-08-22 17:56:09 +08:00
|
|
|
color: #fff;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 10px;
|
|
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
|
|
cursor: pointer;
|
|
|
|
transition: transform 0.3s, box-shadow 0.3s;
|
2024-08-22 20:33:21 +08:00
|
|
|
background-color: #0078D7; /* 默认背景颜色 */
|
2024-08-22 17:56:09 +08:00
|
|
|
}
|
|
|
|
.tile:hover {
|
|
|
|
transform: scale(1.05);
|
|
|
|
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
|
|
|
|
}
|
|
|
|
.tile i {
|
2024-08-22 20:33:21 +08:00
|
|
|
font-size: calc(0.35 * var(--tile-size)); /* 图标大小为30px */
|
|
|
|
margin-bottom: 10px; /* 保证图标和文字之间的间距 */
|
2024-08-22 17:56:09 +08:00
|
|
|
}
|
|
|
|
.tile span {
|
2024-08-22 20:33:21 +08:00
|
|
|
font-size: calc(0.11 * var(--tile-size)); /* 工具名称字体大小适应磁贴 */
|
2024-08-22 17:56:09 +08:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2024-08-22 20:33:21 +08:00
|
|
|
<div class="tile-container" id="tileContainer">
|
|
|
|
<div class="tile" style="background-color: #0078D7;" onclick="handleTileClick('otp.html')">
|
2024-08-22 17:56:09 +08:00
|
|
|
<i class="mdi mdi-qrcode"></i>
|
2024-08-22 20:33:21 +08:00
|
|
|
<span>OTP二维码生成器</span>
|
2024-08-22 17:56:09 +08:00
|
|
|
</div>
|
2024-08-22 20:33:21 +08:00
|
|
|
<div class="tile" style="background-color: #28a745;" onclick="handleTileClick('text_to_qrcode.html')">
|
|
|
|
<i class="mdi mdi-qrcode-edit"></i>
|
|
|
|
<span>文字转二维码</span>
|
2024-08-22 17:56:09 +08:00
|
|
|
</div>
|
2024-08-22 20:33:21 +08:00
|
|
|
<div class="tile" style="background-color: #dc3545; display: none" onclick="window.open('tool3.html', '_blank')">
|
2024-08-22 17:56:09 +08:00
|
|
|
<i class="mdi mdi-bell"></i>
|
|
|
|
<span>工具3</span>
|
|
|
|
</div>
|
2024-08-22 20:33:21 +08:00
|
|
|
<div class="tile" style="background-color: #fd7e14; display: none" onclick="window.open('tool4.html', '_blank')">
|
2024-08-22 17:56:09 +08:00
|
|
|
<i class="mdi mdi-calendar"></i>
|
|
|
|
<span>工具4</span>
|
|
|
|
</div>
|
|
|
|
<!-- 这里可以添加更多工具的磁贴,每个磁贴可以设置不同的背景颜色 -->
|
|
|
|
</div>
|
2024-08-22 20:33:21 +08:00
|
|
|
|
|
|
|
<script>
|
|
|
|
function handleTileClick(page) {
|
|
|
|
const currentPath = window.location.pathname;
|
|
|
|
let targetUrl;
|
|
|
|
|
|
|
|
if (currentPath.includes('index.html')) {
|
|
|
|
targetUrl = page;
|
|
|
|
} else {
|
|
|
|
targetUrl = `tools/${page}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
window.open(targetUrl, '_blank');
|
|
|
|
}
|
|
|
|
</script>
|
2024-08-22 17:56:09 +08:00
|
|
|
</body>
|
2024-08-22 20:33:21 +08:00
|
|
|
</html>
|