PageSourceSearch

https://ohmygod.jp/_nuxt/DRn8kxlZ.js

js ohmygod.jp collected 2026-09-24 10:41:10 UTC 10,583 bytes, 1 lines download raw bytes

1import{_ as te}from"./Bdpb92rL.js";import{_ as oe}from"./C0JXfWi4.js";import{s as se,p as ae,f as le,a as E}from"./C4Txq05d.js";import{e as ne,I as ie,N as re,x as U,k as $,j as d,n as B,c as l,a as o,G as S,C as p,A as C,F as v,d as A,t as u,w as de,B as L,L as ue,f as O,v as G,g as ce,K as pe,ak as ve,a6 as R,o as s,D as P,b as me,J as ye,_ as ge}from"./BkHyhTLe.js";import{_ as fe}from"./BMBKyxPM.js";import{u as be,a as xe}from"./BlNfJUZx.js";const he={class:"min-h-screen bg-gray-100"},we={class:"container mx-auto px-6 py-12"},_e={class:"flex items-center justify-between gap-4 mb-8"},ke={class:"text-sm text-gray-500 mt-1"},Ie={class:"flex items-center gap-3 shrink-0"},Ce=["disabled"],Ae=["disabled"],Me={key:0,class:"inline-flex items-center gap-2"},Le={key:1},De={key:0,class:"text-sm text-red-600 mb-6"},Ne={key:1,class:"flex items-center justify-center gap-3 py-24 text-gray-500"},je={key:2,class:"preview-culture rounded-2xl border-2 border-gray-200 overflow-hidden"},ze={class:"culture-copy-inner"},Ue={class:"culture-story-title"},$e={class:"culture-story-body"},Be={key:0,class:"culture-note"},Oe={key:1,class:"culture-recruit"},Re={key:1,class:"culture-gallery"},Te={key:0,class:"preview-section-label"},Ve={class:"culture-gallery-inner"},Ee=["aria-label","onClick"],Se=["src","width","height","alt"],Ge={key:0,class:"culture-photo-date"},Pe={key:1,class:"preview-badge"},He={key:3,class:"text-gray-500 py-12"},Ye={class:"relative w-full max-w-xl max-h-[90vh] overflow-y-auto bg-white rounded-2xl shadow-lg"},Fe=["src","alt"],Ke={class:"p-6"},qe={class:"text-lg font-bold mb-4"},Je={class:"space-y-4"},We=["value"],Qe={class:"flex justify-end"},Xe=["disabled"],Ze={key:0},et={key:1},tt={key:2},ot=ne({__name:"preview",setup(st){ie({title:"表示プレビュー | 管理画面 | OH MY GOD",robots:"noindex, nofollow"});const{$firebaseAuth:H}=re(),{uploadImage:Y,updateImageMeta:F}=be(),m=xe(),D=d([]),M=d([]),T=d(!0),y=d(""),g=d(""),K=async()=>{await ve(H),await R("/admin/login")},V=U(()=>{const t=D.value.map(n=>({...n,isNew:!1})),e=m.value;return e?t.map(n=>n.id===e.targetId?{...n,url:e.previewUrl,isNew:!0}:n):t}),q=U(()=>{const t=V.value,e=new Set(M.value.map(r=>r.id)),n=[];let f=0;const a=r=>r.map(w=>({item:w,globalIndex:f++})),h=E(t.filter(r=>!r.tagId||!e.has(r.tagId)),-1);h.length&&n.push({type:"gallery",title:"未設定(見出しなし)",images:a(h)});for(const r of M.value){const w=E(t.filter(i=>i.tagId===r.id),-1);w.length&&(n.push({type:"copy",title:r.title,body:r.body??"",...r.note?{note:r.note}:{}}),n.push({type:"gallery",images:a(w)}))}return n.push({type:"copy",title:"ここまで。",body:"OH MY GODに興味がある方は、ご連絡ください。一緒にお話ししましょう!",showRecruit:!0}),n}),N=d(!1);$(()=>{const t=window.matchMedia("(max-width: 768px)");N.value=t.matches;const e=()=>{N.value=t.matches};t.addEventListener("change",e),B(()=>t.removeEventListener("change",e))});const J=U(()=>N.value?2:4),W=t=>se(t,J.value,({item:e})=>e.width&&e.height?e.height/e.width:1),c=d(null),_=d(""),k=d(""),I=d(""),b=d(!1),x=d(!1),Q=t=>{c.value=t,_.value=t.caption??"",k.value=t.tagId??"",I.value=t.capturedAt??"",x.value=!1},j=()=>{c.value=null,_.value="",k.value="",I.value="",x.value=!1},X=async()=>{const t=c.value;if(t){b.value=!0,y.value="",x.value=!1;try{const e=_.value.trim(),n=k.value.trim()||null,f=I.value.trim()||null;await F(t.id,{caption:e,tagId:n,capturedAt:f});const a=D.value.find(h=>h.id===t.id);a&&(a.caption=e||void 0,a.tagId=n||void 0,a.capturedAt=f||void 0),t.caption=e||void 0,t.tagId=n||void 0,t.capturedAt=f||void 0,x.value=!0,setTimeout(()=>{c.value?.id===t.id&&(x.value=!1)},1500)}catch(e){console.error(e),y.value=`${t.id} のメタ情報保存に失敗しました。`}finally{b.value=!1}}};$(()=>{const t=e=>{e.key==="Escape"&&!b.value&&j()};window.addEventListener("keydown",t),B(()=>window.removeEventListener("keydown",t))});const z=()=>{const t=m.value;t&&URL.revokeObjectURL(t.previewUrl),m.value=null},Z=async()=>{z(),await R("/admin/app/images")},ee=async()=>{const t=m.value;if(t){y.value="";try{g.value="アップロード中...",await Y(t.targetId,t.file),z(),await R("/admin/app/images")}catch(e){console.error(e),y.value="アップロードに失敗しました。"}finally{g.value=""}}};return B(()=>{g.value||z()}),$(async()=>{try{const[t,e]=await Promise.all([$fetch("/api/culture-images"),$fetch("/api/culture-tags").catch(()=>[])]);D.value=t,M.value=e}catch(t){console.error(t),y.value="画像一覧の取得に失敗しました。"}finally{T.value=!1}}),(t,e)=>{const n=te,f=oe;return s(),l("main",he,[o("header",{class:"bg-white border-b-2 border-gray-200 px-6 py-4 flex items-center justify-between"},[e[4]||(e[4]=o("div",{class:"flex items-center gap-3"},[o("img",{src:fe,alt:"OH MY GOD",class:"size-8"}),o("h1",{class:"font-bold text-lg"},"管理画面")],-1)),o("button",{type:"button",class:"text-sm font-bold text-gray-500 hover:text-red-700 transition-colors duration-300",onClick:K}," ログアウト ")]),o("div",we,[o("div",_e,[o("div",null,[e[5]||
1(e[5]=o("h2",{class:"text-xl font-bold"},"表示プレビュー",-1)),o("p",ke,[C(m)?(s(),l(v,{key:0},[A(" /culture と同じセクション構成です。赤枠が "+u(C(m).targetId)+" の差し替え後の画像(WebPに変換されます) ",1)],64)):(s(),l(v,{key:1},[A(" /culture と同じセクション構成(未タグ → タグ順)で確認できます ")],64))])]),o("div",Ie,[C(m)?(s(),l(v,{key:0},[o("button",{type:"button",disabled:!!g.value,class:"rounded-md border-2 border-gray-200 px-4 py-2 text-sm font-bold text-gray-500 transition-colors duration-300 hover:border-red-400 hover:text-red-700 disabled:cursor-not-allowed disabled:opacity-60",onClick:Z}," キャンセル ",8,Ce),o("button",{type:"button",disabled:!!g.value,class:"rounded-md bg-red-700 px-4 py-2 text-sm font-bold text-white transition-colors duration-300 hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-60",onClick:ee},[g.value?(s(),l("span",Me,[e[6]||(e[6]=o("span",{class:"inline-block size-4 animate-spin rounded-full border-2 border-white/40 border-t-white"},null,-1)),A(" "+u(g.value),1)])):(s(),l("span",Le,"差し替える"))],8,Ae)],64)):(s(),S(n,{key:1,to:"/admin/app/images",class:"text-sm font-bold text-gray-500 hover:text-red-700 transition-colors duration-300"},{default:de(()=>[...e[7]||(e[7]=[A(" ← 画像一覧へ戻る ",-1)])]),_:1}))])]),y.value?(s(),l("p",De,u(y.value),1)):p("",!0),T.value?(s(),l("div",Ne,[...e[8]||(e[8]=[o("span",{class:"inline-block size-5 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"},null,-1),A(" 読み込み中... ",-1)])])):V.value.length?(s(),l("div",je,[(s(!0),l(v,null,L(q.value,(a,h)=>(s(),l(v,{key:h},[a.type==="copy"?(s(),l("section",{key:0,class:P(["culture-copy",{"culture-copy--end":a.showRecruit}])},[o("div",ze,[o("p",Ue,u(a.title),1),o("p",$e,u(a.body),1),a.note?(s(),l("p",Be,u(a.note),1)):p("",!0),a.showRecruit?(s(),l("div",Oe,[me(f,{to:"/recruit",text:"採用情報を見る"})])):p("",!0)])],2)):a.images.length?(s(),l("section",Re,[a.title?(s(),l("p",Te,u(a.title),1)):p("",!0),o("div",Ve,[(s(!0),l(v,null,L(W(a.images),(r,w)=>(s(),l("div",{key:w,class:"culture-gallery-column"},[(s(!0),l(v,null,L(r,i=>(s(),l("button",{key:i.item.id,type:"button",class:P(["culture-gallery-photo",{"is-new":i.item.isNew}]),style:ye({"--photo-rotate":`${("photoRotate"in t?t.photoRotate:C(ae))(i.globalIndex)}deg`}),"aria-label":`${i.item.id} を編集`,onClick:at=>Q(i.item)},[o("img",{src:i.item.url,width:i.item.width,height:i.item.height,loading:"lazy",decoding:"async",alt:i.item.caption||`preview-${i.item.id}`},null,8,Se),i.item.capturedAt?(s(),l("span",Ge,u(("formatCapturedAt"in t?t.formatCapturedAt:C(le))(i.item.capturedAt)),1)):p("",!0),i.item.isNew?(s(),l("span",Pe," 差し替え ")):p("",!0)],14,Ee))),128))]))),128))])])):p("",!0)],64))),128))])):(s(),l("p",He,"画像が登録されていません。"))]),(s(),S(pe,{to:"body"},[c.value?(s(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:e[3]||(e[3]=ue(a=>!b.value&&j(),["self"]))},[o("div",Ye,[o("button",{type:"button","aria-label":"閉じる",class:"absolute top-3 right-3 z-10 flex items-center justify-center size-9 rounded-full bg-white/80 text-gray-500 hover:text-red-700 transition-colors duration-300",onClick:j},[...e[9]||(e[9]=[o("i",{class:"fa-solid fa-xmark text-lg"},null,-1)])]),o("img",{src:c.value.url,alt:c.value.id,class:"w-full max-h-[45vh] object-contain bg-gray-50"},null,8,Fe),o("div",Ke,[o("h3",qe,u(c.value.id),1),o("div",Je,[o("div",null,[e[10]||(e[10]=o("label",{for:"preview-caption",class:"block text-sm font-bold text-gray-700 mb-2"}," 一言キャプション ",-1)),O(o("input",{id:"preview-caption","onUpdate:modelValue":e[0]||(e[0]=a=>_.value=a),type:"text",maxlength:"80",placeholder:"例: 撮影合間のひと息",class:"w-full rounded-md border-2 border-gray-200 px-3 py-2 text-sm text-gray-700 placeholder:text-gray-400 focus:border-red-400 focus:outline-none transition-colors duration-300"},null,512),[[G,_.value]])]),o("div",null,[e[12]||(e[12]=o("label",{for:"preview-tag",class:"block text-sm font-bold text-gray-700 mb-2"}," タグ(セクション) ",-1)),O(o("select",{id:"preview-tag","onUpdate:modelValue":e[1]||(e[1]=a=>k.value=a),class:"w-full rounded-md border-2 border-gray-200 px-3 py-2 text-sm text-gray-700 focus:border-red-400 focus:outline-none transition-colors duration-300"},[e[11]||(e[11]=o("option",{value:""},"未設定(見出しなしギャラリー)",-1)),(s(!0),l(v,null,L(M.value,a=>(s(),l("option",{key:a.id,value:a.id},u(a.title),9,We))),128))],512),[[ce,k.value]])]),o("div",null,[e[13]||(e[13]=o("label",{for:"preview-captured-at",class:"block text-sm font-bold text-gray-700 mb-2"}," 撮影日 ",-1)),O(o("input",{id:"preview-captured-at","onUpdate:modelValue":e[2]||(e[2]=a=>I.value=a),type:"date",class:"w-full rounded-md border-2 border-gray-200 px-3 py-2 text-sm text-gray-700 focus:border-red-400 focus:outline-none transition-colors duration-300"},null,512),[[G,I.value]])]),o("div",Qe,[o("button",{type:"button",disabled:b.value,class:"rounded-md bg-red-700 px-4 py-2 text-sm font-bold text-white transition-colors duration-300 hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-60",onClick:X},[b.value?(s(),l("span",Ze,"保存中...")):x.value?(s(),l("span",et,"保存しました")):(s(),l("span",tt,"保存"))],8,Xe)])])])])])):p("",!0)]))])}}}),ct=ge(ot,[["__scopeId","data-v-babe0725"]]);export{ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.