web-html5-scripts/buttons-and-toggles/electric-hover-effect/script.js

184 lines
251 KiB
JavaScript
Raw Normal View History

2020-05-07 20:51:13 +02:00
var mobileAndTabletcheck = function() {
var check = false;
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
return check;
};
var canvas = document.createElement( 'canvas' );
var ctx = canvas.getContext( '2d' );
var w = 320;
var h = 320;
var width = window.innerWidth;
var height = window.innerHeight;
var planeSize = 600;
var radius = 300;
if(mobileAndTabletcheck()){
planeSize = 400;
w = 200;
h = 200;
radius = 150;
}
canvas.setAttribute('width', w);
canvas.setAttribute('height', h);
// canvas.style.position = 'absolute';
// canvas.style.width = '320px';
// canvas.style.height = '320px';
// canvas.style.top = '0';
// canvas.style.left = '0';
// canvas.style.zIndex = '100';
// document.body.appendChild(canvas);
window.addEventListener('resize', onWindowResize);
var maskImage = new Image();
//because of tainted canvas
maskImage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AJ0QBA/nMfraz1QiJ4oZeb/LxPrv+H/XJT5dCAfQf9gWDlIInmCv5sM+s8xB5H0qXIBL7/fCEg/gNBHQSm8yKATCmDz/SvsHwH0r8p2BqT4NEpwGMWz13B1I03yzqEs7VsKA9lcABMG9iCh4wkdKYFViA/jIhCSNJAiRpZlE0DW7+ti7X1h6/b3Ib+s8t8WMjGPvTJ0C3IEjG+nkaKyMigL97JmjuiOBL8K2irCAGjQHTTwEkPIaqaDANbyr+VYp5Mc08DVHIurRGjg8QGG7JXawweZ/2ebL7OqXXd8vUcGP4DQh4MI67G6eez9hsz/T0D83o9Po+gvIIg37KtTnTsS+Pday9imkJQH3F0b6LkAr5HjCFK+1trfjz8cRHi/lxHDKBLwogBr/ddC+i6CTGZ1+MwNeK50Bt/LhISfUscjsPgMCcTRXMYNHEnSZzgc4MMI/iMJE72cQHPY9zT5/1UBTkP0ENnNfPTaR3CY5zY5lK2BVCe0K0UMbBiY5QCiCICp/mWk7y30D6AMSBFWXuGVisWpxF0JAvQF8iXwz1NwY4ltMe9LlNElXnrWAk4QVQDd1vKxAf9sShgpgw3VRhIBfJj7cP5aJUDZwe4ogBXQAFk/L/HTkzKt11Mw5HOz6WEEjtLF2dL38sTRsSFsD5KkwP49DjAc67f3Xw5B/ABupQEu4CVg1LH+bsK+M4B6G+55CLD+fgV/bTYQVR01KBdTlcOdptBq63fU8IEyeBHrjxABuQKUFRQQCSjw/Ufi+yXpI0CCvwzkq9NbUG11ZxaJqhcF3OkEYkif1xiy+ufh8AEk/F9G+B9BiIhQILLcqOjTyL4C6050cSuHqTJahUBs30sEtU2hp+VgZuzK
// maskImage.crossOrigin = "Anonymous";
var mousePos = [0, 0];
var raycaster = new THREE.Raycaster();
var mouse = new THREE.Vector2();
if(mobileAndTabletcheck()){
window.addEventListener('touchmove', function(e){
mouse.x = ( e.touches[0].clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( e.touches[0].clientY / window.innerHeight ) * 2 + 1;
});
} else {
window.addEventListener('mousemove', function(e){
mouse.x = ( e.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( e.clientY / window.innerHeight ) * 2 + 1;
});
}
function renderRay() {
raycaster.setFromCamera( mouse, camera );
var intersects = raycaster.intersectObjects( scene.children );
for ( var i = 0; i < intersects.length; i++ ) {
mousePos[0] = (((intersects[i].point.x / planeSize)+ 0.5) * w) - (radius*0.5);
mousePos[1] = ((((intersects[i].point.y * -1) / planeSize)+ 0.5) * h) - (radius*0.5);
}
}
function draw(){
ctx.clearRect(0, 0, w, h);
ctx.drawImage(maskImage, mousePos[0], mousePos[1], radius, radius);
renderRay();
}
var frustumSize = 600;
var aspect = window.innerWidth / window.innerHeight;
var clock = new THREE.Clock(true);
var scene = new THREE.Scene();
camera = new THREE.OrthographicCamera( frustumSize * aspect / - 2, frustumSize * aspect / 2, frustumSize / 2, frustumSize / - 2, 1, 2000 );
camera.lookAt(scene.position);
camera.position.z = 1;
var renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: true
});
renderer.setPixelRatio = 1;
renderer.setClearColor(0x3A405A, 1.0);
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
function onWindowResize(){
var aspect = window.innerWidth / window.innerHeight;
camera.left = - frustumSize * aspect / 2;
camera.right = frustumSize * aspect / 2;
camera.top = frustumSize / 2;
camera.bottom = - frustumSize / 2;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
var gui = new dat.GUI();
var params = {
dispFactor: 0.238,
speed: 24.0,
};
gui.add(params, 'dispFactor', 0, 1).step(0.001).onChange(function( value ) {
object.material.uniforms._dispFactor.value = value;
object.material.uniforms._dispFactor.needsUpdate = true;
});
gui.add(params, 'speed', 1, 50).step(1).onChange(function( value ) {
object.material.uniforms._speed.value = value;
object.material.uniforms._speed.needsUpdate = true;
});
// var controls = new THREE.OrbitControls( camera, renderer.domElement );
var loader = new THREE.TextureLoader();
loader.crossOrigin = '';
var circle = loader.load('data:image/png;base64,i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29sdXRpb24+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+NjU1MzU8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjEwMjQ8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MTAyNDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA
var circle_blur = loader.load('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB/HSuDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPS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.wrapS = dist.wrapT = THREE.RepeatWrapping;
color.wrapS = color.wrapT = THREE.RepeatWrapping;
var mask = new THREE.Texture(canvas);
mask.minFilter = THREE.LinearFilter;
var mat = new THREE.ShaderMaterial({
uniforms: {
_time: { type: "f", value: 1.0 },
_mask: { type: 't', value: mask },
_color: { type: 't', value: color },
_circle: { type: 't', value: circle },
_circle_blur: { type: 't', value: circle_blur },
_dist: { type: 't', value: dist },
_dispFactor: { type: "f", value: params.dispFactor },
_speed: { type: "f", value: params.speed }
},
vertexShader: document.getElementById( 'vertexShader' ).textContent,
fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
transparent: true,
opacity: 1.0,
blending: THREE.AdditiveBlending
});
var geometry = new THREE.PlaneBufferGeometry( planeSize, planeSize, 1 );
var object = new THREE.Mesh(geometry, mat);
scene.add(object);
window.addEventListener('click', function(){
});
var animate = function () {
requestAnimationFrame( animate );
renderer.render(scene, camera);
var d = clock.getDelta();
mat.uniforms._time.value += d;
mask.needsUpdate = true;
draw();
};
animate();