chore: replace footer columns with a single copyright line

- footer is now '© hobbypj 2026' centred on one row; brand/note/contact columns removed
- site-level contact_email retired end to end (schema, payload, server validation,
  admin field, footer link logic); project-level contact_email untouched
- content-only change: service worker version unchanged (network-first)
This commit is contained in:
Bkk1234 committed 2026-11-19 11:24:59 +07:00
1 parent ebaefc8fb7
commit f9dffbd132
9 files changed
+11 -70

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ PUBLISH_PUSH=0 node server/publish.mjs # เขียน+commit แต่ไ
"schema_version": 1,
"updated_at": "ISO-8601",
"owner_name": "",
"site": { "site_title": "", "welcome_message": "", "contact_email": "" },
"site": { "site_title": "", "welcome_message": "" },
"projects": [
{ "project_id": "", "project_name": "", "project_description": "",
"project_url": "https://…", "contact_email": "", "icon": "folder" }
+1 -1
View File
@@ -5,7 +5,7 @@
## 1. แนวคิด
- เว็บรวมโปรเจคอดิเรกส่วนตัว: **เรียบ อบอุ่น อ่านง่าย** ไม่ใช่เว็บขายของ
- โครงหน้าและจังหวะการวางอ้างอิง **fastwork.com** (ฮีโร่ + ช่องค้นหา + การ์ดเป็นตาราง + ฟุตเตอร์ 2 คอลัมน์)
- โครงหน้าและจังหวะการวางอ้างอิง **fastwork.com** (ฮีโร่ + ช่องค้นหา + การ์ดเป็นตาราง + ฟุตเตอร์บรรทัดเดียว)
- ธีมสี: **น้ำตาล + ขาว** เลือกเฉดน้ำตาลที่ “สดและสว่าง” (โมก้า-คาราเมล) หลีกเลี่ยงน้ำตาลเข้มแบบซีเปีย/วินเทจที่สื่อถึงความเก่า
- ภาษาไทยทั้งหน้า ไม่มีคำอังกฤษลอยเป็นป้าย/หัวข้อ (ชื่อโดเมนและคำเทคนิคเท่านั้นที่คงอังกฤษ)
+7 -16
View File
@@ -393,26 +393,17 @@ select {
.site-footer {
border-top: 1px solid var(--border);
background: var(--surface-2);
padding-block: var(--space-10);
font-size: 14px;
padding-block: var(--space-6);
font-size: 13.5px;
}
.site-footer__inner {
display: grid;
gap: var(--space-6);
display: flex;
justify-content: center;
text-align: center;
}
.site-footer__brand {
font-weight: 700;
color: var(--brand-900);
font-size: 15px;
}
.site-footer__title {
font-weight: 500;
color: var(--brand-800);
margin-bottom: 2px;
}
.site-footer__note {
.site-footer__copyright {
color: var(--muted-foreground);
max-width: 34ch;
letter-spacing: 0.01em;
}
/* ---------------------------------------------------------------- toast */
+1 -2
View File
@@ -4,8 +4,7 @@
"owner_name": "",
"site": {
"site_title": "โปรเจคอดิเรกของเรา",
"welcome_message": "สวัสดี คนที่เข้ามาดูโปรเจคอดิเรกของเรา เลือกโปรเจคที่อยากดู ขอบคุณครับ",
"contact_email": ""
"welcome_message": "สวัสดี คนที่เข้ามาดูโปรเจคอดิเรกของเรา เลือกโปรเจคที่อยากดู ขอบคุณครับ"
},
"projects": [
{
+1 -8
View File
@@ -72,14 +72,7 @@
<footer class="site-footer">
<div class="wrap site-footer__inner">
<div class="site-footer__col">
<p class="site-footer__brand">โปรเจคอดิเรกของเรา</p>
<p class="site-footer__note">เว็บเล็ก ๆ ที่ทำเล่นเพราะอยากทำ ไม่ได้มีไว้ขาย</p>
</div>
<div class="site-footer__col">
<p class="site-footer__title">ติดต่อ</p>
<p class="site-footer__note"><a data-contact-link href="#/admin">เพิ่มอีเมลติดต่อได้ในหน้าจัดการ</a></p>
</div>
<p class="site-footer__copyright">© hobbypj 2026</p>
</div>
</footer>
-3
View File
@@ -89,8 +89,6 @@ function validate(payload) {
else {
if (typeof site.welcome_message !== "string" || !site.welcome_message.trim())
errors.push("ข้อความต้อนรับว่าง");
if (site.contact_email && !/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(site.contact_email).trim()))
errors.push("อีเมลติดต่อของเว็บไม่ถูกต้อง");
}
if (!Array.isArray(payload.projects)) {
errors.push("projects ต้องเป็น array");
@@ -121,7 +119,6 @@ function serialize(payload) {
site: {
site_title: payload.site.site_title || "",
welcome_message: payload.site.welcome_message || "",
contact_email: payload.site.contact_email || "",
},
projects: payload.projects.map((project) => ({
project_id: String(project.project_id || "").trim(),
-17
View File
@@ -25,13 +25,11 @@ const ctx = {
setData(data) {
state.data = normalizeData(data);
state.source = "server";
updateChrome();
},
async reload() {
const result = await loadProjects();
state.data = result.data;
state.source = result.source;
updateChrome();
return result;
},
};
@@ -56,20 +54,6 @@ function renderRoute({ path, view }) {
countUpInside(main);
}
function updateChrome() {
const site = state.data.site || {};
const contact = document.querySelector("[data-contact-link]");
if (contact) {
if (site.contact_email) {
contact.href = `mailto:${site.contact_email}`;
contact.textContent = site.contact_email;
} else {
contact.href = "#/admin";
contact.textContent = "เพิ่มอีเมลติดต่อได้ในหน้าจัดการ";
}
}
}
function skeleton() {
main.innerHTML = `
<div class="wrap">
@@ -88,7 +72,6 @@ async function boot() {
const result = await loadProjects();
state.data = result.data;
state.source = result.source;
updateChrome();
defineRoutes({ "/": homeView, "/admin": adminView }, "/");
onRouteChange(renderRoute);
-2
View File
@@ -10,7 +10,6 @@ export const DEFAULT_SITE = {
site_title: "โปรเจคอดิเรกของเรา",
welcome_message:
"สวัสดี คนที่เข้ามาดูโปรเจคอดิเรกของเรา เลือกโปรเจคที่อยากดู ขอบคุณครับ",
contact_email: "",
};
const DEFAULT_PROJECT = {
@@ -60,7 +59,6 @@ export function toPublishPayload(data) {
site: {
site_title: data.site.site_title,
welcome_message: data.site.welcome_message,
contact_email: data.site.contact_email,
},
projects: data.projects.map((p) => ({
project_id: p.project_id,
-20
View File
@@ -110,13 +110,6 @@ export function adminView(ctx) {
draft.site.site_title,
)}" />
</div>
<div class="field">
<label class="field__label" for="site-email">อีเมลติดต่อ (ส่วนท้ายเว็บ)</label>
<input id="site-email" type="email" data-site="contact_email" value="${escapeHtml(
draft.site.contact_email,
)}" placeholder="[email protected]" />
<p class="field__error" data-error="site-email"></p>
</div>
</div>
</div>
</section>
@@ -194,12 +187,6 @@ export function adminView(ctx) {
field.addEventListener("input", () => {
const key = field.getAttribute("data-site");
draft.site[key] = field.value;
if (key === "contact_email") {
const errorEl = root.querySelector('[data-error="site-email"]');
const valid = !field.value.trim() || isEmail(field.value);
errorEl.textContent = valid ? "" : "รูปแบบอีเมลไม่ถูกต้อง";
field.closest(".field").classList.toggle("field--error", !valid);
}
saveDraft();
refreshDirty();
});
@@ -456,7 +443,6 @@ export function adminView(ctx) {
clearDraft();
root.querySelector('[data-site="welcome_message"]').value = draft.site.welcome_message;
root.querySelector('[data-site="site_title"]').value = draft.site.site_title;
root.querySelector('[data-site="contact_email"]').value = draft.site.contact_email;
renderList();
refreshDirty();
toast("ดึงข้อมูลล่าสุดแล้ว");
@@ -522,12 +508,6 @@ export function adminView(ctx) {
firstError?.focus();
return;
}
const emailValid = !draft.site.contact_email.trim() || isEmail(draft.site.contact_email);
if (!emailValid) {
toast("อีเมลติดต่อของเว็บไม่ถูกต้อง", "error");
root.querySelector("#site-email")?.focus();
return;
}
const label = trigger.querySelector("span");
const original = label ? label.textContent : "";
if (label) label.textContent = "กำลังเผยแพร่…";