commit 9f4eda97c6ab5c8e089d0b8a750a962595fc33e6
Author: root <root@hub.scroll.pub> Date: 2024-12-27 20:24:39 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..e836e69 --- /dev/null +++ b/body.html @@ -0,0 +1,10 @@ +<header> + <h1>Interactive 3D Brain</h1> + <p>Explore the human brain in 3D. Scroll to rotate and zoom.</p> +</header> +<main> + <div id="brain-container"></div> +</main> +<footer> + <p>Designed for education and exploration.</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..f37661a --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://brain3d.scroll.pub +metaTags +editButton /edit.html +title Interactive 3D Brain Visualization +style.css +body.html +script.js \ No newline at end of file diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..b015369 --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "496a842e-dae7-4b2e-93f0-de067947e76a", + "object": "chat.completion", + "created": 1735331069, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nbrain3d.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://brain3d.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Interactive 3D Brain Visualization\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>Interactive 3D Brain</h1>\n <p>Explore the human brain in 3D. Scroll to rotate and zoom.</p>\n</header>\n<main>\n <div id=\"brain-container\"></div>\n</main>\n<footer>\n <p>Designed for education and exploration.</p>\n</footer>\n---style.css---\nbody {\n margin: 0;\n font-family: 'Arial', sans-serif;\n background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);\n color: white;\n text-align: center;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\nheader, footer {\n padding: 20px;\n}\n\nh1 {\n font-size: 2.5rem;\n margin-bottom: 10px;\n}\n\np {\n font-size: 1.2rem;\n}\n\n#brain-container {\n width: 100%;\n height: 70vh;\n position: relative;\n overflow: hidden;\n}\n\ncanvas {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n@media (max-width: 768px) {\n h1 {\n font-size: 2rem;\n }\n p {\n font-size: 1rem;\n }\n}\n---script.js---\nlet scene, camera, renderer, brain;\n\nfunction init() {\n scene = new THREE.Scene();\n camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);\n renderer = new THREE.WebGLRenderer({ antialias: true });\n renderer.setSize(window.innerWidth, window.innerHeight);\n document.getElementById('brain-container').appendChild(renderer.domElement);\n\n const loader = new THREE.GLTFLoader();\n loader.load('/brain.gltf', function(gltf) {\n brain = gltf.scene;\n scene.add(brain);\n animate();\n });\n\n camera.position.z = 5;\n\n window.addEventListener('resize', onWindowResize, false);\n window.addEventListener('scroll', onScroll, false);\n}\n\nfunction onWindowResize() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n}\n\nfunction onScroll() {\n const scrollY = window.scrollY;\n const rotation = scrollY * 0.01;\n const zoom = 5 - scrollY * 0.01;\n\n if (brain) {\n brain.rotation.y = rotation;\n }\n camera.position.z = Math.max(zoom, 1);\n}\n\nfunction animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n}\n\ninit();\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 243, + "completion_tokens": 676, + "total_tokens": 919, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 243 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..a5ced2d --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# brain3d2.scroll.pub +Website generated by DeepSeek from prompt: create interactive 3d brain using threejs \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..a74831b --- /dev/null +++ b/script.js @@ -0,0 +1,45 @@ +let scene, camera, renderer, brain; + +function init() { + scene = new THREE.Scene(); + camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); + renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setSize(window.innerWidth, window.innerHeight); + document.getElementById('brain-container').appendChild(renderer.domElement); + + const loader = new THREE.GLTFLoader(); + loader.load('/brain.gltf', function(gltf) { + brain = gltf.scene; + scene.add(brain); + animate(); + }); + + camera.position.z = 5; + + window.addEventListener('resize', onWindowResize, false); + window.addEventListener('scroll', onScroll, false); +} + +function onWindowResize() { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + renderer.setSize(window.innerWidth, window.innerHeight); +} + +function onScroll() { + const scrollY = window.scrollY; + const rotation = scrollY * 0.01; + const zoom = 5 - scrollY * 0.01; + + if (brain) { + brain.rotation.y = rotation; + } + camera.position.z = Math.max(zoom, 1); +} + +function animate() { + requestAnimationFrame(animate); + renderer.render(scene, camera); +} + +init(); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..7ccf741 --- /dev/null +++ b/style.css @@ -0,0 +1,46 @@ +body { + margin: 0; + font-family: 'Arial', sans-serif; + background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); + color: white; + text-align: center; + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +header, footer { + padding: 20px; +} + +h1 { + font-size: 2.5rem; + margin-bottom: 10px; +} + +p { + font-size: 1.2rem; +} + +#brain-container { + width: 100%; + height: 70vh; + position: relative; + overflow: hidden; +} + +canvas { + display: block; + width: 100%; + height: 100%; +} + +@media (max-width: 768px) { + h1 { + font-size: 2rem; + } + p { + font-size: 1rem; + } +} \ No newline at end of file