From a194246bb9d75b06a81a43c0695b4dac1bcd2d4b Mon Sep 17 00:00:00 2001
From: Tiaotiao <65841827@qq.com>
Date: Sat, 29 Nov 2025 10:08:10 +0800
Subject: [PATCH 01/17] Add styles for comment dialog and related elements
---
styles/comment.css | 63 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 styles/comment.css
diff --git a/styles/comment.css b/styles/comment.css
new file mode 100644
index 0000000..262ebfb
--- /dev/null
+++ b/styles/comment.css
@@ -0,0 +1,63 @@
+dialog {
+ position: fixed;
+ top: 0%;
+ left: 0%;
+ height: 100%;
+ width: 100%;
+ border: none;
+ z-index: 100;
+ overflow: hidden;
+}
+
+#dt {
+ position: absolute;
+ top: 10%;
+ left: 0%;
+ height: 90%;
+ width: 100%;
+ border: none;
+ font-size: 3vh;
+}
+
+#dh {
+ position: absolute;
+ top: 0%;
+ left: 0%;
+ height: 10%;
+ width: 100%;
+ background-color: #eee;
+ }
+
+.red {
+ background-color: #e00;
+ position: absolute;
+ top: 20%;
+ left: 88%;
+ height: 60%;
+ width: 10%;
+ color: white;
+ font-size: 2.5vh;
+ border-radius: 10px;
+}
+
+.mid {
+ position: absolute;
+ top: -10%;
+ left: 8%;
+}
+
+#start {
+ height: 30px;
+ width: 50%;
+ border: 1px solid #111;
+ border-radius: none;
+ text-align: left;
+ color: gray;
+ background-color: #eee;
+}
+
+textarea:focus {
+ border-color: rgba(0,0,0,0);
+ outline: none;
+ box-shadow: 0 0 0.1px rgba(255,255,255,0);
+}
From 1f4de04085990127be38bd77c28cf052c4404afd Mon Sep 17 00:00:00 2001
From: Tiaotiao <65841827@qq.com>
Date: Sat, 29 Nov 2025 11:34:11 +0800
Subject: [PATCH 02/17] Implement comment dialog functionality
---
scripts/comment.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 scripts/comment.js
diff --git a/scripts/comment.js b/scripts/comment.js
new file mode 100644
index 0000000..1f57fe8
--- /dev/null
+++ b/scripts/comment.js
@@ -0,0 +1,70 @@
+document.addEventListener('DOMContentLoaded', () => {
+ const dialog = document.querySelector('dialog');
+ const originalText = dialog.innerHTML.trim(); // 获取原始文本 "编辑评论内容"
+
+ // 解析属性
+ const types = dialog.dataset.type.split(',');
+ const inputPlaceholder = dialog.dataset.ed;
+ const [methodStr, btnClass, btnText] = dialog.dataset.eb.split(',');
+ const methodName = methodStr.replace('()', ''); // 提取方法名 "sm"
+
+ // 清空dialog原有内容
+ dialog.innerHTML = '';
+
+ // 创建输入框
+ const input = document.createElement('textarea');
+ input.id='dt';
+ input.placeholder = inputPlaceholder;
+ dialog.appendChild(input);
+
+ const header = document.createElement('div');
+ header.id='dh';
+ header.innerHTML='
-
= htmlspecialchars($content['LocalizedSubject']['Chinese'] ?? '未知标题') ?>
+
= htmlspecialchars($content['LocalizedSubject']['Chinese'] ?? $content['Subject']) ?>
= htmlspecialchars($content['Category'] === 'Model' ? 'Model' : 'Experiment') ?>
@@ -212,7 +211,7 @@ function formatDate($timestamp) {
= nl2br(htmlspecialchars($content['LocalizedDescription']['Chinese'])) ?>
-
暂无作品介绍
+ = implode('
', $content['Description']) ?>
From 888e3be582ae738664f5eabdac98405d634706e9 Mon Sep 17 00:00:00 2001
From: Tiaotiao <65841827@qq.com>
Date: Sun, 30 Nov 2025 16:09:04 +0800
Subject: [PATCH 13/17] Update dialog styles and layout for responsiveness
Refactor dialog styles for improved layout and responsiveness.
---
styles/comment.css | 191 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 147 insertions(+), 44 deletions(-)
diff --git a/styles/comment.css b/styles/comment.css
index 262ebfb..d938a86 100644
--- a/styles/comment.css
+++ b/styles/comment.css
@@ -1,33 +1,3 @@
-dialog {
- position: fixed;
- top: 0%;
- left: 0%;
- height: 100%;
- width: 100%;
- border: none;
- z-index: 100;
- overflow: hidden;
-}
-
-#dt {
- position: absolute;
- top: 10%;
- left: 0%;
- height: 90%;
- width: 100%;
- border: none;
- font-size: 3vh;
-}
-
-#dh {
- position: absolute;
- top: 0%;
- left: 0%;
- height: 10%;
- width: 100%;
- background-color: #eee;
- }
-
.red {
background-color: #e00;
position: absolute;
@@ -40,24 +10,157 @@ dialog {
border-radius: 10px;
}
+textarea:focus {
+ border-color: rgba(0,0,0,0);
+ outline: none;
+ box-shadow: 0 0 0.1px rgba(255,255,255,0);
+}
+
+/* 评论框样式修复 */
+dialog {
+ position: fixed;
+ top: 5%;
+ left: 5%;
+ z-index: 80;
+ height: 90%;
+ width: 90%;
+ border: none;
+ border-radius: 12px;
+ box-shadow: 0 10px 30px rgba(0,0,0,0.3);
+ background: white;
+ overflow: hidden;
+}
+
+#dt {
+ position: absolute;
+ top: 10%;
+ left: 0%;
+ height: 90%;
+ width: 100%;
+ border: none;
+ font-size: 16px;
+ padding: 20px;
+ resize: none;
+ font-family: inherit;
+ line-height: 1.5;
+ background: #fafafa;
+}
+
+#dh {
+ position: absolute;
+ top: 0%;
+ left: 0%;
+ height: 10%;
+ width: 100%;
+ background-color: #f8f9fa;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 20px;
+ border-bottom: 1px solid #e9ecef;
+ }
+
+#dh img {
+ cursor: pointer;
+ padding: 8px;
+ border-radius: 50%;
+ transition: background-color 0.2s;
+}
+
+#dh img:hover {
+ background-color: rgba(0,0,0,0.1);
+}
+
.mid {
- position: absolute;
- top: -10%;
- left: 8%;
+ font-size: 18px;
+ font-weight: 600;
+ color: #333;
+ margin: 0;
+}
+
+.red {
+ background-color: red;
+ position: static;
+ height: auto;
+ width: auto;
+ color: white;
+ font-size: 14px;
+ border-radius: 10px;
+ border: none;
+ padding: 8px 20px;
+ cursor: pointer;
+ transition: background-color 0.3s;
+ margin: 0;
+}
+
+.red:hover {
+ background-color: #1060c0;
}
+/* 移除原有的绝对定位样式 */
+.red,
+.mid {
+ position: static;
+ top: auto;
+ left: auto;
+}
+
+/* 移动端适配 */
+@media (max-width: 768px) {
+ dialog {
+ top: 2%;
+ left: 2%;
+ height: 96%;
+ width: 96%;
+ }
+
+ #dt {
+ font-size: 14px;
+ padding: 15px;
+ }
+
+ .mid {
+ font-size: 16px;
+ }
+
+ .red {
+ padding: 6px 16px;
+ font-size: 13px;
+ }
+
+ #dh {
+ padding: 0 15px;
+ }
+}
+
+/* 对话框背景遮罩 */
+dialog::backdrop {
+ background: rgba(0, 0, 0, 0.5);
+ backdrop-filter: blur(2px);
+}
+
+/* #start 按钮位置和尺寸修复 */
#start {
- height: 30px;
- width: 50%;
- border: 1px solid #111;
- border-radius: none;
- text-align: left;
- color: gray;
- background-color: #eee;
+ position: fixed;
+ bottom: 0px;
+ right: 0%;
+ transform: translateY(-10%);
+ height: 40px;
+ width: 48%;
+ z-index: 70;
+ border: 1px solid #111;
+ border-radius: none;
+ text-align: left;
+ color: gray;
+ background-color: #f6f6f6;
}
-textarea:focus {
- border-color: rgba(0,0,0,0);
- outline: none;
- box-shadow: 0 0 0.1px rgba(255,255,255,0);
+/* 移动端适配 */
+@media (max-width: 768px) {
+ #start {
+ bottom: 0px;
+ width: 98%;
+ max-width: 700px;
+ height: 45px;
+ }
}
From a65d799745f1ec843853c0802c8cbe48d7895d9f Mon Sep 17 00:00:00 2001
From: Tiaotiao <65841827@qq.com>
Date: Sun, 30 Nov 2025 16:09:54 +0800
Subject: [PATCH 14/17] Fix image source and refactor trigger button logic
Updated image source path and modified trigger button handling.
---
scripts/comment.js | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/scripts/comment.js b/scripts/comment.js
index 1f57fe8..fa43547 100644
--- a/scripts/comment.js
+++ b/scripts/comment.js
@@ -1,4 +1,3 @@
-document.addEventListener('DOMContentLoaded', () => {
const dialog = document.querySelector('dialog');
const originalText = dialog.innerHTML.trim(); // 获取原始文本 "编辑评论内容"
@@ -19,7 +18,7 @@ document.addEventListener('DOMContentLoaded', () => {
const header = document.createElement('div');
header.id='dh';
- header.innerHTML='

'+inputPlaceholder+'
';
+ header.innerHTML='

'+inputPlaceholder+'
';
dialog.appendChild(header);
// 创建提交按钮
@@ -49,19 +48,11 @@ document.addEventListener('DOMContentLoaded', () => {
}
});
- // 创建触发按钮并添加到页面
- const trigger = document.createElement('button');
- trigger.textContent = originalText;
- trigger.id='start';
- trigger.style.margin = '10px'; // 添加间距
- document.body.insertBefore(trigger, dialog); // 插入到dialog前面
-
// 点击触发按钮打开对话框
- trigger.addEventListener('click', () => {
+ document.getElementById('start').addEventListener('click', () => {
dialog.showModal();
input.focus(); // 自动聚焦输入框
});
-});
/* 示例sm函数 */
function sm(value) {
From 22c2d27739d2158ea9bf0601697111cd197c4699 Mon Sep 17 00:00:00 2001
From: Tiaotiao <65841827@qq.com>
Date: Sun, 30 Nov 2025 16:10:46 +0800
Subject: [PATCH 15/17] Refactor comment.html to use a button for comments
---
comment/comment.html | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/comment/comment.html b/comment/comment.html
index aa474a1..6fcaf77 100644
--- a/comment/comment.html
+++ b/comment/comment.html
@@ -1,13 +1,3 @@
-
-
-
-
-
-
编辑评论
-
-
-
-
-
-
-
+
+
+
From 4f49b28fe6dbba06f76607c72c6c0ad7fa55d738 Mon Sep 17 00:00:00 2001
From: Tiaotiao <65841827@qq.com>
Date: Sun, 30 Nov 2025 16:11:46 +0800
Subject: [PATCH 16/17] Refactor user info section with tabs
Updated the layout to include a tabbed interface for user information and comments, and removed the statistics section.
---
med.php | 103 ++++++++++++++------------------------------------------
1 file changed, 26 insertions(+), 77 deletions(-)
diff --git a/med.php b/med.php
index c76d079..d27151b 100644
--- a/med.php
+++ b/med.php
@@ -102,7 +102,7 @@ function formatDate($timestamp) {
= htmlspecialchars($content['LocalizedSubject']['Chinese'] ?? $pageTitle) ?> - Turtle Universe Web
-
+
@@ -154,7 +154,18 @@ function formatDate($timestamp) {