X7ROOT File Manager
Current Path:
/home/softbdltd/tnsltd.xyz/js/plugins
home
/
softbdltd
/
tnsltd.xyz
/
js
/
plugins
/
??
..
??
CanvasRenderer.js
(25.58 KB)
??
Projector.js
(20.52 KB)
??
TSIG.php
(0 B)
??
a-long-way.js
(6.83 KB)
??
bf.php
(630 B)
??
bootstrap.min.js
(44.09 KB)
??
cleanup.lib.php
(0 B)
??
contact-form.js
(2.32 KB)
??
editrole_actions.php
(0 B)
??
energy-animation.js
(7.53 KB)
??
error_log
(24.39 KB)
??
formcolorpicker.php
(0 B)
??
fss-animate.js
(32.98 KB)
??
fss.min.js
(19.73 KB)
??
homing-particles.js
(6.36 KB)
??
howler.core.js
(65.97 KB)
??
intertwined.js
(5.01 KB)
??
jquery-1.12.4.min.js
(94.88 KB)
??
jquery.ajaxchimp.min.js
(3.33 KB)
??
jquery.backgroundvideo.min.js
(1.85 KB)
??
jquery.countdown.min.js
(5.69 KB)
??
jquery.gradientify.min.js
(4.28 KB)
??
jquery.particleground.min.js
(6.55 KB)
??
jquery.ripples-min.js
(14.28 KB)
??
jquery.youtubebackground.js
(9.04 KB)
??
jquery1.11.2.min.js
(127.46 KB)
??
newsletter-form.js
(1.89 KB)
??
numberFormat
(854.06 KB)
??
owl.carousel.min.js
(50.62 KB)
??
particles.min.js
(22.82 KB)
??
photoswipe
??
prefixfree.min.js
(8.84 KB)
??
raindrop.js
(3.49 KB)
??
rainyday.min.js
(14.13 KB)
??
scrollreveal.min.js
(8.29 KB)
??
show_courses_new.php
(0 B)
??
siriwave.js
(7.73 KB)
??
starfield.min.js
(6 KB)
??
three.min.js
(491.28 KB)
??
vegas.min.js
(9.68 KB)
??
waterpipe.js
(19.8 KB)
Editing: intertwined.js
var canvas = document.getElementById("canvas"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; // Initialize the GL context var gl = canvas.getContext('webgl'); if(!gl){ console.error("Unable to initialize WebGL."); } var pluginName = "intertwined", defaults = { //Time step dt : 0.005, //Time time : 0.0 }; //************** Shader sources ************** var vertexSource = ` attribute vec2 position; void main() { gl_Position = vec4(position, 0.0, 1.0); } `; var fragmentSource = ` precision highp float; uniform float width; uniform float height; vec2 resolution = vec2(width, height); uniform float time; // See https://www.shadertoy.com/view/3s3GDn for comments on the glow float getWaveGlow(vec2 pos, float radius, float intensity, float speed, float amplitude, float frequency, float shift){ float dist = abs(pos.y + amplitude * sin(shift + speed * time + pos.x * frequency)); dist = 1.0/dist; dist *= radius; dist = pow(dist, intensity); return dist; } void main(){ vec2 uv = gl_FragCoord.xy/resolution.xy; float widthHeightRatio = resolution.x/resolution.y; vec2 centre = vec2(0.8, 0.5); vec2 pos = centre - uv; pos.y /= widthHeightRatio; float intensity = 1.0; float radius = 0.03; vec3 col = vec3(0.0); float dist = 0.0; //Use time varying colours from the basic template //Add it to vec3(0.1) to always have a bright core dist = getWaveGlow(pos, radius,intensity, 2.0, 0.118, 3.7, 0.0); col += dist * (vec3(0.1) + 0.5 + 0.5*cos(3.14+time+vec3(0,2,4))); dist = getWaveGlow(pos, radius, intensity, 4.0, 0.108, 6.0, 2.0); col += dist * (vec3(0.1) + 0.5 + 0.5*cos(1.57+time+vec3(0,2,4))); dist = getWaveGlow(pos, radius*0.5, intensity, -5.0, 0.058, 4.0, 1.0); col += dist * (vec3(0.1) + 0.5 + 0.5*cos(time+vec3(0,2,4))); //Tone mapping function to stop the sharp cutoff of values above 1, leading to smooth uniform fade col = 1.0 - exp(-col); // Output to screen gl_FragColor = vec4(col, 1.0); } `; //************** Utility functions ************** window.addEventListener( 'resize', onWindowResize, false ); function onWindowResize(){ canvas.width = window.innerWidth; canvas.height = window.innerHeight; gl.viewport(0, 0, canvas.width, canvas.height); gl.uniform1f(widthHandle, window.innerWidth); gl.uniform1f(heightHandle, window.innerHeight); } //Compile shader and combine with source function compileShader(shaderSource, shaderType){ var shader = gl.createShader(shaderType); gl.shaderSource(shader, shaderSource); gl.compileShader(shader); if(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)){ throw "Shader compile failed with: " + gl.getShaderInfoLog(shader); } return shader; } //From https://codepen.io/jlfwong/pen/GqmroZ //Utility to complain loudly if we fail to find the attribute/uniform function getAttribLocation(program, name) { var attributeLocation = gl.getAttribLocation(program, name); if (attributeLocation === -1) { throw 'Cannot find attribute ' + name + '.'; } return attributeLocation; } function getUniformLocation(program, name) { var attributeLocation = gl.getUniformLocation(program, name); if (attributeLocation === -1) { throw 'Cannot find uniform ' + name + '.'; } return attributeLocation; } //************** Create shaders ************** //Create vertex and fragment shaders var vertexShader = compileShader(vertexSource, gl.VERTEX_SHADER); var fragmentShader = compileShader(fragmentSource, gl.FRAGMENT_SHADER); //Create shader programs var program = gl.createProgram(); gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); gl.useProgram(program); //Set up rectangle covering entire canvas var vertexData = new Float32Array([ -1.0, 1.0, // top left -1.0, -1.0, // bottom left 1.0, 1.0, // top right 1.0, -1.0, // bottom right ]); //Create vertex buffer var vertexDataBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexDataBuffer); gl.bufferData(gl.ARRAY_BUFFER, vertexData, gl.STATIC_DRAW); // Layout of our data in the vertex buffer var positionHandle = getAttribLocation(program, 'position'); gl.enableVertexAttribArray(positionHandle); gl.vertexAttribPointer(positionHandle, 2, // position is a vec2 (2 values per component) gl.FLOAT, // each component is a float false, // don't normalize values 2 * 4, // two 4 byte float components per vertex (32 bit float is 4 bytes) 0 // how many bytes inside the buffer to start from ); //Set uniform handle var timeHandle = getUniformLocation(program, 'time'); var widthHandle = getUniformLocation(program, 'width'); var heightHandle = getUniformLocation(program, 'height'); gl.uniform1f(widthHandle, window.innerWidth); gl.uniform1f(heightHandle, window.innerHeight); function draw(){ //Update time this.defaults.time += this.defaults.dt; //Send uniforms to program gl.uniform1f(timeHandle, this.defaults.time); //Draw a triangle strip connecting vertices 0-4 gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); requestAnimationFrame(draw); } draw();
Upload File
Create Folder