Skip to content

Commit

Permalink
Merge branch 'development' into menu-xs
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyvdhoogen authored Jun 7, 2017
2 parents 30a934a + 475db66 commit 04f8693
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 19 deletions.
Binary file added assets/meta/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<?php include 'templates/splash.php' ?>
<?php include 'templates/loader.php' ?>
<div class="information-button">
<button onclick="StateManager.setCurrentState(1);"> INFO </button>
<button onclick="goToState(1);"> INFO </button>
</div>
<div id="track-information" class="track-information">
<div id="track-info-text">
Expand Down Expand Up @@ -64,6 +64,7 @@
<script src="js/components/loaders/Detector.js"></script>
<script src="js/components/StateManager.js"></script>
<script src="js/components/SoundManager.js"></script>
<script src="js/components/EasingTools.js"></script>
<script src="js/components/_main.js"></script>
<!-- <script src="js/components/_debug.js"></script> -->
<script src="js/components/world/init.js"></script>
Expand Down
16 changes: 16 additions & 0 deletions js/components/EasingTools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var EasingTools = (function () {
var self = {};
self.status = 'idle'; //

self.easeInSin = function (t) {
return 1 + Math.sin(Math.PI / 2 * t - Math.PI / 2);
}
self.easeOutSin = function (t) {
return Math.sin(Math.PI / 2 * t);
}
self.easeInOutSin = function (t) {
return (1 + Math.sin(Math.PI * t - Math.PI / 2)) / 2;
}

return self;
}());
47 changes: 36 additions & 11 deletions js/components/InputController.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,35 @@ function toggleMobileExpand(){
trackInfoElem.classList.toggle('expand-mobile');
}

document.addEventListener( 'mouseout' , mouseLeaves, false);

function mouseLeaves() {
window.touchingEdge = 0;
}

function checkIfMouseNearEdges(event){
edges = {};
var edgeThickness = window.innerWidth * 0.20; // edge is 20% of screen width;
edges.left = {x:{ start: 0, end: 0 + edgeThickness}};
edges.left.x.size = edges.left.x.end - edges.left.x.start;
edges.right = {x:{ start: window.innerWidth - edgeThickness, end: window.innerWidth}};
edges.right.x.size = edges.right.x.end - edges.right.x.start;
window.touchingEdge = 0;
window.percentageInEdge = 0;

if(event.clientX > edges.left.x.start && event.clientX < edges.left.x.end){
window.touchingEdge = 'left';
var progress = (edges.left.x.end - event.clientX);
window.percentageInEdge = progress / edges.left.x.size;
}

if(event.clientX > edges.right.x.start && event.clientX < edges.right.x.end){
window.touchingEdge = 'right';
var progress = (event.clientX - edges.right.x.start);
window.percentageInEdge = progress / edges.right.x.size;
}
}

function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
Expand All @@ -40,13 +69,14 @@ function onMouseMove( event ) {
$('.menu').removeClass("short");
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
controls.rotUp(Math.sin(mouse.y /200) * -1);
checkIfMouseNearEdges(event);
// controls.rotUp(Math.sin(mouse.y /200) * -1);

// exp

raycaster.setFromCamera( mouse, camera );

var intersects = raycaster.intersectObjects( scene.children[1].children, true);
var intersects = raycaster.intersectObjects( scene.children[3].children, true);
document.body.style.cursor = 'default';

if ( intersects.length > 0 ) {
Expand All @@ -61,9 +91,6 @@ function onMouseMove( event ) {
WiggleMeshOut(window.lastMesh);
}
}



}

