|
| 1 | +const items = [ |
| 2 | + { |
| 3 | + repo: "rust", |
| 4 | + title: "Rust Package/Library", |
| 5 | + tech: ["Rust", "Library", "Package"], |
| 6 | + }, |
| 7 | + { |
| 8 | + repo: "express-vercel", |
| 9 | + title: "Express + Vercel", |
| 10 | + tech: ["Javascript", "API", "Express", "Vercel", "Backend", "Server"], |
| 11 | + url: "https://express-vercel-frames.vercel.app/", |
| 12 | + }, |
| 13 | + { |
| 14 | + repo: "express", |
| 15 | + title: "Express", |
| 16 | + tech: ["Javascript", "API", "Express", "Backend", "Server"], |
| 17 | + }, |
| 18 | + { |
| 19 | + repo: "js-tw", |
| 20 | + title: "Javascript + Tailwind", |
| 21 | + tech: ["Javascript", "Tailwind", "HTML", "CSS", "Frontend", "Vanilla"], |
| 22 | + url: "https://pr4j3sh.github.io/js-tw/", |
| 23 | + }, |
| 24 | + { |
| 25 | + repo: "react-tw", |
| 26 | + title: "React + Tailwind", |
| 27 | + tech: ["React", "Tailwind", "React Router", "Frontend"], |
| 28 | + url: "https://react-tw-frames.vercel.app/", |
| 29 | + }, |
| 30 | + { |
| 31 | + repo: "react-firebase", |
| 32 | + title: "React + Firebase", |
| 33 | + tech: [ |
| 34 | + "React", |
| 35 | + "Firebase", |
| 36 | + "Tailwind", |
| 37 | + "React Router", |
| 38 | + "Redux Toolkit", |
| 39 | + "Frontend", |
| 40 | + ], |
| 41 | + url: "https://react-firebase-frames.vercel.app/", |
| 42 | + }, |
| 43 | +]; |
| 44 | + |
| 45 | +const templates = document.getElementById("templates"); |
| 46 | + |
| 47 | +const html = items |
| 48 | + .map((item) => { |
| 49 | + const tags = item.tech |
| 50 | + .map((tag) => { |
| 51 | + return `<code>${tag}</code>`; |
| 52 | + }) |
| 53 | + .join(""); |
| 54 | + const url = item.url |
| 55 | + ? `<a class="link" href="${item.url}" target="_blank">template</a><span>/</span>` |
| 56 | + : ""; |
| 57 | + return `<article> |
| 58 | +<span class="tag">${item.repo}</span> |
| 59 | +<h6>${item.title}</h6> |
| 60 | +<article class="btns">${tags}</article> |
| 61 | +<pre><code>npm create @pr4j3sh/frames@latest ${item.repo} myapp</code></pre> |
| 62 | +<article class="btns"> |
| 63 | +${url} |
| 64 | +<a class="link" href="https://github.com/pr4j3sh/${item.repo}/" target="_blank">github</a> |
| 65 | +</article> |
| 66 | +</article>`; |
| 67 | + }) |
| 68 | + .join(""); |
| 69 | + |
| 70 | +templates.innerHTML = html; |
0 commit comments