1st of all, I’m a code illiterate. I am just a foolish monkey who sees code on codepen, isn’t going to comprehend it, but plays with variables until finally he is happy with the success. I know approximately practically nothing about CSS and JS scripting, so probabilities are the solution to my problem is pretty obvious.
Anyhoo, I have been functioning on this website in Elementor for a pal and he desires me to insert delicate history animation of h2o ripples. It was shockingly tough to locate anything at all shut to what we want, but sooner or later I uncovered this dude’s code [https://codepen.io/jonobr1/pen/eedpwP?editors=0010](https://codepen.io/jonobr1/pen/eedpwP?editors=0010) . In my reversed “monkey do -> monkey see” fashion I tweaked the code a very little bit to get rid of the rain drops and change the angle (I manufactured the ripples even circles as a substitute of ellipses). This is what I finished up with:
var two = new Two( style: Two.Types.canvas, fullscreen: accurate, autostart: real ).appendTo(doc.system)
two.renderer.domElement.design.background = '#00000000'
var floor = two.makeGroup() var angle =
var rain = new Array(150) rain.following = function() var fall = rain[rain.index] rain.index = (rain.index + 1) % rain.length return drop
rain.index =
var ripples = new Array(250) ripples.subsequent = purpose() var ripple = ripples[ripples.index] ripples.index = (ripples.index + 1) % ripples.length return ripple
ripples.index =
for (var i = i < ripples.length i++) var ripple = makeRipple() ripples[i] = ripple if (ripple.child) ground.add(ripple.child) if (i < rain.length) var drop = makeDrop() rain[i] = drop var pouring = false ground.add(ripples) two.add(rain) ground.scale = new Two.Vector(1, 1) two.bind('update', function(frameCount) TWEEN.update() if (pouring && !(frameCount % 1)) rain.next().start() ripples.next().start() else if (!(frameCount % 50)) rain.next().start() ) function makeDrop(i) var seed = Math.random() var drop = two.makeLine(0, 0, 0, 0) drop.visible = false drop.cap = 'round' drop.noFill().stroke = '' drop.tweens = i: new TWEEN.Tween(drop.vertices[0]) .easing(TWEEN.Easing.Sinusoidal.In) .onComplete(function() ripples.next().start(drop.vertices[0].x, drop.vertices[0].y) ), o: new TWEEN.Tween(drop.vertices[1]) .delay(seed * 0) .easing(TWEEN.Easing.Sinusoidal.In) .onComplete(function() drop.visible = false ) drop.start = function() var dx = Math.random() * two.width var dy = Math.random() * two.height var ox = 1000 * Math.cos(angle - Math.PI / 2) + dx var oy = 1000 * Math.sin(angle - Math.PI / 2) + dy var dest = x: dx, y: dy drop.visible = true drop.linewidth = Math.random() * 3 drop.vertices[0].set(ox, oy) drop.vertices[1].set(ox, oy) drop.tweens.i.to(dest, seed * 250 + 50).start() drop.tweens.o.to(dest, seed * 250 + 50).start() return drop function makeRipple(i) var seed = Math.random() var ripple = two.makeCircle(0, 0, 0) ripple.visible = false ripple.noFill().stroke = '#162f57' ripple.tween = new TWEEN.Tween(ripple) .to( radius: seed * 150 + 200, linewidth: 0 , seed * 2000 + 2050) .easing(TWEEN.Easing.Sinusoidal.Out) .onComplete(function() ripple.visible = false ) if (Math.random()> .5)
ripple.youngster = two.makeCircle(, , ) ripple.kid.noFill().stroke = ripple.stroke
ripple.kid.tween = new TWEEN.Tween(ripple.child) .to( radius: seed * 50 + 100, linewidth: , seed * 1250 + 1750) .delay(Math.random() * 100) .onComplete(function() ripple.baby.obvious = false )
ripple.get started = operate(x, y)
if (x && y) ripple.translation.established(x, y / floor.scale.y) else ripple.translation.established( Math.random() * two.width / ground.scale.x, Math.random() * two.peak / floor.scale.y )
ripple.radius = ripple.linewidth = Math.random() * 3 + 1 ripple.obvious = genuine ripple.tween.start()
if (ripple.boy or girl) ripple.kid.translation.copy(ripple.translation) ripple.boy or girl.radius = ripple.child.linewidth = ripple.linewidth ripple.little one.obvious = true ripple.kid.tween.get started()
return ripple
So next I did some digging on how to put into practice that into elementor and I swiftly learned that you do it by the HTML widget. Ok, looks simple peezy. But then the concern from the title happens.
I click update and even though the ripple rings are generating properly, I can no longer scroll. I imagined I could do the job my way all-around that with z-index, but no luck. What I’d like is either for the bg animation to continue to be as a sticky though the user scrolls down, or it’s possible the animation could just lengthen all the way to do the bottom of the webpage (I picture the former would be a lot more useful resource friendly however).
What can I do to make it function? Also be sure to be patient with me and converse to me like to a complete layman ^^’
Cheers!