From 96582b0822e2e97d1e7ac21af1d27e6e8e8e0346 Mon Sep 17 00:00:00 2001 From: skimrme Date: Mon, 1 Dec 2025 12:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/blog/index.php | 263 ++++++++++++++++++----------------- public/blog/logs.php.text | 2 +- public/blog/src/css/main.css | 58 ++++++++ public/blog/src/js/main.js | 29 ++++ 4 files changed, 221 insertions(+), 131 deletions(-) mode change 100755 => 100644 public/blog/index.php create mode 100644 public/blog/src/css/main.css create mode 100644 public/blog/src/js/main.js diff --git a/public/blog/index.php b/public/blog/index.php old mode 100755 new mode 100644 index 607f090..f920e22 --- a/public/blog/index.php +++ b/public/blog/index.php @@ -1,151 +1,127 @@ - + 首页 | ww3 + + -
- -
- -
-

屑站日志:

- - +
+ +
+

open-ww3-project

+
+ +
- + + + + + + + + + +
首页关于文章弹幕留言短链生成giteadocker-registryapiwiki
-
-
- -
-
- open-ww3-project-img -
- - try { - // 连接数据库 - $db = new SQLite3($db_path); - // 连接成功输出连接成功 - echo ""; - // 如果连接成功,但是内部状态有问题 - if ($db->lastErrorCode() !==0) { - // 依旧显示为连接失败 - die("数据库连接失败"); - } + +
+ + +

屑站日志:

+
+ + + + + +
+
+
+ - // 内容区 - // 执行sql命令 查询表单 - $select_id_date_title_from_posts_btos /*查询posts表单中的id date title id从大到小排列*/ = $db->query('SELECT id, date, title FROM posts ORDER BY id DESC'); // 执行查询posts表单中的id date title id从大到小排列的命令 - // 循环 写入 +
+

全部文章

"; - echo "
"; - echo "文章如下↓"; - echo "
"; - echo "
"; + try { + // 连接数据库 + $db = new SQLite3($db_path); + // 连接成功输出连接成功 + echo ""; + // 如果连接成功,但是内部状态有问题 + if ($db->lastErrorCode() !==0) { + // 依旧显示为连接失败 + die("数据库连接失败"); + } - while ($row = $select_id_date_title_from_posts_btos->fetchArray(SQLITE3_ASSOC)) { + // 内容区 + // 执行sql命令 查询表单 + $select_id_date_title_from_posts_btos /*查询posts表单中的id date title id从大到小排列*/ = $db->query('SELECT id, date, title FROM posts ORDER BY id DESC'); // 执行查询posts表单中的id date title id从大到小排列的命令 + // 循环 写入 - echo "文章id: " . $row['id'] . "
"; - echo $row['date'] . "   " . "文章标题: " . $row['title'] . "
"; - echo "页面跳转

"; - } + echo "

全部文章

"; + echo "
"; + echo "文章如下↓"; + echo "
"; + echo "
"; + + while ($row = $select_id_date_title_from_posts_btos->fetchArray(SQLITE3_ASSOC)) { + + echo "文章id: " . $row['id'] . "
"; + echo $row['date'] . "   " . "文章标题: " . $row['title'] . "
"; + echo "页面跳转

"; + } - // 关闭数据库连接 - $db->close(); + // 关闭数据库连接 + $db->close(); - // 捕获php报错 - } catch (Exception $e) { - // 依旧显示为连接失败 - die("数据库连接失败"); - // 关闭数据库连接 - $db->close(); - } - - ?> + // 捕获php报错 + } catch (Exception $e) { + // 依旧显示为连接失败 + die("数据库连接失败"); + // 关闭数据库连接 + $db->close(); + } + ?> +
+ +
+
- - - gitea - - - - - + + - - \ No newline at end of file diff --git a/public/blog/logs.php.text b/public/blog/logs.php.text index 3b5e068..60a0e12 100644 --- a/public/blog/logs.php.text +++ b/public/blog/logs.php.text @@ -27,7 +27,7 @@ $alter_br = str_replace('&&', $br_nbsp, $row['content']); // 输出 date content - echo "" . "" . $row['date'] . "" . "" . $alter_br . "
" . ""; + echo "" . "" . "" . $row['date'] . "" . "" . "" . $alter_br . "
" . ""; } diff --git a/public/blog/src/css/main.css b/public/blog/src/css/main.css new file mode 100644 index 0000000..ee6c3a2 --- /dev/null +++ b/public/blog/src/css/main.css @@ -0,0 +1,58 @@ +/* css页面蓝图 */ + +/* 外部背景 */ +html, body { + height: 100%; + width: 100%; + margin: 0; /*外边框*/ + padding: 0; /*内边框*/ + overflow: hidden; /* 防止滚动条 */ + background-color: #333; /* 背景颜色 */ +} + +/* 内部容器 */ +#app-canvas { + width: 1280px; + height: 800px; + + background-color: rgba(147, 185, 255, 0.644); + border: 5px solid #0056b3; /* 定义边框 5px 实线 蓝色 */ + /* transform-origin: 0 0; /* 定义缩放起点 左上角 */ + + position:fixed; /* 固定页面,不滚动 */ + left: 50%; /* 调整左边缘位置到中央 */ + top: 50%; /* 调整上边缘位置到中央 */ + + padding: 30px; /* 内部间距 30px */ + + +} + +header { + margin-bottom: 30px; /* 外部间距 30px */ + text-align: center; /* 文字居中 */ +} + +h1 { + font-size: 48px; + color: #fff; + text-shadow: 2px 2px 4px rgba(0,0,0,0.5); +} + +#content-area { + display: flex; + justify-content: space-around; + gap: 40px; +} + +/* 自带 */ +.box { + width: 500px; + height: 600px; + background-color: #ffffffcc; + border: 1px solid #ccc; + padding: 20px; + font-size: 20px; + text-align: left; + overflow: auto; +} diff --git a/public/blog/src/js/main.js b/public/blog/src/js/main.js new file mode 100644 index 0000000..0076628 --- /dev/null +++ b/public/blog/src/js/main.js @@ -0,0 +1,29 @@ +// js目前不会,先靠ai + +function resizeCanvas() { + // 定义设计基准尺寸 + const designWidth = 1280; + const designHeight = 800; + + // 获取当前浏览器视口尺寸 + const currentWidth = window.innerWidth; + const currentHeight = window.innerHeight; + + const canvas = document.getElementById('app-canvas'); + + // 计算缩放比例 + const scaleX = currentWidth / designWidth; + const scaleY = currentHeight / designHeight; + const scaleFactor = Math.min(scaleX, scaleY); + + // 确保元素中心与 left: 50%; top: 50%; 对齐 + canvas.style.transform = `translate(-50%, -50%) scale(${scaleFactor})`; +} + +// 首次加载时执行 +document.addEventListener('DOMContentLoaded', resizeCanvas); +// 监听窗口大小变化时执行,保持动态缩放 +window.addEventListener('resize', resizeCanvas); + +// 确保在某些情况下也能正确初始化 +resizeCanvas(); \ No newline at end of file