Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 18 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,16 @@
<script src="three.min.js"></script>
<script src='THREEx.KeyboardState.js'></script>
<script>
var temp;
var temp;
var value = {}
// value.x = document.getElementsByTagName("circle")[3].getAttribute("cx")
var t1 = anime.timeline({
easing: 'easeOutElastic(1, .8)',
autoplay: false,
duration: 4000
});
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
scene.background = new THREE.Color( 0xFFFFFF);
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );


var keyboard = new THREEx.KeyboardState();


camera.position.z = 5;
document.addEventListener("keydown", onDocumentKeyDown, false);
function onDocumentKeyDown(event) {
var keyCode = event.which;
Expand All @@ -85,26 +76,27 @@
} else if (keyCode == 32) {

}
animate();
};

var animate = function () {
requestAnimationFrame( animate );
console.log(keyboard.pressed('w'));

//cube.rotation.x += 0.01;
// cube.rotation.y += 0.01;

renderer.render( scene, camera );
};

animate();


function sound(src) {
this.sound = document.createElement("audio");
this.sound.src = src;
this.sound.setAttribute("preload", "auto");
this.sound.setAttribute("controls", "none");
this.sound.style.display = "none";
document.body.appendChild(this.sound);
this.play = function(){
this.sound.play();
}
this.stop = function(){
this.sound.pause();
}
}

function myFunction() {


myMusic = new sound("Drip.wav");
myMusic.play();

value.x =+ document.getElementsByTagName("circle")[3].getAttribute("cx");
console.log("valye is " + value.x);
Expand Down