From a4fe0f1a515f3dd71756dfe22ccc3fda4706767e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 6 Oct 2024 09:26:32 +0000 Subject: [PATCH] Deploy to GitHub pages --- CNAME | 1 + assets/favicon-CUbDEQ3w.svg | 1 + assets/index-Dx3MkCcf.css | 1 + assets/index-qgSKoTXL.js | 1 + index.html | 111 ++++++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 CNAME create mode 100644 assets/favicon-CUbDEQ3w.svg create mode 100644 assets/index-Dx3MkCcf.css create mode 100644 assets/index-qgSKoTXL.js create mode 100644 index.html diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..6994750 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +tornado.elonehoo.xyz diff --git a/assets/favicon-CUbDEQ3w.svg b/assets/favicon-CUbDEQ3w.svg new file mode 100644 index 0000000..5ef9366 --- /dev/null +++ b/assets/favicon-CUbDEQ3w.svg @@ -0,0 +1 @@ + diff --git a/assets/index-Dx3MkCcf.css b/assets/index-Dx3MkCcf.css new file mode 100644 index 0000000..d38fcf0 --- /dev/null +++ b/assets/index-Dx3MkCcf.css @@ -0,0 +1 @@ +body{overflow:hidden;padding:0;margin:0}canvas{display:block} diff --git a/assets/index-qgSKoTXL.js b/assets/index-qgSKoTXL.js new file mode 100644 index 0000000..54a4bec --- /dev/null +++ b/assets/index-qgSKoTXL.js @@ -0,0 +1 @@ +import*as e from"https://cdn.skypack.dev/three@0.133.1/build/three.module";import{GUI as u}from"https://cdn.skypack.dev/lil-gui@0.16.1";(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))a(t);new MutationObserver(t=>{for(const s of t)if(s.type==="childList")for(const h of s.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&a(h)}).observe(document,{childList:!0,subtree:!0});function r(t){const s={};return t.integrity&&(s.integrity=t.integrity),t.referrerPolicy&&(s.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?s.credentials="include":t.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(t){if(t.ep)return;t.ep=!0;const s=r(t);fetch(t.href,s)}})();const n=document.querySelector(".container"),c={height:1.1,density:2.5,curl:12};class l{constructor(){const i=new u;window.innerWidth<600&&i.close(),i.add(c,"height",1,1.8).step(.01).onChange(r=>{o.material.uniforms.u_height.value=r}),i.add(c,"density",1,4).step(.1).onChange(r=>{o.material.uniforms.u_density.value=r}),i.add(c,"curl",4,20).step(.1).onChange(r=>{o.material.uniforms.u_curl.value=r})}}class m{constructor(){this.renderer=new e.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setClearColor(16777215,0),n.appendChild(this.renderer.domElement),this.scene=new e.Scene,this.camera=new e.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,1e3),this.camera.position.z=2.9,this.camera.position.y=1.1,this.camera.lookAt(0,0,0),this.rotationY=-.4*Math.PI,this.raycaster=new e.Raycaster,this.mouse=new e.Vector2(0,0),this.mouseTarget=new e.Vector2(0,0),this.wind=new e.Vector2(0,0),this.clock=new e.Clock,this.setupScene(),this.render()}setupScene(){const i=new e.MeshBasicMaterial({color:16777215}),r=new e.PlaneGeometry(2e3,1e3);this.floor=new e.Mesh(r,i),this.floor.position.set(0,-2,0),this.floor.rotation.set(-.2*Math.PI,0,0),this.scene.add(this.floor),this.material=new e.ShaderMaterial({uniforms:{u_time:{type:"f",value:0},u_height:{type:"f",value:c.height},u_density:{type:"f",value:c.density},u_curl:{type:"f",value:c.curl},u_wind:{type:"v2",value:new e.Vector2(0,0)}},vertexShader:document.getElementById("vertexShader").textContent,fragmentShader:document.getElementById("fragmentShader").textContent,side:e.DoubleSide,transparent:!0});const a=new e.LineCurve3(new e.Vector3(0,0,0),new e.Vector3(0,1,0)),t=new e.TubeGeometry(a,512,.55,512,!1);this.mesh=new e.Mesh(t,this.material),this.mesh.position.set(0,-.65,0),this.mesh.rotation.set(0,this.rotationY,0),this.scene.add(this.mesh)}addCanvasEvents(){n.addEventListener("mousemove",r=>{i(r.clientX,r.clientY,this)}),n.addEventListener("touchmove",r=>{i(r.touches[0].pageX,r.touches[0].pageY,this)});function i(r,a,t){const s=r-n.offsetLeft,h=a-n.offsetTop;t.mouseTarget.x=s/n.offsetWidth*2-1,t.mouseTarget.y=-(h/n.offsetHeight)*2+1}}render(){this.material.uniforms.u_time.value=1.3*this.clock.getElapsedTime(),this.mouse.x+=(this.mouseTarget.x-this.mouse.x)*.1,this.mouse.y+=(this.mouseTarget.y-this.mouse.y)*.1,this.raycaster.setFromCamera(this.mouse,this.camera);const i=this.raycaster.intersectObject(this.floor);i.length&&(this.wind=new e.Vector2(i[0].uv.x-.5,.5-i[0].uv.y).rotateAround(new e.Vector2(0,0),this.rotationY).multiplyScalar(200),this.material.uniforms.u_wind.value=this.wind),this.renderer.render(this.scene,this.camera)}loop(){this.render(),requestAnimationFrame(this.loop.bind(this))}updateSize(){this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2))}}new l;const o=new m;o.addCanvasEvents();o.updateSize();o.loop();window.addEventListener("resize",()=>o.updateSize()); diff --git a/index.html b/index.html new file mode 100644 index 0000000..c46b2b7 --- /dev/null +++ b/index.html @@ -0,0 +1,111 @@ + + + + + + + Interactive Tornado + + + + +
+
+
+ + + + + + +