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