お問い合わせ
運営者名: WorkoutTimer運営
返信目安: 3〜5営業日
下のフォームからご連絡ください(メールアドレスは公開していません)。
.wt-contact-form{display:grid;gap:16px;margin-top:16px;max-width:560px}
.wt-contact-field{display:grid;gap:8px}
.wt-contact-field label{font-size:0.95rem;font-weight:600;color:inherit}
.wt-contact-field input,
.wt-contact-field select,
.wt-contact-field textarea{
width:100%;box-sizing:border-box;min-height:44px;padding:12px 16px;
border:1px solid color-mix(in srgb, currentColor 20%, transparent);
border-radius:12px;background:transparent;color:inherit;font:inherit
}
.wt-contact-field textarea{min-height:140px;resize:vertical}
.wt-contact-submit{
min-height:44px;padding:12px 24px;border:0;border-radius:12px;
background:#1d4ed8;color:#fff;font:inherit;font-weight:600;cursor:pointer;width:fit-content
}
.wt-contact-submit:disabled{opacity:.6;cursor:not-allowed}
.wt-contact-status{margin:0;min-height:1.5em;font-size:0.95rem}
.wt-contact-status.is-error{color:#b91c1c}
.wt-contact-status.is-ok{color:#15803d}
.wt-contact-hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
(function () {
var form = document.getElementById(“wt-contact-form”);
var statusEl = document.getElementById(“wt-contact-status”);
if (!form || !statusEl) return;
function setStatus(msg, ok) {
statusEl.textContent = msg || “”;
statusEl.classList.toggle(“is-ok”, !!ok);
statusEl.classList.toggle(“is-error”, !!msg && !ok);
}
form.addEventListener(“submit”, function (e) {
e.preventDefault();
setStatus(“”);
var fd = new FormData(form);
var payload = {
name: String(fd.get(“name”) || “”).trim(),
email: String(fd.get(“email”) || “”).trim(),
category: String(fd.get(“category”) || “”).trim(),
message: String(fd.get(“message”) || “”).trim(),
company: String(fd.get(“company”) || “”).trim()
};
if (!payload.name || !payload.email || !payload.category || payload.message.length < 5) {
setStatus("必須項目を入力してください。", false);
return;
}
var btn = form.querySelector('button[type="submit"]');
if (btn) btn.disabled = true;
setStatus("送信中…", true);
fetch("/api/contact", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(payload)
}).then(function (res) {
return res.json().then(function (body) {
return { ok: res.ok && body && body.ok, status: res.status, body: body };
}).catch(function () {
return { ok: false, status: res.status, body: null };
});
}).then(function (result) {
if (result.ok) {
form.reset();
setStatus("送信しました。返信までしばらくお待ちください。", true);
} else {
setStatus("送信に失敗しました。時間をおいて再度お試しください。", false);
}
}).catch(function () {
setStatus("送信に失敗しました。ネットワーク接続をご確認ください。", false);
}).finally(function () {
if (btn) btn.disabled = false;
});
});
})();