Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

palette-0cc2187d.js 3.1 KiB

il y a 9 mois
1
  1. import{j as f,k as n,z as y,C as k,s as x,c,a as e,F as w,u as $,i as C,t as j,d as V,e as z,o as i,m as B,B as F,A as o}from"./index-5dca7a6a.js";import{c as R,g as v,a as S}from"./api-2fe5baa7.js";const N={class:"page-wrapper",id:"app","data-layout":"horizontal","data-navbarbg":"skin6","data-sidebartype":"full","data-sidebar-position":"fixed","data-header-position":"fixed"},A=V('<header class="app-header"><nav class="navbar navbar-expand-lg navbar-light container-fluid px-0"><ul class="navbar-nav"><li class="nav-item d-block d-lg-none"><a class="nav-link sidebartoggler ms-n3" id="sidebarCollapse" href="javascript:void(0)"><i class="ti ti-menu-2"></i></a></li><li class="nav-item d-none d-lg-block"><a href="index.html" class="text-nowrap nav-link"><img src="'+z+'" class="light-logo" width="180" alt=""></a></li></ul></nav></header>',1),D={class:"body-wrapper overflow-hidden"},L={class:"position-relative overflow-hidden min-vh-100 d-flex align-items-center justify-content-center drawise-auth-bg"},M={class:"d-flex align-items-center justify-content-center w-100"},P={class:"row justify-content-center w-100"},T={class:"col-md-8 col-lg-8 col-xxl-8"},U={class:"card mb-0"},E={class:"card-body"},G=e("h1",{class:"display-6 fs-7 mb-4 text-center"}," Pick your prefred colors ",-1),I={class:"checkbox-group"},q={class:"checkbox-wrapper"},H=["onUpdate:modelValue","onChange"],J={class:"checkbox-tile"},K={class:"palette"},O=["disabled"],Q=e("i",{class:"ti ti-chevron-right fs-4 me-2"},null,-1),ae=f({__name:"palette",setup(W){const d=n(),s=n(!1),l=n("Continue"),r=y().params.id,p=k(),u=n();x(()=>{R(),g()});const _=n();async function g(){try{s.value=!0,l.value="Getting info...",(await v)("/color_swatches/").then(a=>{console.log(a.data),d.value=a.data,s.value=!1,l.value="Continue"}),v(`/create_site/sites/${r}/`).then(a=>{u.value=a.data.site_name,s.value=!1}).catch(()=>{s.value=!1,l.value="Failed. Refresh the page"})}catch(a){console.error(a)}}const b=a=>{_.value=a,console.log(a)},m=async()=>{s.value=!0,l.value="loading",(await S)(`/create_site/sites/${r}/`,{site_name:u.value,color_swatch:_.value}).then(a=>{a.data&&(console.log(a.data),p.push("tag"),s.value=!1)}).catch(()=>{s.value=!1,l.value="Failed. Try Again"}),console.log("alert")};return(a,Y)=>(i(),c("div",N,[A,e("div",D,[e("div",L,[e("div",M,[e("div",P,[e("div",T,[e("div",U,[e("div",E,[e("div",null,[G,e("fieldset",I,[(i(!0),c(w,null,$(d.value,t=>(i(),c("div",{key:t,class:"checkbox"},[e("label",q,[B(e("input",{type:"radio",class:"checkbox-input","onUpdate:modelValue":h=>t.name=h,onChange:h=>b(t.id),name:"color"},null,40,H),[[F,t.name]]),e("span",J,[e("ul",K,[e("li",{style:o(`background-color: ${t.color1}`)},null,4),e("li",{style:o(`background-color: ${t.color2}`)},null,4),e("li",{style:o(`background-color: ${t.color3}`)},null,4),e("li",{style:o(`background-color: ${t.color4}`)},null,4),e("li",{style:o(`background-color: ${t.color5}`)},null,4),e("li",{style:o(`background-color: ${t.color6}`)},null,4)])])])]))),128))]),e("button",{onClick:m,disabled:s.value,class:"btn btn-success w-100 py-8 mb-4 rounded-2"},[C(j(l.value)+" ",1),Q],8,O)])])])])])])])])]))}});export{ae as default};