19 lines
27 KiB
JavaScript
19 lines
27 KiB
JavaScript
import{d as w,o as A,F as T,y as o,z as n,G as $,H as l,A as e,E as C,I as _,J as k,C as b,T as U,D as q,B as p,K as y,i as h,_ as R,L as S,M as j,N as I,O as V,P as B,Q as L,l as M,R as N}from"./Dgz6sxCl.js";import{u as F}from"./BGLmsXN0.js";const H={class:"section-container flex items-center justify-between h-16"},G={class:"hidden md:flex items-center gap-8"},O=["href"],D=["aria-label"],J={key:0,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},z={key:1,class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},K={key:0,class:"md:hidden bg-white/95 backdrop-blur-xl border-b border-surface-border"},Z={class:"section-container py-4 flex flex-col gap-3"},Q=["href"],Y=w({__name:"Navbar",setup(x){const u=h(!1);function i(){u.value=window.scrollY>20}A(()=>{window.addEventListener("scroll",i,{passive:!0})}),T(()=>{window.removeEventListener("scroll",i)});const a=[{label:"Features",href:"#features"},{label:"Rates",href:"#rates"},{label:"API Docs",href:"#playground"}],s=h(!1);return(d,t)=>(o(),n("nav",{class:$(["fixed top-0 left-0 right-0 z-50 transition-all duration-300",l(u)?"bg-white/80 backdrop-blur-xl shadow-soft border-b border-surface-border":"bg-transparent"])},[e("div",H,[t[5]||(t[5]=e("a",{href:"#",class:"flex items-center gap-2 group"},[e("span",{class:"inline-flex items-center justify-center w-8 h-8 rounded-lg bg-eu-blue text-white font-heading font-bold text-sm transition-transform group-hover:scale-105"}," V "),e("span",{class:"font-heading font-bold text-lg text-ink"},[C(" vat-api"),e("span",{class:"text-eu-blue"},".eu")])],-1)),e("div",G,[(o(),n(_,null,k(a,c=>e("a",{key:c.href,href:c.href,class:"text-sm font-medium text-ink-secondary hover:text-eu-blue transition-colors"},p(c.label),9,O)),64)),t[2]||(t[2]=e("a",{href:"#playground",class:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-eu-blue text-white text-sm font-semibold hover:bg-eu-blue-dark transition-colors"},[C(" Try API "),e("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2.5"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"})])],-1))]),e("button",{class:"md:hidden p-2 -mr-2 text-ink-secondary hover:text-ink",onClick:t[0]||(t[0]=c=>s.value=!l(s)),"aria-label":l(s)?"Close menu":"Open menu"},[l(s)?(o(),n("svg",z,[...t[4]||(t[4]=[e("path",{"stroke-linecap":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])):(o(),n("svg",J,[...t[3]||(t[3]=[e("path",{"stroke-linecap":"round",d:"M4 6h16M4 12h16M4 18h16"},null,-1)])]))],8,D)]),b(U,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"opacity-0 -translate-y-2","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-2"},{default:q(()=>[l(s)?(o(),n("div",K,[e("div",Z,[(o(),n(_,null,k(a,c=>e("a",{key:c.href,href:c.href,class:"text-sm font-medium text-ink-secondary hover:text-eu-blue py-2 transition-colors",onClick:t[1]||(t[1]=g=>s.value=!1)},p(c.label),9,Q)),64))])])):y("",!0)]),_:1})],2))}}),W=Object.assign(Y,{__name:"Navbar"}),X={},ee={class:"relative pt-32 pb-20 md:pt-40 md:pb-28 overflow-hidden"};function te(x,u){return o(),n("section",ee,[...u[0]||(u[0]=[S(`<div class="absolute inset-0 dot-grid opacity-[0.03]"></div><div class="absolute top-0 right-0 w-[600px] h-[600px] bg-eu-blue/[0.04] rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"></div><div class="section-container relative"><div class="grid lg:grid-cols-2 gap-12 lg:gap-16 items-center"><div><div class="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-eu-blue-100 text-eu-blue text-xs font-semibold tracking-wide uppercase mb-6"><span class="w-1.5 h-1.5 rounded-full bg-eu-blue animate-pulse"></span> Free & Open </div><h1 class="text-display-sm md:text-display text-ink text-balance"> EU VAT Rates <span class="text-eu-blue">API</span></h1><p class="mt-4 text-subtitle text-ink-secondary font-heading"> Free. No API key. Always up-to-date. </p><p class="mt-4 text-base text-ink-muted leading-relaxed max-w-lg"> Get current VAT rates for all 27 EU member states with a single API call. No registration, no rate limits, no nonsense. </p><div class="flex flex-wrap gap-3 mt-8"><a href="#rates" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-eu-blue text-white font-semibold text-sm hover:bg-eu-blue-dark transition-all hover:shadow-glow"> View Rates <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"></path></svg></a><a href="#playground" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg border-2 border-eu-blue/20 text-eu-blue font-semibold text-sm hover:border-eu-blue/40 hover:bg-eu-blue-100 transition-all"> Try the API <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"></path></svg></a></div></div><div class="relative"><div class="absolute -inset-4 bg-eu-blue/[0.04] rounded-3xl blur-2xl"></div><div class="relative code-block p-6 shadow-card"><div class="flex items-center gap-3 mb-4 pb-4 border-b border-white/10"><div class="flex gap-1.5"><span class="w-3 h-3 rounded-full bg-[#ff5f57]"></span><span class="w-3 h-3 rounded-full bg-[#febc2e]"></span><span class="w-3 h-3 rounded-full bg-[#28c840]"></span></div><span class="text-xs text-[#8b949e] font-mono">GET /api/v1/rates/DE</span></div><pre class="text-[13px] leading-6"><span style="color:#8b949e;">// Response 200 OK</span>
|
|
<span style="color:#ff7b72;">{</span>
|
|
<span style="color:#79c0ff;">"country"</span>: <span style="color:#a5d6ff;">"Germany"</span>,
|
|
<span style="color:#79c0ff;">"country_code"</span>: <span style="color:#a5d6ff;">"DE"</span>,
|
|
<span style="color:#79c0ff;">"standard_rate"</span>: <span style="color:#79c0ff;">19</span>,
|
|
<span style="color:#79c0ff;">"reduced_rates"</span>: <span style="color:#ff7b72;">[</span><span style="color:#79c0ff;">7</span><span style="color:#ff7b72;">]</span>,
|
|
<span style="color:#79c0ff;">"currency"</span>: <span style="color:#a5d6ff;">"EUR"</span>
|
|
<span style="color:#ff7b72;">}</span></pre></div></div></div></div>`,3)])])}const se=Object.assign(R(X,[["render",te]]),{__name:"HeroSection"}),oe={id:"features",class:"section-padding bg-surface-soft"},ne={class:"section-container"},ae={class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-5"},re=["innerHTML"],le={class:"font-heading font-semibold text-ink mb-1.5"},ie={class:"text-sm text-ink-muted leading-relaxed"},de=w({__name:"FeaturesGrid",setup(x){const u=[{icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><circle cx="12" cy="12" r="10"/><path d="M12 6v2m0 8v2m-4.24-2.76 1.42-1.42m5.64-5.64 1.42-1.42M6 12h2m8 0h2m-2.76 4.24-1.42-1.42m-5.64-5.64L7.76 7.76"/></svg>',title:"All 27 EU Countries",description:"Standard, reduced, and special VAT rates for every member state."},{icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"/></svg>',title:"No Authentication",description:"No API keys, no sign-up. Just send a GET request."},{icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"/></svg>',title:"Always Current",description:"Rates sourced and synced regularly from official EU data."},{icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"/></svg>',title:"Simple JSON",description:"Clean, predictable JSON responses. Easy to integrate anywhere."}];return(i,a)=>(o(),n("section",oe,[e("div",ne,[a[0]||(a[0]=e("div",{class:"text-center mb-14 animate-on-scroll"},[e("h2",{class:"text-title md:text-display-sm text-ink"}," Built for developers "),e("p",{class:"mt-3 text-ink-muted max-w-lg mx-auto"}," A straightforward API that does one thing well — delivering EU VAT rates without friction. ")],-1)),e("div",ae,[(o(),n(_,null,k(u,(s,d)=>e("div",{key:s.title,class:"animate-on-scroll group relative bg-white rounded-2xl p-6 border border-surface-border hover:border-eu-blue/20 hover:shadow-card transition-all duration-300",style:j({transitionDelay:`${d*80}ms`})},[e("div",{class:"w-10 h-10 rounded-xl bg-eu-blue-100 text-eu-blue flex items-center justify-center mb-4 group-hover:bg-eu-blue group-hover:text-white transition-colors duration-300",innerHTML:s.icon},null,8,re),e("h3",le,p(s.title),1),e("p",ie,p(s.description),1)],4)),64))])])]))}}),ce=Object.assign(de,{__name:"FeaturesGrid"}),E=[{country:"Austria",code:"AT",flag:"🇦🇹",standard:20,reduced:[10,13]},{country:"Belgium",code:"BE",flag:"🇧🇪",standard:21,reduced:[6,12]},{country:"Bulgaria",code:"BG",flag:"🇧🇬",standard:20,reduced:[9]},{country:"Croatia",code:"HR",flag:"🇭🇷",standard:25,reduced:[5,13]},{country:"Cyprus",code:"CY",flag:"🇨🇾",standard:19,reduced:[5,9]},{country:"Czech Republic",code:"CZ",flag:"🇨🇿",standard:21,reduced:[12,15]},{country:"Denmark",code:"DK",flag:"🇩🇰",standard:25,reduced:[]},{country:"Estonia",code:"EE",flag:"🇪🇪",standard:22,reduced:[9]},{country:"Finland",code:"FI",flag:"🇫🇮",standard:25.5,reduced:[10,14]},{country:"France",code:"FR",flag:"🇫🇷",standard:20,reduced:[5.5,10]},{country:"Germany",code:"DE",flag:"🇩🇪",standard:19,reduced:[7]},{country:"Greece",code:"GR",flag:"🇬🇷",standard:24,reduced:[6,13]},{country:"Hungary",code:"HU",flag:"🇭🇺",standard:27,reduced:[5,18]},{country:"Ireland",code:"IE",flag:"🇮🇪",standard:23,reduced:[9,13.5]},{country:"Italy",code:"IT",flag:"🇮🇹",standard:22,reduced:[5,10]},{country:"Latvia",code:"LV",flag:"🇱🇻",standard:21,reduced:[5,12]},{country:"Lithuania",code:"LT",flag:"🇱🇹",standard:21,reduced:[5,9]},{country:"Luxembourg",code:"LU",flag:"🇱🇺",standard:17,reduced:[8]},{country:"Malta",code:"MT",flag:"🇲🇹",standard:18,reduced:[5,7]},{country:"Netherlands",code:"NL",flag:"🇳🇱",standard:21,reduced:[9]},{country:"Poland",code:"PL",flag:"🇵🇱",standard:23,reduced:[5,8]},{country:"Portugal",code:"PT",flag:"🇵🇹",standard:23,reduced:[6,13]},{country:"Romania",code:"RO",flag:"🇷🇴",standard:19,reduced:[5,9]},{country:"Slovakia",code:"SK",flag:"🇸🇰",standard:23,reduced:[5,10]},{country:"Slovenia",code:"SI",flag:"🇸🇮",standard:22,reduced:[5,9.5]},{country:"Spain",code:"ES",flag:"🇪🇸",standard:21,reduced:[4,10]},{country:"Sweden",code:"SE",flag:"🇸🇪",standard:25,reduced:[6,12]}];function P(){const x=I(h(E));function u(s){return E.find(d=>d.code===s.toUpperCase())}function i(s){return{country:s.country,country_code:s.code,standard_rate:s.standard,reduced_rates:s.reduced,currency:"EUR"}}function a(){return E.map(i)}return{rates:x,getRateByCode:u,formatApiResponse:i,formatAllRatesResponse:a}}const ue={id:"rates",class:"section-padding"},pe={class:"section-container"},fe={class:"max-w-sm mx-auto mb-8 animate-on-scroll"},me={class:"relative"},xe={class:"animate-on-scroll overflow-hidden rounded-2xl border border-surface-border bg-white shadow-soft"},ge={class:"overflow-x-auto"},he={class:"w-full text-sm"},be={class:"px-5 py-3"},ve={class:"inline-flex items-center gap-2.5"},ye={class:"text-lg leading-none"},_e={class:"font-medium text-ink"},ke={class:"px-5 py-3"},we={class:"inline-flex px-2 py-0.5 rounded bg-surface-muted font-mono text-xs font-medium text-ink-secondary"},$e={class:"px-5 py-3 text-right"},Ce={class:"font-semibold text-ink tabular-nums"},Ae={class:"px-5 py-3 text-right"},Ee={key:0,class:"text-ink-muted tabular-nums"},Te={key:1,class:"text-ink-faint"},Re={key:0},Se={colspan:"4",class:"px-5 py-10 text-center text-ink-muted"},Ve=w({__name:"VatRateTable",setup(x){function u(d){return[...d.toUpperCase()].map(t=>String.fromCodePoint(127462+t.charCodeAt(0)-65)).join("")}const i=h([]);A(async()=>{try{const d=await $fetch("/api/v1/rates");i.value=d.map(t=>({country:t.country,code:t.country_code,flag:u(t.country_code),standard:t.standard_rate,reduced:t.reduced_rates}))}catch{const{rates:d}=P();i.value=d.value}});const a=h(""),s=M(()=>{const d=a.value.toLowerCase().trim();return d?i.value.filter(t=>t.country.toLowerCase().includes(d)||t.code.toLowerCase().includes(d)):i.value});return(d,t)=>(o(),n("section",ue,[e("div",pe,[t[3]||(t[3]=e("div",{class:"text-center mb-10 animate-on-scroll"},[e("h2",{class:"text-title md:text-display-sm text-ink"}," VAT Rates across the EU "),e("p",{class:"mt-3 text-ink-muted max-w-lg mx-auto"}," Current standard and reduced rates for all 27 member states. ")],-1)),e("div",fe,[e("div",me,[t[1]||(t[1]=e("svg",{class:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-ink-faint",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})],-1)),V(e("input",{"onUpdate:modelValue":t[0]||(t[0]=c=>L(a)?a.value=c:null),type:"text",placeholder:"Search countries...",class:"w-full pl-10 pr-4 py-2.5 rounded-xl border border-surface-border bg-white text-sm text-ink placeholder:text-ink-faint focus:outline-none focus:ring-2 focus:ring-eu-blue/20 focus:border-eu-blue/40 transition-all"},null,512),[[B,l(a)]])])]),e("div",xe,[e("div",ge,[e("table",he,[t[2]||(t[2]=e("thead",null,[e("tr",{class:"bg-surface-soft border-b border-surface-border"},[e("th",{class:"text-left font-semibold text-ink-secondary px-5 py-3.5 font-heading"},"Country"),e("th",{class:"text-left font-semibold text-ink-secondary px-5 py-3.5 font-heading w-20"},"Code"),e("th",{class:"text-right font-semibold text-ink-secondary px-5 py-3.5 font-heading w-32"},"Standard"),e("th",{class:"text-right font-semibold text-ink-secondary px-5 py-3.5 font-heading w-40"},"Reduced")])],-1)),e("tbody",null,[(o(!0),n(_,null,k(l(s),c=>(o(),n("tr",{key:c.code,class:"border-b border-surface-border/60 last:border-0 hover:bg-eu-blue-100/40 transition-colors"},[e("td",be,[e("span",ve,[e("span",ye,p(c.flag),1),e("span",_e,p(c.country),1)])]),e("td",ke,[e("span",we,p(c.code),1)]),e("td",$e,[e("span",Ce,p(c.standard)+"%",1)]),e("td",Ae,[c.reduced.length?(o(),n("span",Ee,p(c.reduced.map(g=>`${g}%`).join(", ")),1)):(o(),n("span",Te,"—"))])]))),128)),l(s).length?y("",!0):(o(),n("tr",Re,[e("td",Se,' No countries matching "'+p(l(a))+'" ',1)]))])])])]),t[4]||(t[4]=e("p",{class:"text-center text-xs text-ink-faint mt-4"}," Data updated regularly from official EU sources. ",-1))])]))}}),Le=Object.assign(Ve,{__name:"VatRateTable"}),Me={id:"playground",class:"section-padding bg-surface-soft"},Pe={class:"section-container"},Ue={class:"animate-on-scroll max-w-3xl mx-auto"},qe={class:"bg-white rounded-2xl border border-surface-border shadow-card overflow-hidden"},je={class:"p-5 border-b border-surface-border"},Ie={class:"flex flex-wrap gap-3 items-end"},Be={class:"flex-shrink-0"},Ne={class:"flex rounded-lg border border-surface-border overflow-hidden text-sm"},Fe={key:0,class:"flex-shrink-0"},He=["value"],Ge=["disabled"],Oe={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},De={class:"mt-3.5 flex items-center gap-2 px-3.5 py-2.5 rounded-lg bg-surface-muted font-mono text-sm overflow-x-auto"},Je={class:"text-ink-secondary"},ze={class:"relative"},Ke={class:"flex items-center justify-between px-5 py-3 bg-[#0d1117] border-b border-white/5"},Ze={key:0,class:"text-xs font-mono px-2 py-0.5 rounded bg-green-500/20 text-green-400"},Qe={key:1,class:"text-xs font-mono px-2 py-0.5 rounded bg-red-500/20 text-red-400"},Ye={class:"bg-[#0d1117] text-[#e6edf3] font-mono text-sm leading-relaxed p-5 max-h-80 overflow-y-auto"},We=["innerHTML"],Xe={key:1,class:"text-[#8b949e] text-sm"},et={key:2,class:"text-[#8b949e] text-sm"},tt=w({__name:"ApiPlayground",setup(x){const{rates:u}=P(),i=h("DE"),a=h(""),s=h(null),d=h(!1),t=h(!1),c=M(()=>t.value?"https://vat-api.eu/api/v1/rates":`https://vat-api.eu/api/v1/rates/${i.value}`);function g(f){return f.replace(/("(?:\\.|[^"\\])*")\s*:/g,'<span style="color:#79c0ff">$1</span>:').replace(/:\s*("(?:\\.|[^"\\])*")/g,': <span style="color:#a5d6ff">$1</span>').replace(/:\s*(\d+\.?\d*)/g,': <span style="color:#79c0ff">$1</span>').replace(/(\[|\])/g,'<span style="color:#ff7b72">$1</span>').replace(/^(\{|})/gm,'<span style="color:#ff7b72">$1</span>')}async function v(){d.value=!0,a.value="",s.value=null;try{const f=t.value?"/api/v1/rates":`/api/v1/rates/${i.value}`,r=await $fetch(f);s.value=200,a.value=g(JSON.stringify(r,null,2))}catch(f){s.value=f?.statusCode??500;const r=f?.data??{error:f?.statusMessage??"Request failed"};a.value=g(JSON.stringify(r,null,2))}finally{d.value=!1}}return A(()=>v()),(f,r)=>(o(),n("section",Me,[e("div",Pe,[r[8]||(r[8]=e("div",{class:"text-center mb-10 animate-on-scroll"},[e("h2",{class:"text-title md:text-display-sm text-ink"}," Try it out "),e("p",{class:"mt-3 text-ink-muted max-w-lg mx-auto"}," Build your request, send it, and see the response. ")],-1)),e("div",Ue,[e("div",qe,[e("div",je,[e("div",Ie,[e("div",Be,[r[3]||(r[3]=e("label",{class:"block text-xs font-medium text-ink-muted mb-1.5"},"Endpoint",-1)),e("div",Ne,[e("button",{class:$(["px-3 py-2 font-medium transition-colors",l(t)?"bg-white text-ink-secondary hover:bg-surface-soft":"bg-eu-blue text-white"]),onClick:r[0]||(r[0]=m=>t.value=!1)}," Single ",2),e("button",{class:$(["px-3 py-2 font-medium transition-colors",l(t)?"bg-eu-blue text-white":"bg-white text-ink-secondary hover:bg-surface-soft"]),onClick:r[1]||(r[1]=m=>t.value=!0)}," All Rates ",2)])]),l(t)?y("",!0):(o(),n("div",Fe,[r[4]||(r[4]=e("label",{class:"block text-xs font-medium text-ink-muted mb-1.5"},"Country",-1)),V(e("select",{"onUpdate:modelValue":r[2]||(r[2]=m=>L(i)?i.value=m:null),class:"px-3 py-2 rounded-lg border border-surface-border bg-white text-sm text-ink focus:outline-none focus:ring-2 focus:ring-eu-blue/20 focus:border-eu-blue/40 transition-all"},[(o(!0),n(_,null,k(l(u),m=>(o(),n("option",{key:m.code,value:m.code},p(m.flag)+" "+p(m.country)+" ("+p(m.code)+") ",9,He))),128))],512),[[N,l(i)]])])),e("button",{class:"px-5 py-2 rounded-lg bg-eu-gold text-eu-blue-dark font-semibold text-sm hover:bg-eu-gold-dark transition-colors flex items-center gap-2",onClick:v,disabled:l(d)},[l(d)?(o(),n("svg",Oe,[...r[5]||(r[5]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):y("",!0),e("span",null,p(l(d)?"Sending...":"Send Request"),1)],8,Ge)]),e("div",De,[r[6]||(r[6]=e("span",{class:"flex-shrink-0 text-xs font-semibold px-1.5 py-0.5 rounded bg-green-100 text-green-700"},"GET",-1)),e("span",Je,p(l(c)),1)])]),e("div",ze,[e("div",Ke,[r[7]||(r[7]=e("span",{class:"text-xs text-[#8b949e] font-mono"},"Response",-1)),l(s)===200?(o(),n("span",Ze,"200 OK")):l(s)?(o(),n("span",Qe,p(l(s))+" Error",1)):y("",!0)]),e("div",Ye,[l(a)?(o(),n("pre",{key:0,class:"text-[13px] leading-6",innerHTML:l(a)},null,8,We)):l(d)?(o(),n("p",Xe,"Loading...")):(o(),n("p",et,'Click "Send Request" to see a response.'))])])])])])]))}}),st=Object.assign(tt,{__name:"ApiPlayground"}),ot={id:"examples",class:"section-padding"},nt={class:"section-container"},at={class:"animate-on-scroll max-w-2xl mx-auto"},rt={class:"rounded-2xl border border-surface-border overflow-hidden shadow-card bg-white"},lt={class:"flex items-center justify-between border-b border-surface-border bg-surface-soft px-1.5"},it={class:"flex"},dt=["onClick"],ct={key:0,class:"absolute bottom-0 left-2 right-2 h-0.5 bg-eu-blue rounded-full"},ut={key:0,class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},pt={key:1,class:"w-3.5 h-3.5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2.5"},ft={class:"code-block p-5"},mt=["innerHTML"],xt=w({__name:"CodeExamples",setup(x){const u=["cURL","JavaScript","Python"],i=h("cURL"),a={cURL:`# Get all EU VAT rates
|
|
curl https://vat-api.eu/api/v1/rates
|
|
|
|
# Get rates for a specific country
|
|
curl https://vat-api.eu/api/v1/rates/DE`,JavaScript:`const response = await fetch('https://vat-api.eu/api/v1/rates/DE');
|
|
const data = await response.json();
|
|
console.log(data.standard_rate); // 19`,Python:`import requests
|
|
|
|
response = requests.get('https://vat-api.eu/api/v1/rates/DE')
|
|
data = response.json()
|
|
print(data['standard_rate']) # 19`},s={cURL:d(a.cURL),JavaScript:t(a.JavaScript),Python:c(a.Python)};function d(f){return f.replace(/(#.*)/g,'<span style="color:#8b949e">$1</span>').replace(/(curl)\s/g,'<span style="color:#ff7b72">$1</span> ').replace(/(https?:\/\/[^\s]+)/g,'<span style="color:#a5d6ff">$1</span>')}function t(f){return f.replace(/(\/\/\s*\d+)/g,'<span style="color:#8b949e">$1</span>').replace(/(const|await)\s/g,'<span style="color:#ff7b72">$1</span> ').replace(/(fetch|json|log)\(/g,'<span style="color:#d2a8ff">$1</span>(').replace(/('https?:\/\/[^']*')/g,'<span style="color:#a5d6ff">$1</span>').replace(/(\.standard_rate)/g,'<span style="color:#79c0ff">$1</span>').replace(/(console)\./g,'<span style="color:#79c0ff">$1</span>.').replace(/(response)\./g,'<span style="color:#79c0ff">$1</span>.')}function c(f){return f.replace(/(#\s*\d+)/g,'<span style="color:#8b949e">$1</span>').replace(/(import|from)\s/g,'<span style="color:#ff7b72">$1</span> ').replace(/(requests)/g,'<span style="color:#79c0ff">$1</span>').replace(/('https?:\/\/[^']*')/g,'<span style="color:#a5d6ff">$1</span>').replace(/(\['standard_rate'\])/g,'<span style="color:#79c0ff">$1</span>').replace(/(print|get)\(/g,'<span style="color:#d2a8ff">$1</span>(').replace(/(response)\./g,'<span style="color:#79c0ff">$1</span>.')}const g=h(!1);async function v(){await navigator.clipboard.writeText(a[i.value]),g.value=!0,setTimeout(()=>{g.value=!1},2e3)}return(f,r)=>(o(),n("section",ot,[e("div",nt,[r[2]||(r[2]=e("div",{class:"text-center mb-10 animate-on-scroll"},[e("h2",{class:"text-title md:text-display-sm text-ink"}," Quick start "),e("p",{class:"mt-3 text-ink-muted max-w-lg mx-auto"}," Integrate EU VAT rates into your project in seconds. ")],-1)),e("div",at,[e("div",rt,[e("div",lt,[e("div",it,[(o(),n(_,null,k(u,m=>e("button",{key:m,class:$(["px-4 py-3 text-sm font-medium transition-colors relative",l(i)===m?"text-eu-blue":"text-ink-muted hover:text-ink-secondary"]),onClick:wt=>i.value=m},[C(p(m)+" ",1),l(i)===m?(o(),n("span",ct)):y("",!0)],10,dt)),64))]),e("button",{class:"flex items-center gap-1.5 px-3 py-1.5 mr-1.5 rounded-lg text-xs font-medium text-ink-muted hover:text-ink-secondary hover:bg-surface-muted transition-colors",onClick:v},[l(g)?(o(),n("svg",pt,[...r[1]||(r[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)])])):(o(),n("svg",ut,[...r[0]||(r[0]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"},null,-1)])])),C(" "+p(l(g)?"Copied!":"Copy"),1)])]),e("div",ft,[e("pre",{class:"text-[13px] leading-6",innerHTML:s[l(i)]},null,8,mt)])])])])]))}}),gt=Object.assign(xt,{__name:"CodeExamples"}),ht={},bt={class:"border-t border-surface-border bg-white"};function vt(x,u){return o(),n("footer",bt,[...u[0]||(u[0]=[S('<div class="section-container py-10"><div class="flex flex-col md:flex-row items-center justify-between gap-6 text-sm text-ink-muted"><div class="flex items-center gap-2"><span class="inline-flex items-center justify-center w-6 h-6 rounded-md bg-eu-blue text-white font-heading font-bold text-[10px]">V</span><span class="font-heading font-semibold text-ink"> vat-api<span class="text-eu-blue">.eu</span></span><span class="hidden sm:inline text-ink-faint">— Free EU VAT Rate API</span></div><p class="text-ink-faint text-xs"> Free EU VAT rate data </p><div class="flex items-center gap-5"><a href="#" class="hover:text-eu-blue transition-colors">Imprint</a><a href="#" class="hover:text-eu-blue transition-colors">Privacy</a><a href="#" class="hover:text-eu-blue transition-colors flex items-center gap-1.5"><svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path></svg> GitHub </a></div></div></div>',1)])])}const yt=Object.assign(R(ht,[["render",vt]]),{__name:"FooterSection"});function _t(){A(()=>{const x=new IntersectionObserver(i=>{for(const a of i)a.isIntersecting&&(a.target.classList.add("is-visible"),x.unobserve(a.target))},{threshold:.1,rootMargin:"0px 0px -40px 0px"}),u=document.querySelectorAll(".animate-on-scroll");for(const i of u)x.observe(i);T(()=>x.disconnect())})}const kt={class:"min-h-screen"},At=w({__name:"index",setup(x){return F({title:"vat-api.eu — Free EU VAT Rates API",meta:[{name:"description",content:"Get current VAT rates for all 27 EU member states with a free, open REST API. No API key required."},{property:"og:title",content:"vat-api.eu — Free EU VAT Rates API"},{property:"og:description",content:"Get current VAT rates for all 27 EU member states with a free, open REST API. No API key required."},{property:"og:type",content:"website"},{property:"og:url",content:"https://vat-api.eu"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:"vat-api.eu — Free EU VAT Rates API"},{name:"twitter:description",content:"Get current VAT rates for all 27 EU member states with a free, open REST API. No API key required."}]}),_t(),(u,i)=>{const a=W,s=se,d=ce,t=Le,c=st,g=gt,v=yt;return o(),n("div",kt,[b(a),e("main",null,[b(s),b(d),b(t),b(c),b(g)]),b(v)])}}});export{At as default};
|