function onTouchEnd(event){
Expand Down Expand Up @@ -92,8 +119,7 @@ function onTouchStart(event){
// console.log(intersects[0].object.parent)
// alert(mesh.name);
SoundManager.playTrackByName(mesh.name);

}
}
}else{
return false;
}
Expand All @@ -107,18 +133,17 @@ function onDocumentMouseDown( event ) {

raycaster.setFromCamera( mouse, camera );

var intersects = raycaster.intersectObjects( scene.children[1].children, true);
var intersects = raycaster.intersectObjects( scene.children[3].children, true);

if ( intersects.length > 0 ) {
// alert(mesh.name);

var mesh = intersects[0].object.parent;
console.log(mesh);

if(mesh.name == 'Cylinder'){
moveToDownloadPage();
}
// console.log(intersects[0].object.parent)
// alert(mesh.name);

SoundManager.playTrackByName(mesh.name);

}
Expand Down
1 change: 1 addition & 0 deletions js/components/StateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var StateManager = (function () {
},
destroy: function(){
//
window.touchingEdge = 0;
detachIOEventListeners();
}
},
Expand Down
11 changes: 10 additions & 1 deletion js/components/world/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ function init() {
sphere.position = new THREE.Vector3(0, 0, -299);
scene.add(sphere);


window.light = new THREE.PointLight( 0x334650, 5, 500); //0xdddddd
window.light.position.set(1,1,1);
scene.add( light );

var light2 = new THREE.PointLight( 0xdddddd, 1, 5000); //0xdddddd
light2.position.set(1,3,1);
scene.add( light2);

// add the c4d ssets
//scene.add( dae );

Expand All @@ -59,7 +68,7 @@ function init() {
var pointLight = new THREE.PointLight( 0xffffff, 4 );
// particleLight.add( pointLight );

renderer = new THREE.WebGLRenderer();
renderer = new THREE.WebGLRenderer({antialias: false});
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
Expand Down
15 changes: 15 additions & 0 deletions js/components/world/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function render() {

// calculate objects intersecting the picking ray
var intersects = raycaster.intersectObjects( scene.children );
applyEdgeRotation();

for ( var i = 0; i < intersects.length; i++ ) {
// iterate through all intersecting objects
Expand All @@ -34,6 +35,20 @@ function render() {
renderer.render( scene, camera );
}

function applyEdgeRotation(){
var speed = 0.018;
switch(window.touchingEdge){
case 'left':
document.body.style.cursor = 'w-resize';
controls.rotate(window.percentageInEdge * -speed);
break;
case 'right':
document.body.style.cursor = 'e-resize';
controls.rotate(window.percentageInEdge * speed);
break;
}
}

function getInitialRotationForObjects(){
console.log(scene);
window.initialObjectRotations = {};
Expand Down
2 changes: 2 additions & 0 deletions js/components/world/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ window.addEventListener( 'deviceorientation', function(event){
var invisMaterial = new THREE.MeshNormalMaterial( ) ; //3
var invisMaterial = new THREE.MeshPhongMaterial( { color: 0xdddddd, shininess: 10, shading: THREE.SmoothShading, opacity: 0.5, transparent: true } );
var symbolMeshMaterial = new THREE.MeshLambertMaterial( { color: 0x0, emissive: 0x282828, shininess: 100, transparent: true, opacity: 1} );
var symbolMeshMaterial = new THREE.MeshPhongMaterial( { color: 0x334650, shininess: 100, specular:0x111111, emissive:0x0, shading: THREE.SmoothShaindg} );


dae.children.forEach(function(item){
if(item.name.indexOf('invis_') != -1){
Expand Down
12 changes: 6 additions & 6 deletions params.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
$meta = [
"title" => "ghost kwini - void, seperation and waiting",
"description" => "A loveplay starring cells | DEV004",
"image" => "http://www.d-e-v-o-r-m.com/003/assets/meta/image.jpg",
"url" => "http://www.d-e-v-o-r-m.com/003"
"image" => "http://www.d-e-v-o-r-m.com/004/assets/meta/image.jpg",
"url" => "http://www.d-e-v-o-r-m.com/004"
];

$info = [
"catalog" => "DEV004",
"artist" => "ghost kwini",
"release" => "void, separation and waiting"
];
];

$svg = [
"yt" => "svg/yt.svg",
Expand All @@ -24,9 +24,9 @@
];

$links =[
"bc" => [ "txt" => "bandcamp", "url" => "http://www.bandcamp.com", 'icon' => ""],
"sc" => [ "txt" => "soundcloud", "url" => "http://www.soundcloud.com", 'icon' => ""],
"fb" => [ "txt" => "facebook", "url" => "http://www.facebook.com", 'icon' => ""]
"bc" => [ "txt" => "bandcamp", "url" => "https://devorm.bandcamp.com/", 'icon' => ""],
"sc" => [ "txt" => "soundcloud", "url" => "https://soundcloud.com/devorm", 'icon' => ""],
"fb" => [ "txt" => "facebook", "url" => "https://www.facebook.com/DEVORM-records-200577410125129/", 'icon' => ""]
];

?>

0 comments on commit 04f8693

Please sign in to comment.