PageSourceSearch

https://rodrigofreire.dev.br/assets/AdmStyle-CGTAwQVY.js

js rodrigofreire.dev.br collected 2026-10-09 22:05:09 UTC 17,673 bytes, 1 lines download raw bytes

1import{l as e}from"./vendor-markdown-CSFor3mi.js";import{r as h}from"./vendor-react-zXH343FE.js";import{b as _,s as S}from"./index-X36VhafU.js";import{a1 as k,s as z,t as I,d as C,h as N,a5 as R,a6 as w}from"./vendor-icons-DDsQOxrI.js";import"./vendor-supabase-BnGCNdwk.js";function b(s){if(!s)return{hex:"#2563eb",alpha:1};const o=s.trim(),a=o.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)$/i);if(a){const r=parseInt(a[1],10),m=parseInt(a[2],10),l=parseInt(a[3],10),i=a[4]!==void 0?parseFloat(a[4]):1;return{hex:"#"+[r,m,l].map(c=>{const x=c.toString(16);return x.length===1?"0"+x:x}).join(""),alpha:Math.min(1,Math.max(0,i))}}if(o.startsWith("#")){let r=o;return r.length===4&&(r="#"+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),{hex:r,alpha:1}}return{hex:"#2563eb",alpha:1}}function y(s,o){const r=b(s).hex.replace("#",""),m=parseInt(r.substring(0,2),16)||0,l=parseInt(r.substring(2,4),16)||0,i=parseInt(r.substring(4,6),16)||0,d=Math.round(o*100)/100;return`rgba(${m}, ${l}, ${i}, ${d})`}const E=[{name:"Vidro Apple (62%)",value:"rgba(17, 24, 39, 0.62)"},{name:"Vidro Escuro (85%)",value:"rgba(11, 15, 25, 0.85)"},{name:"Azul Royal",value:"rgba(37, 99, 235, 1)"},{name:"Azul Safira Glow",value:"rgba(59, 130, 246, 0.5)"},{name:"Ciano Técnico",value:"rgba(14, 165, 233, 0.85)"},{name:"Verde Esmeralda",value:"rgba(16, 185, 129, 0.85)"},{name:"Borda Cristal (12%)",value:"rgba(255, 255, 255, 0.12)"},{name:"Overlay Noturno (75%)",value:"rgba(9, 13, 22, 0.75)"},{name:"Totalmente Transparente",value:"rgba(0, 0, 0, 0)"}];function j({label:s,value:o,onChange:a}){const{hex:r,alpha:m}=b(o),[l,i]=h.useState(r),[d,c]=h.useState(m);h.useEffect(()=>{const n=b(o);i(n.hex),c(n.alpha)},[o]);const x=n=>{i(n);const p=y(n,d);a(p)},v=n=>{const p=Math.min(1,Math.max(0,n/100));c(p);const u=y(l,p);a(u)},t=n=>{const p=b(n);i(p.hex),c(p.alpha),a(n)},g=Math.round(d*100),f=y(l,d);return e.jsxs("div",{style:{background:"rgba(255, 255, 255, 0.55)",border:"1px solid rgba(0, 0, 0, 0.12)",borderRadius:"16px",padding:"1.25rem",marginBottom:"1.25rem",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"},children:[s&&e.jsx("label",{style:{display:"block",marginBottom:"0.85rem",fontWeight:"700",color:"var(--text-heading)",fontSize:"0.95rem"},children:s}),e.jsxs("div",{style:{display:"flex",gap:"1.2rem",flexWrap:"wrap",alignItems:"center"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.35rem",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",fontWeight:"500"},children:"Paleta / Matiz"}),e.jsx("div",{style:{position:"relative",width:"56px",height:"56px",borderRadius:"12px",overflow:"hidden",border:"2px solid rgba(0, 0, 0, 0.2)",boxShadow:"0 4px 14px rgba(0, 0, 0, 0.08)",cursor:"pointer"},children:e.jsx("input",{type:"color",value:l,onChange:n=>x(n.target.value),style:{position:"absolute",top:"-12px",left:"-12px",width:"80px",height:"80px",border:"none",cursor:"pointer",background:"transparent"},title:"Clique para abrir a paleta de cores"})}),e.jsx("span",{style:{fontSize:"0.75rem",fontFamily:"monospace",color:"var(--text-heading)",fontWeight:"600"},children:l.toUpperCase()})]}),e.jsxs("div",{style:{flex:"1 1 220px",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-body)",fontWeight:"500"},children:"Intensidade / Opacidade:"}),e.jsxs("span",{style:{fontWeight:"700",color:"var(--color-brand-ink)",fontSize:"0.95rem"},children:[g,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:g,onChange:n=>v(Number(n.target.value)),style:{width:"100%",height:"8px",borderRadius:"4px",accentColor:"var(--color-brand-ink)",cursor:"pointer"}}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.7rem",color:"var(--text-muted)"},children:[e.jsx("span",{children:"Translúcido (0%)"}),e.jsx("span",{children:"Sólido (100%)"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.35rem",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",fontWeight:"500"},children:"Preview"}),e.jsx("div",{style:{width:"60px",height:"56px",borderRadius:"12px",border:"2px s
1olid rgba(0, 0, 0, 0.2)",backgroundImage:"linear-gradient(45deg, #cbd5e1 25%, transparent 25%), linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cbd5e1 75%), linear-gradient(-45deg, transparent 75%, #cbd5e1 75%)",backgroundSize:"12px 12px",backgroundPosition:"0 0, 0 6px, 6px -6px, -6px 0px",position:"relative",overflow:"hidden",boxShadow:"0 4px 14px rgba(0, 0, 0, 0.08)"},children:e.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:f}})}),e.jsx("span",{style:{fontSize:"0.7rem",color:"var(--text-muted)"},children:"Camada"})]})]}),e.jsxs("div",{style:{marginTop:"1rem",display:"flex",alignItems:"center",gap:"0.8rem"},children:[e.jsx("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)"},children:"Código RGBA:"}),e.jsx("input",{type:"text",value:f,onChange:n=>a(n.target.value),className:"adm-input",style:{flex:1,padding:"0.45rem 0.85rem",color:"var(--color-brand-ink)",fontFamily:"monospace",fontSize:"0.85rem",fontWeight:"600"}})]}),e.jsxs("div",{style:{marginTop:"1rem",borderTop:"1px solid rgba(0, 0, 0, 0.08)",paddingTop:"0.8rem"},children:[e.jsx("span",{style:{display:"block",fontSize:"0.78rem",color:"var(--text-muted)",marginBottom:"0.5rem"},children:"Paletas Rápidas & Liquid Glass:"}),e.jsx("div",{style:{display:"flex",gap:"0.45rem",flexWrap:"wrap"},children:E.map((n,p)=>e.jsxs("button",{type:"button",onClick:()=>t(n.value),style:{padding:"0.3rem 0.65rem",fontSize:"0.75rem",borderRadius:"999px",border:"1px solid rgba(0, 0, 0, 0.15)",background:"rgba(255, 255, 255, 0.75)",color:"var(--text-body)",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.45rem",transition:"all 0.15s ease"},onMouseOver:u=>u.currentTarget.style.transform="translateY(-1px)",onMouseOut:u=>u.currentTarget.style.transform="translateY(0)",children:[e.jsx("span",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:n.value,border:"1px solid rgba(0, 0, 0, 0.2)",display:"inline-block"}}),n.name]},p))})]})]})}function A({settings:s,setSettings:o}){const[a,r]=h.useState(s||_),[m,l]=h.useState(!1),[i,d]=h.useState(""),[c,x]=h.useState(!1);h.useEffect(()=>{s&&r(s)},[s]);const v=async t=>{t.preventDefault(),l(!0),d(""),x(!1);try{const{error:g}=await S.from("home_settings").upsert({id:1,...a,updated_at:new Date});if(g)throw g;o&&o(a),d("Configurações visuais salvas e aplicadas com sucesso!")}catch(g){x(!0),d("Erro ao salvar no banco: "+(g.message||"Verifique sua conexão."))}finally{l(!1)}};return e.jsxs("div",{style:{maxWidth:"960px"},children:[e.jsxs("div",{style:{marginBottom:"2rem"},children:[e.jsxs("div",{className:"corp-badge",style:{marginBottom:"0.65rem"},children:[e.jsx(k,{size:14}),e.jsx("span",{children:"Editor de Estilo & Canvas"})]}),e.jsx("h2",{style:{fontSize:"1.85rem",fontWeight:"800",margin:"0 0 0.5rem 0"},children:"Estilo Visual & Fundo da Home"}),e.jsx("p",{style:{color:"#94a3b8",fontSize:"0.95rem",margin:0},children:"Combine imagens de fundo, controle stickers/nuvens flutuantes, ajuste o nível de glassmorphism e altere cores com precisão."})]}),i&&e.jsxs("div",{style:{padding:"1rem 1.25rem",borderRadius:"12px",backgroundColor:c?"rgba(239, 68, 68, 0.15)":"rgba(16, 185, 129, 0.15)",border:`1px solid ${c?"rgba(239, 68, 68, 0.35)":"rgba(16, 185, 129, 0.35)"}`,color:c?"#fca5a5":"#6ee7b7",display:"flex",alignItems:"center",gap:"0.65rem",marginBottom:"2rem",fontWeight:"600"},children:[c?e.jsx(z,{size:18}):e.jsx(I,{size:18}),e.jsx("span",{children:i})]}),e.jsxs("form",{onSubmit:v,style:{display:"flex",flexDirection:"column",gap:"2rem"},children:[e.jsxs("div",{className:"glass-panel",style:{padding:"1.85rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.65rem",marginBottom:"1.25rem"},children:[e.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-brand-ink)"},children:e.jsx(C,{size:18})}),e.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:"700",margin:0,color:"var(--text-heading)"}
1,children:"1. Imagem de Fundo Principal (Background Base)"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:"1.25rem",marginBottom:"1.5rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:"adm-label",children:"URL da Imagem de Fundo / Padrão"}),e.jsx("input",{type:"text",value:a.bg_image_url||"",onChange:t=>r({...a,bg_image_url:t.target.value}),placeholder:"Ex: /images/background-pattern.png ou URL externa",className:"adm-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"adm-label",children:"Modo de Escala / Tamanho"}),e.jsxs("select",{value:a.bg_image_size||"cover",onChange:t=>r({...a,bg_image_size:t.target.value}),className:"adm-select",children:[e.jsx("option",{value:"cover",children:"Preenchimento Completo (Cover)"}),e.jsx("option",{value:"contain",children:"Conter Proporcional (Contain)"}),e.jsx("option",{value:"400px",children:"Padrão Repetível (400px)"}),e.jsx("option",{value:"250px",children:"Textura Fina (250px)"}),e.jsx("option",{value:"auto",children:"Automático / Tamanho Real (Auto)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"adm-label",children:"Repetição da Imagem"}),e.jsxs("select",{value:a.bg_image_repeat||"no-repeat",onChange:t=>r({...a,bg_image_repeat:t.target.value}),className:"adm-select",children:[e.jsx("option",{value:"no-repeat",children:"Sem Repetição (Única)"}),e.jsx("option",{value:"repeat",children:"Repetir em Grade (X e Y)"}),e.jsx("option",{value:"repeat-x",children:"Repetir na Horizontal (X)"}),e.jsx("option",{value:"repeat-y",children:"Repetir na Vertical (Y)"})]})]})]}),e.jsx(j,{label:"Cor e Opacidade da Camada de Sobreposição (Overlay Tint)",value:a.overlay_color||"rgba(9, 13, 22, 0.75)",onChange:t=>r({...a,overlay_color:t})})]}),e.jsxs("div",{className:"glass-panel",style:{padding:"1.85rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.65rem",marginBottom:"1.25rem"},children:[e.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-brand-ink)"},children:e.jsx(N,{size:18})}),e.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:"700",margin:0,color:"var(--text-heading)"},children:"2. Elemento Decorativo Flutuante (Sticker / PNG)"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"1.25rem",marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{gridColumn:"1 / -1"},children:[e.jsx("label",{className:"adm-label",children:"URL da Imagem Flutuante (PNG com fundo transparente)"}),e.jsx("input",{type:"text",value:a.hero_char_url||"",onChange:t=>r({...a,hero_char_url:t.target.value}),placeholder:"Ex: /images/sticker_nuvem.png ou URL externa",className:"adm-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"adm-label",children:"Posição na Tela"}),e.jsxs("select",{value:a.hero_char_position||"bottom-right",onCh
1ange:t=>r({...a,hero_char_position:t.target.value}),className:"adm-select",children:[e.jsx("option",{value:"bottom-right",children:"Inferior Direito (Canto)"}),e.jsx("option",{value:"bottom-left",children:"Inferior Esquerdo (Canto)"}),e.jsx("option",{value:"center-bottom",children:"Centro Inferior"}),e.jsx("option",{value:"top-right",children:"Superior Direito"}),e.jsx("option",{value:"top-left",children:"Superior Esquerdo"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"adm-label",children:"Tamanho / Largura Máxima"}),e.jsx("input",{type:"text",value:a.hero_char_size||"380px",onChange:t=>r({...a,hero_char_size:t.target.value}),placeholder:"Ex: 380px, 450px, 30vw",className:"adm-input"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"adm-label",children:["Opacidade (",Math.round((a.hero_char_opacity??1)*100),"%)"]}),e.jsx("input",{type:"range",min:"0",max:"100",value:Math.round((a.hero_char_opacity??1)*100),onChange:t=>r({...a,hero_char_opacity:Number(t.target.value)/100}),style:{width:"100%",height:"8px",accentColor:"var(--color-brand-ink)",marginTop:"0.8rem",cursor:"pointer"}})]})]})]}),e.jsxs("div",{className:"glass-panel",style:{padding:"1.85rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.65rem",marginBottom:"1.25rem"},children:[e.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-brand-ink)"},children:e.jsx(C,{size:18})}),e.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:"700",margin:0,color:"var(--text-heading)"},children:"2B. Camada Decorativa de Rodapé (ex: Nuvens / Horizonte)"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"1.25rem"},children:[e.jsxs("div",{style:{gridColumn:"1 / -1"},children:[e.jsx("label",{className:"adm-label",children:"URL da Camada Decorativa de Rodapé (PNG transparente repetível na horizontal)"}),e.jsx("input",{type:"text",value:a.secondary_bg_url||"",onChange:t=>r({...a,secondary_bg_url:t.target.value}),placeholder:"Ex: /images/nuvens_rodape.png",className:"adm-input"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"adm-label",children:"Altura da Camada"}),e.jsx("input",{type:"text",value:a.secondary_bg_size||"300px",onChange:t=>r({...a,secondary_bg_size:t.target.value}),placeholder:"Ex: 300px, 40vh",className:"adm-input"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"adm-label",children:["Opacidade (",Math.round((a.secondary_bg_opacity??.9)*100),"%)"]}),e.jsx("input",{type:"range",min:"0",max:"100",value:Math.round((a.secondary_bg_opacity??.9)*100),onChange:t=>r({...a,secondary_bg_opacity:Number(t.target.value)/100}),style:{width:"100%",height:"8px",accentColor:"var(--color-brand-ink)",marginTop:"0.8rem",cursor:"pointer"}})]})]})]}),e.jsxs("div",{className:"glass-panel",style:{padding:"1.85rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.65rem",marginBottom:"1.25rem"},children:[e.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-brand-ink)"},children:e.jsx(R,{size:18})}),e.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:"700",margin:0,color:"var(--text-heading)"},children:"3. Delimitação Central & Efeito Glassmorphism"})]}),e.jsxs("div",{style:{padding:"1.25rem",borderRadius:"12px",background:"rgba(0, 0, 0, 0.03)",border:"1px solid rgba(0, 0, 0, 0.12)",marginBottom:"1.5rem",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"1rem"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:"700",fontSize:"1rem",color:"var(--text-heading)"},children:"Delimitação com Caixa de Vidro ao Centro"}),e.jsx("p",{style:{fontSize:"0.85rem",color:"var(--text-muted)",margin:"0.2rem 0 0 0"},children:a.content_has_border?"Ativo: O conteúdo central fica dentro de uma caixa com borda e vidro translúcido.":"Desativado: O conteúdo flutua livremente sobre o fundo e as nuvens, sem caixa externa."})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.6rem",cursor:"pointer"}
1,children:[e.jsx("input",{type:"checkbox",checked:!!a.content_has_border,onChange:t=>r({...a,content_has_border:t.target.checked}),style:{width:"22px",height:"22px",accentColor:"var(--color-brand-ink)",cursor:"pointer"}}),e.jsx("span",{style:{fontWeight:"600",color:"var(--color-brand-ink)"},children:a.content_has_border?"Com Moldura":"Sem Moldura"})]})]}),a.content_has_border&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{marginBottom:"1.5rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.4rem"},children:[e.jsx("label",{className:"adm-label",children:"Nível de Desfoque de Vidro (Blur):"}),e.jsxs("span",{style:{fontWeight:"700",color:"var(--color-brand-ink)"},children:[a.content_blur_level||20,"px"]})]}),e.jsx("input",{type:"range",min:"0",max:"40",value:a.content_blur_level||20,onChange:t=>r({...a,content_blur_level:Number(t.target.value)}),style:{width:"100%",height:"8px",accentColor:"var(--color-brand-ink)",cursor:"pointer"}})]}),e.jsx(j,{label:"Cor e Transparência do Fundo do Container Central",value:a.content_bg_color||"rgba(17, 24, 39, 0.62)",onChange:t=>r({...a,content_bg_color:t})}),e.jsx(j,{label:"Cor e Transparência da Borda de Vidro",value:a.content_border_color||"rgba(255, 255, 255, 0.12)",onChange:t=>r({...a,content_border_color:t})})]})]}),e.jsxs("div",{style:{position:"sticky",bottom:"20px",zIndex:50,background:"rgba(252, 252, 251, 0.92)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",padding:"1rem 1.5rem",borderRadius:"16px",border:"1px solid rgba(0, 0, 0, 0.15)",display:"flex",justifyContent:"space-between",alignItems:"center",boxShadow:"0 12px 36px rgba(0, 0, 0, 0.12)"},children:[e.jsx("span",{style:{fontSize:"0.88rem",color:"var(--text-muted)"},children:"As alterações são aplicadas e salvas diretamente no banco."}),e.jsxs("button",{type:"submit",disabled:m,className:"corp-btn corp-btn-primary",style:{padding:"0.75rem 2rem"},children:[e.jsx(w,{size:18}),e.jsx("span",{children:m?"Gravando Alterações...":"Salvar Estilo Visual"})]})]})]})]})}export{A 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.