Spaces:
Paused
Paused
File size: 5,593 Bytes
3c3f089 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
export const treeTemplates = {
_empty: {
name: "Empty",
description: "By codetree",
public: true,
iconSrc: "/icons/vanilla.svg",
tabs: {
javascript: {
title: "app.jsx",
entryPoints: "index.js",
monacoLanguage: "javascript",
data: ``,
},
html: {
title: "index.html",
entryPoints: "index.html",
monacoLanguage: "html",
data: ``,
},
css: {
title: "main.css",
entryPoints: "main.css",
monacoLanguage: "css",
data: ``,
},
},
},
_vanilla: {
name: "Vanilla",
description: "By codetree",
public: true,
iconSrc: "/icons/vanilla.svg",
tabs: {
javascript: {
title: "JS/JSX",
entryPoints: "index.js",
monacoLanguage: "javascript",
data: `document.getElementById("app").innerHTML = \`
<h1>Vanilla</h1>
<div>
Bare minimal javascript template
</div>
\`;
`,
},
html: {
title: "html",
entryPoints: "index.html",
monacoLanguage: "html",
data: `<div id="app"></div>`,
},
css: {
title: "Css",
entryPoints: "main.css",
monacoLanguage: "css",
data: `body {
font-family: sans-serif;
}
#app {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
`,
},
},
},
_typescript: {
name: "Typescript",
description: "By codetree",
public: true,
iconSrc: "/icons/typescript.svg",
tabs: {
javascript: {
title: "Ts/Tsx",
entryPoints: "index.ts",
monacoLanguage: "typescript",
data: `function add(x: number, y: number): number {
return x + y;
}
const result = add(2,5)
console.log(result)`,
},
html: {
title: "Html",
entryPoints: "index.html",
monacoLanguage: "html",
data: `<div id="app">
<h1>Typescript</h1>
<div>Bare minimal Typescript template 🚀</div>
</div>
`,
},
css: {
title: "Css",
entryPoints: "main.css",
monacoLanguage: "css",
data: `body {
font-family: sans-serif;
}
#app {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
`,
},
},
},
_p5: {
name: "P5js",
description: "By codetree",
public: true,
iconSrc: "/icons/p5-dot-js.svg",
tabs: {
javascript: {
title: "JS/JSX",
entryPoints: "index.js",
monacoLanguage: "javascript",
data: `import p5 from "p5";
let sketch = function (p) {
p.setup = function () {
p.createCanvas(window.innerWidth, window.innerHeight);
p.background(0);
};
p.draw = () => {
// sketch.background(100);
p.fill(255);
p.ellipse(p.mouseX, p.mouseY, 50, 50);
};
};
new p5(sketch, window.document.getElementById("container"));
`,
},
html: {
title: "Html",
entryPoints: "index.html",
monacoLanguage: "html",
data: ``,
},
css: {
title: "Css",
entryPoints: "main.css",
monacoLanguage: "css",
data: `body {
margin: 0px;
font-family: sans-serif;
}
canvas {
margin: 0px;
}
`,
},
},
},
_react: {
name: "React",
description: "By codetree",
public: true,
iconSrc: "/icons/reactjs.svg",
tabs: {
javascript: {
title: "JS/JSX",
entryPoints: "index.js",
monacoLanguage: "javascript",
data: `import React, { useState } from "react";
import ReactDOM from "react-dom";
function App() {
const [count, setCount] = useState(0);
return (
<div className="App">
<h1>Hello ReactTree</h1>
<h2>You clicked {count} times!</h2>
<button onClick={() => setCount(count - 1)}>Decrement</button>
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
);
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
`,
},
html: {
title: "index.html",
entryPoints: "index.html",
monacoLanguage: "html",
data: ``,
},
css: {
title: "main.css",
entryPoints: "main.css",
monacoLanguage: "css",
data: `.App {
font-family: sans-serif;
text-align: center;
}
`,
},
},
},
_gsap: {
name: "Gsap",
description: "By codetree",
public: true,
iconSrc: "/icons/gsap-greensock.svg",
tabs: {
javascript: {
title: "JS/JSX",
entryPoints: "index.js",
monacoLanguage: "javascript",
data: `import gsap from "gsap"
var tl = gsap.timeline({ repeat: -1 });
tl.to("h1", 30, { backgroundPosition: "-960px 0" });
`,
},
html: {
title: "Html",
entryPoints: "index.html",
monacoLanguage: "html",
data: `<div class="wrapper">
<h1 class="title">Codetree<h1>
</div> `,
},
css: {
title: "Css",
entryPoints: "main.css",
monacoLanguage: "css",
data: `body {
background-color: #1d1d1d;
margin: 0;
padding: 0;
}
.wrapper {
display: flex;
height: 100vh;
justify-content: center;
align-items: center;
}
h1 {
max-width: 75%;
font-size: 100px;
text-align: center;
font-family: "Montserrat", sans-serif;
color: #540032;
}
.title {
background-image: url(https://cdn.pixabay.com/photo/2017/07/03/20/17/abstract-2468874_960_720.jpg);
background-attachment: fixed;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}`,
},
},
},
};
|