PageSourceSearch

https://www.teachany.com/_nuxt/coloring-page-generator-CwBoq6Pl-29.js

js teachany.com collected 2026-09-24 09:54:12 UTC 29,765 bytes, 1 lines download raw bytes

1import{f as z,c as j,i,a as Ee,e as Ce,s as Pe,b as Ae,_ as Te,d as Le}from"#entry";import{a as Re,_ as je,c as Oe}from"./useWorkspaceInsert-DY_2ip2F-29.js";import{_ as $e}from"./ReportContent-VdHEl8HJ-29.js";import qe from"./Testimonials-kJisZ5MW-29.js";import Fe from"./Feature-DHNL6Ihq-29.js";import Se from"./HowToWork-DVsS-Zlt-29.js";import Ve from"./FAQ-BxG5g6Hl-29.js";import Be from"./Benefits-BTRTaa0g-29.js";import{U as b,H as v,O as _,a8 as C,$ as a,a2 as O,B as u,a0 as c,a1 as x,ag as $,a9 as Me,aa as Ue,F as B,ab as Z,a3 as q,V as ee,j as ze,i as M,r as U}from"./lazy-qrcode-oXPcgXJC-29.js";import{_ as Ne}from"./dynamic-import-helper-BheWnx7M-29.js";import{ElMessage as I}from"./index-Co5YYw_r-29.js";import{u as Ge}from"./useElementPlusCSS-Cot3nxUh-29.js";import{u as We}from"./useColoringI18n-CSeegN-8-29.js";import"./lazy-pdf-GO-7vVHk-29.js";import{p as Ye}from"./uploadR2-lq36g_u3-29.js";import{_ as He}from"./_plugin-vue_export-helper-DlAUqK2U-29.js";import{r as Je}from"./ArrowPathIcon-CkyHREyi-29.js";import{r as Qe}from"./DocumentDuplicateIcon-DdDKQlq1-29.js";import{r as Ke}from"./MicrophoneIcon-CFKRClWn-29.js";import{r as Xe}from"./SparklesIcon-C8fouFii-29.js";import{r as Ze}from"./ArrowDownTrayIcon-DDooZsub-29.js";import"./useWorkspaceHost-DU2TCSNo-29.js";import"./FeatureIcon-CGq9ZIrf-29.js";import"./nuxt-link-D_rgCK5z-29.js";import"./index-BvZBNbWF-29.js";import"./util-lodash-BhAehChR-29.js";import"./lazy-mindmap-B_8DMe8e-29.js";const et={__name:"ColoringPageLandingPage",setup(te){const{t}=z(),f=[{label:t("coloring_page.features.fastCreation.label")||"Instant Coloring Pages",title:t("coloring_page.features.fastCreation.title")||"AI-Generated Outlines",description:t("coloring_page.features.fastCreation.description")||"Describe any scene or character and our AI instantly creates a printable coloring page. Perfect for quick activities or themed lessons.",linkText:t("coloring_page.features.fastCreation.linkText")||"Try Coloring Page Generator",link:"/tools/coloring-page-generator",iconBgClass:"bg-pink-100",iconClass:"text-pink-600",iconType:"palette",imageSrc:"https://project.deletetweets.ai/teachany_images/tools/coloringpage1.webp",imageAlt:t("coloring_page.features.fastCreation.imageAlt")||"AI generates a unique coloring page outline.",gradientClass:"from-pink-500 to-yellow-500"},{label:t("coloring_page.features.customizableDesigns.label")||"Customizable Designs",title:t("coloring_page.features.customizableDesigns.title")||"Personalize Your Pages",description:t("coloring_page.features.customizableDesigns.description")||"Change themes, add text, or select difficulty level. Create coloring pages that match your child’s interests or classroom topics.",linkText:t("coloring_page.features.customizableDesigns.linkText")||"Customize Coloring Pages",link:"/tools/coloring-page-generator",iconBgClass:"bg-yellow-100",iconClass:"text-yellow-600",iconType:"edit",imageSrc:"https://project.deletetweets.ai/teachany_images/tools/coloringpage2.webp",imageAlt:t("coloring_page.features.customizableDesigns.imageAlt")||"Customize your own coloring page with AI.",gradientClass:"from-yellow-500 to-orange-500"}],m=[{title:t("coloring_page.steps.enterPrompt.title")||"Enter Your Idea",description:t("coloring_page.steps.enterPrompt.description")||"Type a description (like “unicorn in a magical forest” or “space rocket adventure”).",iconType:"share",iconBgClass:"bg-pink-100",iconClass:"text-pink-600"},{title:t("coloring_page.steps.generatePage.title")||"Let AI Draw the Page",description:t("coloring_page.steps.generatePage.description")||"Our AI instantly creates a unique black-and-white coloring outline based on your idea.",iconType:"sparkle",iconBgClass:"bg-yellow-100",iconClass:"text-yellow-600"},{title:t("coloring_page.steps.downloadPrint.title")||"Download & Print",description:t("coloring_page.steps.downloadPrint.description")||"Save your coloring page as PDF or image. Print for art time or share with friends!",iconType:"download",iconBgClass:"bg-green-100",iconClass:"text-green-600"}],k=[{title:t("coloring_page.benefitsData.creativityBoost.title")||"Boosts Creativity",description:t("coloring_page.benefitsData.creativityBoost.description")||"Kids can color what they imagine, and you can make pages for any theme or holiday.",points:[t("coloring_page.benefitsData.creativityBoost.points.0")||"Endless design possibilities",t("coloring_page.benefitsData.creativityBoost.points.1")||"Great for art projects and parties",t("coloring_page.benefitsData.creativityBoost.points.2")||"Encourages kids to express themselves"],iconName:"bell",iconBgClass:"bg-pink-50",iconColor:"text-pink-600"},{title:t("coloring_page.benefitsData.timeSaving.title")||"Saves Time",description:t("coloring_page.benefitsData.timeSaving.description")||"No more searching for the perfect coloring page. Get exactly what you want in seconds.",points:[t("coloring_page.benefitsData.timeSaving.points.0")||"Instant download and print",t("coloring_page.benefitsData.timeSaving.points.1")||"Ready for classroom or home use",t("coloring_page.benefitsData.timeSaving.points.2")||"No signup required for basic use"],iconName:"lightning",iconBgClass:"bg-yellow-50",iconColor:"text-yellow-600"},{title:t("coloring_page.benefitsData.accessibleFun.title")||"Accessible & Fun",description:t("coloring_page.benefitsData.accessibleFun.description")||"Anyone can use it—no design skills needed. Safe for kids and families.",points:[t("coloring_page.benefitsData.accessibleFun.points.0")||"Kid-friendly interface",t("coloring_page.benefitsData.accessibleFun.points.1")||"No personal data required",t("coloring_page.benefitsData.accessibleFun.points.2")||"Works on any device"],iconName:"lock",iconBgClass:"bg-green-50",iconColor:"text-green-600"}],y=[{name:t("coloring_page.testimonialsData.sarah.name")||"Sarah Lee",designation:t("coloring_page.testimonialsData.sarah.designation")||"Parent",quote:t("coloring_page.testimonialsData.sarah.quote")||"My kids love seeing their crazy ideas turned into real coloring pages. It’s become our favorite rainy day activity!",image:"https://video.deletetweets.ai/Transmonkey/Transmonkey_image_translator/user3.webp"},{name:t("coloring_page.testimonialsData.mrsmith.name")||"Mr. Smith",de
1signation:t("coloring_page.testimonialsData.mrsmith.designation")||"Elementary Teacher",quote:t("coloring_page.testimonialsData.mrsmith.quote")||"I use the AI coloring page generator for themed lessons. It keeps my students engaged and excited to participate.",image:"https://video.deletetweets.ai/Transmonkey/Transmonkey_doc_translator/user7.webp"},{name:t("coloring_page.testimonialsData.lily.name")||"Lily Chen",designation:t("coloring_page.testimonialsData.lily.designation")||"Art Club Leader",quote:t("coloring_page.testimonialsData.lily.quote")||"It’s so easy to make personalized coloring sheets for every club meeting. The kids love it!",image:"https://video.deletetweets.ai/Transmonkey/Transmonkey_doc_translator/user2.webp"}],F=[{question:t("coloring_page.faqsData.howToUse.question")||"How do I use the AI coloring page generator?",answer:t("coloring_page.faqsData.howToUse.answer")||"Just type what you want to see, and the AI will create a printable coloring page for you.",isOpen:!0},{question:t("coloring_page.faqsData.isItFree.question")||"Is the coloring page generator free?",answer:t("coloring_page.faqsData.isItFree.answer")||"Yes! You can create and download basic coloring pages for free. Advanced features are available with an upgrade.",isOpen:!1},{question:t("coloring_page.faqsData.canIEdit.question")||"Can I edit or personalize the coloring pages?",answer:t("coloring_page.faqsData.canIEdit.answer")||"Absolutely! You can adjust the prompt, change themes, or add names and messages.",isOpen:!1},{question:t("coloring_page.faqsData.whatDevices.question")||"What devices does it work on?",answer:t("coloring_page.faqsData.whatDevices.answer")||"You can use the AI coloring page generator on any computer, tablet, or phone with internet access.",isOpen:!1},{question:t("coloring_page.faqsData.isSafe.question")||"Is it safe for children?",answer:t("coloring_page.faqsData.isSafe.answer")||"Yes, there are no ads or unsafe content. We never collect any personal information.",isOpen:!1}];return(d,h)=>{const P=qe;return b(),v("div",null,[_(Fe,{title:d.$t("coloring_page.feature.title")||"Create Fun Coloring Pages Instantly with AI!",description:d.$t("coloring_page.feature.description")||"Easily generate and customize unique coloring pages for kids of all ages. Perfect for parents, teachers, and anyone who wants creative, printable coloring sheets in seconds.",features:f},null,8,["title","description"]),_(Se,{title:d.$t("coloring_page.howtowork.title")||"How to Make AI Coloring Pages Online",description:d.$t("coloring_page.howtowork.description")||"Turn ideas into beautiful coloring sheets. Use our AI-powered generator to create, edit, and download personalized coloring pages anytime.",ctaText:d.$t("coloring_page.howtowork.ctaText")||"Start Creating Coloring Pages Now",steps:m},null,8,["title","description","ctaText"]),_(Be,{title:d.$t("coloring_page.benefits.title")||"Why Choose Our AI Coloring Page Generator?",subtitle:d.$t("coloring_page.benefits.subtitle")||"Creativity and fun made simple for everyone",benefitsData:k},null,8,["title","subtitle"]),_(P,{title:d.$t("coloring_page.testimonials.title")||"Loved by Parents and Teachers",description:d.$t("coloring_page.testimonials.description")||"See how our AI coloring page generator brings smiles and creativity to families, classrooms, and art time everywhere.",testimonials:y},null,8,["title","description"]),_(Ve,{title:d.$t("coloring_page.faq.title")||"AI Coloring Page Generator FAQs",subtitle:d.$t("coloring_page.faq.subtitle")||"Common questions about making coloring pages online",customFaqs:F},null,8,["title","subtitle"])])}}},tt={class:"px-4 py-8 md:py-12"},ot={class:"text-center mb-6"},rt={class:"text-4xl font-bold text-gray-900 dark:text-gray-100 mb-4 bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"},at={class:"text-lg text-gray-600 dark:text-gray-400 max-w-xl mx-auto"},st={class:"flex space-x-4 mb-4"},nt={class:"bg-gray-50 dark:bg-gray-700/50 p-3 rounded-xl"},it={for:"prompt",class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3"},lt={class:"text-red-500"},ct={class:"relative rounded-lg"},gt=["placeholder"],pt={class:"absolute top-4 left-4 text-gray-400 dark:text-gray-500"},ut={class:"grid grid-cols-1 md:grid-cols-2 gap-8"},dt={class:"bg-gray-50 dark:bg-gray-700/50 p-6 rounded-xl"},mt={class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3"},_t={for:"file-upload",class:"cursor-pointer space-y-2 text-center w-full"},ft={key:0,class:"flex flex-col items-center"},bt={class:"flex text-sm text-gray-600 dark:text-gray-400"}
1,yt={class:"font-medium text-blue-600 dark:text-blue-400"},ht={class:"pl-1"},vt={class:"text-xs text-gray-500 dark:text-gray-400 mt-1"},wt={key:1,class:"relative group"},kt={class:"bg-gray-50 dark:bg-gray-700/50 p-6 rounded-xl"},xt={for:"aspect-ratio",class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3"},It={class:"text-red-500"},Dt={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-2 lg:grid-cols-3 gap-3"},Et=["onClick","aria-pressed"],Ct={class:"bg-gray-50 dark:bg-gray-700/50 p-6 rounded-xl md:col-span-2"},Pt={for:"output-format",class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3"},At={class:"text-red-500"},Tt={class:"grid grid-cols-3 gap-3"},Lt=["onClick","aria-pressed"],Rt={class:"pt-6"},jt=["disabled"],Ot={key:0,class:"flex items-center"},$t={key:1,class:"flex items-center"},qt={key:0,class:"mt-3 text-center text-sm text-gray-500 dark:text-gray-400","aria-live":"polite"},Ft={key:0,class:"mt-12 p-8 border border-blue-100 dark:border-blue-900 rounded-xl bg-blue-50 dark:bg-blue-900/30 shadow-inner"},St={class:"flex justify-between items-center mb-6"},Vt={id:"generated-line-art",class:"text-2xl font-semibold text-gray-800 dark:text-gray-200"},Bt={class:"flex space-x-4"},Mt={class:"prose prose-sm dark:prose-invert max-w-none bg-white dark:bg-gray-800 p-8 rounded-xl border border-gray-100 dark:border-gray-700 shadow-lg"},Ut="openai",zt="gpt-image-2",Nt=2200,Gt=1e4,Wt=50,Yt={__name:"coloring-page-generator",async setup(te){let t,f;Ge();const{t:m,locale:k}=z(),y=z(),F=(e,o)=>{const r=m(e);return r===e?o:r};[t,f]=C(()=>We()),await t,f();try{const{data:e}=([t,f]=C(async()=>j(`i18n_coloring_form_${k.value}`,async()=>(await Ne(Object.assign({
1"../../locales/coloringpage_form/ar.js":()=>i(()=>import("./ar-Y_WfOC6X-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/cs.js":()=>i(()=>import("./cs-M0-0rnrp-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/da.js":()=>i(()=>import("./da-gmK3Eqlc-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/de.js":()=>i(()=>import("./de-BkYrNlUK-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/el.js":()=>i(()=>import("./el-BlEwsTTn-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/en.js":()=>i(()=>import("./en-haTSjbVG-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/es.js":()=>i(()=>import("./es-Dam47fz7-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/fi.js":()=>i(()=>import("./fi-BDfYfTDw-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/fil.js":()=>i(()=>import("./fil-0ulyezIC-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/fr.js":()=>i(()=>import("./fr-VAqaIQQb-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/he.js":()=>i(()=>import("./he-D_ON157Y-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/hi.js":()=>i(()=>import("./hi-CV_Iek_X-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/it.js":()=>i(()=>import("./it-GKO3taBH-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/jp.js":()=>i(()=>import("./jp-Bmm9P5A0-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/ko.js":()=>i(()=>import("./ko-DLLjVbY8-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/ms.js":()=>i(()=>import("./ms-52uvIRhW-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/nl.js":()=>i(()=>import("./nl-CHTmWkCZ-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/no.js":()=>i(()=>import("./no-2fPsdVC9-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/pl.js":()=>i(()=>import("./pl-CZjydb2U-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/pt.js":()=>i(()=>import("./pt-BbGteMgm-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/ro.js":()=>i(()=>import("./ro-7AukVHy5-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/ru.js":()=>i(()=>import("./ru-B5rIGU_L-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/sv.js":()=>i(()=>import("./sv-DhzlqbiQ-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/th.js":()=>i(()=>import("./th-CJywAZvh-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/tr.js":()=>i(()=>import("./tr-Ce_wORiI-29.js"),[],import.meta.url),
1"../../locales/coloringpage_form/zh.js":()=>i(()=>import("./zh-By-8u2Ef-29.js"),[],import.meta.url)
1}),`../../locales/coloringpage_form/${k.value}.js`,5)).default)),t=await t,f(),t);e.value&&y.mergeLocaleMessage(y.locale.value,e.value)}catch{try{const{data:e}=([t,f]=C(async()=>j("i18n_coloring_form_en",async()=>(await i(()=>import("./en-haTSjbVG-29.js"),[],import.meta.url)).default)),t=await t,f(),t);e.value&&y.mergeLocaleMessage(y.locale.value,e.value)}catch{}}try{const{data:e}=([t,f]=C(async()=>j(`i18n_coloringpage_${k.value}`,async()=>await $fetch(`https://project.deletetweets.ai/teachany_language/tools_generate_version1_new/${k.value}.json`))),t=await t,f(),t);y.mergeLocaleMessage(y.locale.value,e.value)}catch{}try{const{data:e}=([t,f]=C(()=>j(`i18n_content_coloringpage_${k.value}`,()=>$fetch(`https://project.deletetweets.ai/teachany_language/tools_content_version1/${k.value}.json`))),t=await t,f(),t);y.mergeLocaleMessage(y.locale.value,e.value)}catch{}const{replicateFetch:d}=Le(),h=Ee(),P=Ce(),{user:S,canUseNumber:oe}=Pe(P),re=M("loginModal"),ae=M("payModal"),se=e=>new Promise(o=>setTimeout(o,e)),D=e=>{if(!e)return{};if(typeof e=="string"){const o=e.trim();try{return D(JSON.parse(o))}catch{return o}}if(e&&typeof e=="object"){const o={...e};for(const r of["data","result","payload","response","prediction"]){const n=o[r];if(typeof n=="string")try{o[r]=D(JSON.parse(n))}catch{o[r]=n}}return o}return e},A=e=>!(typeof e!="string"||!e||e.length<6||/\s/.test(e)||/^https?:\/\//.test(e)),N=e=>{if(typeof e!="string"||!/^https?:\/\//.test(e))return"";try{const o=new URL(e),r=o.pathname.split("/").filter(Boolean),n=r.findIndex(g=>g==="predictions");return n>=0&&r[n+1]?r[n+1]:o.searchParams.get("id")||o.searchParams.get("prediction_id")||""}catch{return""}},G=e=>e?e?.data&&typeof e.data=="object"?e.data:e?.result&&typeof e.result=="object"?e.result:e?.payload&&typeof e.payload=="object"?e.payload:e?.prediction&&typeof e.prediction=="object"?e.prediction:e:{},ne=e=>{const o=[D(e)];for(;o.length;){const r=o.shift();if(!r)continue;if(typeof r=="string"){const g=N(r);if(A(g))return g;if(A(r))return r;const l=D(r);l&&l!==r&&o.push(l);continue}if(Array.isArray(r)){o.push(...r);continue}if(typeof r!="object")continue;const n=r.id||r.jobId||r.taskId||r.predictionId||r.prediction_id||r?.prediction?.id;if(A(n))return n;for(const g of[r.url,r.urls?.get,r.urls?.cancel,r.prediction_url,r.predictionUrl]){const l=N(g);if(A(l))return l}o.push(r.data,r.result,r.payload,r.response,r.prediction,r.urls)}return""},W=e=>{if(typeof e=="string")return e;if(Array.isArray(e)){const o=e[0];return typeof o=="string"?o:o&&typeof o=="object"&&o.url?String(o.url):""}return e&&typeof e=="object"&&e.url?String(e.url):""},T=e=>e?.msg||e?.message||e?.error||e?.data?.msg||e?.data?.message||e?.data?.error||e?.result?.msg||e?.result?.message||e?.result?.error||"",ie=async e=>{let o=Nt;for(let r=0;r<Wt;r++){await se(o);const n=D(await d.getReplicateTask(e)),g=G(n),l=String(g?.status||"").toLowerCase();if(l==="succeeded"||l==="successful"){const p=W(g?.output);if(!p)throw new Error("replicate-output-empty");return p}if(l==="failed"||l==="canceled"||l==="cancelled")throw new Error(T(g)||`replicate-${l||"failed"}`);o=Math.min(Math.floor(o*1.2),Gt)}throw new Error("replicate-timeout")},V=M("isWorkspace"),s=ze({prompt:"",referenceImage:null,referenceImageUrl:null,aspectRatio:"1:1",outputFormat:"png"}),Y=[{value:"auto",label:"Auto"},{value:"1:1",label:"1:1"},{value:"3:4",label:"3:4"},{value:"9:16",label:"9:16"},{value:"4:3",label:"4:3"},{value:"16:9",label:"16:9"}],H=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WEBP"}],J=["image/png","image/jpeg","image/webp"],le=Y.map(({value:e})=>e),ce=H.map(({value:e})=>e),ge=e=>{const o=String(e||"").trim().toLowerCase();return o==="jpg"?"jpeg":ce.includes(o)?o:""},E=U(!1),w=U(null),L=U(!1),{isInserting:pe,insertStatusType:ue,insertStatusMessage:de,insertButtonLabel:me,canInsert:_e,insertWorkspaceResult:fe,resetWorkspaceInsertStatus:Q}=Re({hasContent:()=>!!w.value,buildPayload:()=>Oe({toolSlug:"coloring-page-generator",title:"Generated Line Art",imageUrl:w.value,meta:{prompt:s.prompt,aspectRatio:s.aspectRatio}})}),be=e=>{L.value=!0},ye=e=>{L.value=!1},he=async e=>{L.value=!1;const o=e.dataTransfer.files[0];if(o&&J.includes(o.type)){await K({target:{files:[o]}});return}o&&I.error(m("coloring_form.errors.invalid_file_type"))},K=async e=>{const o=e.target.files[0];
1if(o)try{if(o.size>10*1024*1024){I.error(m("coloring_form.errors.file_too_large"));return}if(!J.includes(o.type)){I.error(m("coloring_form.errors.invalid_file_type"));return}s.referenceImage=o;const{url:r,key:n}=await Ye(o,o.name,"teachany_flashcard_pdf");s.referenceImageUrl=r}catch{I.error(m("coloring_form.errors.upload_failed"))}},ve=()=>{s.referenceImage=null,s.referenceImageUrl=null},we=()=>{s.prompt="",s.referenceImage=null,s.referenceImageUrl=null,s.aspectRatio="1:1",s.outputFormat="png",w.value=null,Q()},ke=()=>{s.prompt=m("coloring_form.demo.prompt")||"A cute cartoon cat playing with a ball of yarn, simple line art style",s.aspectRatio="1:1",s.outputFormat="png"},xe=async()=>{if(w.value)try{const o=await(await fetch(w.value,{cache:"no-store"})).blob(),r=window.URL.createObjectURL(o),n=document.createElement("a"),g=o.type||"",l=g.includes("webp")?"webp":g.includes("jpeg")||g.includes("jpg")?"jpeg":g.includes("png")?"png":s.outputFormat;n.href=r,n.download=`line-art.${l}`,document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(r)}catch{I.error(m("coloring_form.errors.download_failed"))}};h.query.prompt&&(s.prompt=h.query.prompt),h.query.img_url&&(s.referenceImageUrl=h.query.img_url,s.referenceImage=!0),h.query.ratio&&le.includes(h.query.ratio)&&(s.aspectRatio=h.query.ratio);const X=ge(h.query.output_format||h.query.format);X&&(s.outputFormat=X);const Ie=async()=>{if(!S.value){re.value.open();return}if(oe.value===0&&!S.value.is_subscribed){ae.value.open();return}E.value=!0,w.value=null,Q();try{const o={prompt:`一张黑白线描涂色插画,适合直接打印在标准尺寸(8.5x11英寸)的纸张上,无纸张边框。整体插画风格清新简洁,使用清晰流畅的黑色轮廓线条,无阴影、无灰阶、无颜色填充!,背景纯白,便于涂色。必须是完整的图片,不要有边框,适合人群:【6-9岁小朋友】画面描述:${s.prompt}`,aspect_ratio:s.aspectRatio,quality:"low",number_of_images:1,output_format:s.outputFormat,background:"opaque",moderation:"auto"};s.referenceImageUrl&&(o.image_input=[s.referenceImageUrl]);const r=D(await d.createSpecifyPrediction(Ut,zt,o)),n=G(r),g=W(n?.output||r?.output),l=String(n?.status||r?.status||"").toLowerCase();if(l==="failed"||l==="canceled"||l==="cancelled")throw new Error(T(n)||`replicate-${l}`);const p=ne(r);if(!g&&!p)throw new Error(`replicate-task-id-missing: ${T(n)||"unknown"}`);const R=g||await ie(p);if(!R)throw new Error(T(n)||"replicate-output-empty");w.value=R,P.addFreeUsageCnt(),I.success(m("coloring_form.messages.generated_success")),setTimeout(()=>{document.getElementById("generated-line-art")?.scrollIntoView({behavior:"smooth"})},300)}catch(e){I.error(e?.message||m("coloring_form.errors.task_timeout"))}finally{E.value=!1}},De=e=>{};return Ae({title:m("coloring_page.web_title"),meta:[{name:"description",content:m("coloring_page.web_description")},{property:"og:title",content:"Coloring Page Generator - Create Beautiful Coloring Page Illustrations | TeachAny"},{property:"og:description",content:"Transform your ideas into beautiful coloring page illustrations. Perfect for coloring books, educational materials, and creative projects."}]}),(e,o)=>{const r=Te,n=je,g=$e,l=et;return b(),v(B,null,[a("div",tt,[a("div",{class:O([[u(V)?"!my-0":""],"p-6 md:p-10 max-w-4xl mx-auto bg-white dark:bg-gray-800 rounded-xl shadow-lg"])}
1,[a("div",ot,[a("h1",rt,c(e.$t("coloring_form.title")),1),a("p",at,c(e.$t("coloring_form.description")),1)]),a("div",st,[a("button",{onClick:we,class:"text-sm flex items-center px-4 py-2 rounded-lg bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-all duration-200"},[_(u(Je),{class:"w-4 h-4 mr-2"}),x(" "+c(e.$t("coloring_form.buttons.clear")),1)]),a("button",{onClick:ke,class:"text-sm flex items-center px-4 py-2 rounded-lg bg-blue-50 hover:bg-blue-100 dark:bg-blue-900/30 dark:hover:bg-blue-900/50 text-blue-600 dark:text-blue-400 transition-all duration-200"},[_(u(Qe),{class:"w-4 h-4 mr-2"}),x(" "+c(e.$t("coloring_form.buttons.example")),1)])]),a("form",{onSubmit:$(Ie,["prevent"]),class:"space-y-8"},[a("div",nt,[a("label",it,[x(c(e.$t("coloring_form.labels.prompt"))+" ",1),a("span",lt,c(e.$t("coloring_form.labels.required")),1)]),a("div",ct,[Me(a("textarea",{id:"prompt","onUpdate:modelValue":o[0]||(o[0]=p=>s.prompt=p),required:"",rows:"2",placeholder:e.$t("coloring_form.placeholders.prompt"),class:"block resize-none w-full pl-12 pr-4 py-4 border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-base dark:text-white placeholder-gray-400 dark:placeholder-gray-500 shadow-sm"},null,8,gt),[[Ue,s.prompt]]),a("div",pt,[_(u(Ke),{class:"h-5 w-5"})])])]),a("div",ut,[a("div",dt,[a("label",mt,c(e.$t("coloring_form.labels.reference_image")),1),a("div",{class:O(["mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 dark:border-gray-600 border-dashed rounded-xl transition-all duration-200",{"border-blue-500 bg-blue-50 dark:bg-blue-900/20":L.value}]),onDragover:$(be,["prevent"]),onDragleave:$(ye,["prevent"]),onDrop:$(he,["prevent"])},[a("label",_t,[s.referenceImage?(b(),v("div",wt,[_(r,{src:s.referenceImageUrl,alt:"Reference image",width:"160",height:"160",class:"mx-auto h-40 w-40 object-cover rounded-xl shadow-md transition-transform duration-200 group-hover:scale-105"},null,8,["src"]),a("button",{type:"button",onClick:ve,class:"absolute -top-2 -right-2 p-1.5 bg-red-500 text-white rounded-full hover:bg-red-600 focus:outline-none shadow-lg transition-transform duration-200 hover:scale-110"},[...o[2]||(o[2]=[a("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):(b(),v("div",ft,[o[1]||(o[1]=a("div",{class:"p-3 rounded-full bg-gray-100 dark:bg-gray-800 mb-3"},[a("svg",{class:"h-8 w-8 text-gray-400",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48"},[a("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),a("div",bt,[a("span",yt,c(e.$t("coloring_form.upload.upload_file")),1),a("input",{id:"file-upload",name:"file-upload",type:"file",class:"sr-only",onChange:K,accept:"image/png,image/jpeg,image/webp"},null,32),a("p",ht,c(e.$t("coloring_form.upload.or_drag")),1)]),a("p",vt,c(e.$t("coloring_form.upload.file_types")),1)]))])],34)]),a("div",kt,[a("label",xt,[x(c(e.$t("coloring_form.labels.aspect_ratio"))+" ",1),a("span",It,c(e.$t("coloring_form.labels.required")),1)]),a("div",Dt,[(b(),v(B,null,Z(Y,p=>a("button",{key:p.value,type:"button",onClick:R=>s.aspectRatio=p.value,"aria-pressed":s.aspectRatio===p.value,class:O(["py-3 px-4 rounded-xl border text-center text-sm font-medium transition-all duration-200",s.aspectRatio===p.value?"bg-blue-100 border-blue-500 text-blue-800 dark:bg-blue-900 dark:border-blue-600 dark:text-blue-200 shadow-md":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700"])},c(p.label),11,Et)),64))])]),a("div",Ct,[a("label",Pt,[x(c(F("coloring_form.labels.output_format","Output Format:"))+" ",1),a("span",At,c(e.$t("coloring_form.labels.required")),1)]),a("div",Tt,[(b(),v(B,null,Z(H,p=>a("button",{key:p.value,type:"button",onClick:R=>s.outputFormat=p.value,"aria-pressed":s.outputFormat===p.value,class:O
1(["py-3 px-4 rounded-xl border text-center text-sm font-medium uppercase transition-all duration-200",s.outputFormat===p.value?"bg-blue-100 border-blue-500 text-blue-800 dark:bg-blue-900 dark:border-blue-600 dark:text-blue-200 shadow-md":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700"])},c(p.label),11,Lt)),64))])])]),a("div",Rt,[a("button",{type:"submit",class:"w-full flex justify-center py-4 px-6 border border-transparent rounded-xl shadow-lg text-lg font-semibold text-white bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-offset-gray-800 transition-all duration-200 transform hover:scale-[1.02] disabled:opacity-70 disabled:cursor-not-allowed",disabled:E.value},[E.value?(b(),v("span",$t,[o[3]||(o[3]=a("svg",{class:"animate-spin -ml-1 mr-3 h-6 w-6 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),x(" "+c(e.$t("coloring_form.buttons.generating")),1)])):(b(),v("span",Ot,[_(u(Xe),{class:"w-6 h-6 mr-2"}),x(" "+c(e.$t("coloring_form.buttons.generate")),1)]))],8,jt),E.value?(b(),v("p",qt,c(e.$t("coloring_form.messages.generation_wait_notice")),1)):q("",!0)])],32),w.value?(b(),v("div",Ft,[a("div",St,[a("h2",Vt,c(e.$t("coloring_form.result.title")),1),a("div",Bt,[a("button",{onClick:xe,class:"flex items-center px-4 py-2 rounded-lg bg-white dark:bg-gray-800 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-gray-700 transition-all duration-200 shadow-sm"},[_(u(Ze),{class:"w-5 h-5 mr-2"}),x(" "+c(e.$t("coloring_form.buttons.download")),1)]),u(V)?(b(),ee(n,{key:0,disabled:!u(_e),loading:u(pe),label:u(me),"status-message":u(de),"status-type":u(ue),onInsert:u(fe)},null,8,["disabled","loading","label","status-message","status-type","onInsert"])):q("",!0),_(g,{"content-type":"coloring-page-generator",onReported:De})])]),a("div",Mt,[_(r,{src:w.value,alt:"Generated line art",width:"800",height:"800",class:"w-full h-auto rounded-xl"},null,8,["src"])])])):q("",!0)],2)]),!u(V)&&!u(S)?(b(),ee(l,{key:0})):q("",!0)],64)}}},ko=He(Yt,[["__scopeId","data-v-37c473d2"]]);export{ko 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.