var lesson = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { onMount, onCleanup } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n  let canvas;\n  onMount(() => {\n    const ctx = canvas.getContext(\"2d\");\n    let frame = requestAnimationFrame(loop);\n\n    function loop(t) {\n      frame = requestAnimationFrame(loop);\n\n      const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n\n      for (let p = 0; p < imageData.data.length; p += 4) {\n        const i = p / 4;\n        const x = i % canvas.width;\n        const y = (i / canvas.height) >>> 0;\n\n        const r = 64 + (128 * x) / canvas.width + 64 * Math.sin(t / 1000);\n        const g = 64 + (128 * y) / canvas.height + 64 * Math.cos(t / 1000);\n        const b = 128;\n\n        imageData.data[p + 0] = r;\n        imageData.data[p + 1] = g;\n        imageData.data[p + 2] = b;\n        imageData.data[p + 3] = 255;\n      }\n\n      ctx.putImageData(imageData, 0, 0);\n    }\n\n    onCleanup(() => cancelAnimationFrame(frame));\n  });\n\n  return <canvas width=\"256\" height=\"256\" />;\n}\n\nrender(() => <App />, document.getElementById(\"app\"));\n"
		},
		{
			name: "style",
			type: "css",
			content: "canvas {\n  background-color: #666;\n  -webkit-mask: url(https://dev.solidjs.com/img/logo/dark-without-wordmark/logo.svg) 50% 50% no-repeat;\n  mask: url(https://dev.solidjs.com/img/logo/dark-without-wordmark/logo.svg) 50% 50% no-repeat;\n}"
		}
	]
};
var solved = {
	files: [
		{
			name: "main",
			content: "import { render } from \"solid-js/web\";\nimport { onMount, onCleanup } from \"solid-js\";\n\nimport \"./style.css\";\n\nfunction App() {\n  let canvas;\n  onMount(() => {\n    const ctx = canvas.getContext(\"2d\");\n    let frame = requestAnimationFrame(loop);\n\n    function loop(t) {\n      frame = requestAnimationFrame(loop);\n\n      const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n\n      for (let p = 0; p < imageData.data.length; p += 4) {\n        const i = p / 4;\n        const x = i % canvas.width;\n        const y = (i / canvas.height) >>> 0;\n\n        const r = 64 + (128 * x) / canvas.width + 64 * Math.sin(t / 1000);\n        const g = 64 + (128 * y) / canvas.height + 64 * Math.cos(t / 1000);\n        const b = 128;\n\n        imageData.data[p + 0] = r;\n        imageData.data[p + 1] = g;\n        imageData.data[p + 2] = b;\n        imageData.data[p + 3] = 255;\n      }\n\n      ctx.putImageData(imageData, 0, 0);\n    }\n\n    onCleanup(() => cancelAnimationFrame(frame));\n  });\n\n  return <canvas ref={canvas} width=\"256\" height=\"256\" />;\n}\n\nrender(() => <App />, document.getElementById(\"app\"));\n"
		},
		{
			name: "style",
			type: "css",
			content: "canvas {\n  background-color: #666;\n  -webkit-mask: url(https://dev.solidjs.com/img/logo/dark-without-wordmark/logo.svg) 50% 50% no-repeat;\n  mask: url(https://dev.solidjs.com/img/logo/dark-without-wordmark/logo.svg) 50% 50% no-repeat;\n}"
		}
	]
};
var markdown = "在 Solid 中，你可以通过赋值获拿到元素的引用，因为 JSX 会像这下面样创建 DOM 元素：\n\n```jsx\nconst myDiv = <div>My Element</div>;\n```\n\n但是，避免将元素拆分并将放在单个连续的 JSX 模板中是有好处的，因为这养可以让 Solid 更好地对元素创建进行优化。\n\n与之类似地，在 Solid 中你可以使用 `ref` 属性获取元素的引用。对 Ref 进行赋值类似于上面的例子，赋值行为是在元素创建时，在 DOM 被追加前发生的。 只需声明一个变量，元素引用就会赋值给该变量。\n\n```jsx\nlet myDiv;\n\n<div ref={myDiv}>My Element</div>;\n```\n\n因此，让我们获取对 canvas 元素的引用并为其设置动画：\n\n```jsx\n<canvas ref={canvas} width=\"256\" height=\"256\" />\n```\n\nRefs 也可以采用回调函数的形式。这便于封装逻辑，尤其是当你不需要等到元素被追加时。\n\n```js\n<div ref={el => /* 处理 el... */}>My Element</div>\n```\n";
var bindings_refs = {
	lesson: lesson,
	solved: solved,
	markdown: markdown
};

export { bindings_refs as default, lesson, markdown, solved };
