CyberX

mobile

How to make simple scroll top jumper via RevolveR

So. This is a small tutorial how to create simple animated scroll to top button via RevolveR frontend library. Example you can see on this site when you scroll window. When scroll position takes 40% of Y axis the jumper are shown with animation.

Code below creates this scroll to top JavaScript animated button:


// charging weapons with namespace
const revolver = new Revolver('$');

$.dom('.jumper', 'del');

// jumper
$.dom('div',"new|after|body", {
	html: '<i  style="display: block;position: relative;top: 20px;color: #fff; font-size: 25px; text-shadow: -1px -1px 2px #000">^</i>', 
	attr: { 
		style: "width:60px; height:60px; text-align:center; display:block; position: fixed;bottom: 30px;right: 30px;background: rgba(0,0,0,.5);",
	class: "jumper"
		} 
	}
);

	$.event('.jumper', 'click', function(e) {

		e.preventDefault();

		$.scroll();

	});

	window.addEventListener('scroll', function(e) {

		if( $.curOffset[1] <= $.sizes[1] * 0.4 ) {

			$.dom('.jumper', 'animate', ['opacity:0:500'], function(e) {
				$.dom('.jumper i', 'animate', ['top:-50px:300:pulse'], function(e) {
					$.dom(".jumper", "style", ['display:none']);
				});
			});


		} 
		else {

			$.dom(".jumper", "style", ['display:block']);
			$.dom('.jumper', 'animate', ['opacity:.9:500'], function(e) {
				$.dom('.jumper i', 'animate', ['top:20px:300:pulse'], function(e) {});
			});
			
		}

	});

RevolveR DBX v1.1.2:: implement cache partitions

Yo. Today I release new version of RevolveR DBX engine thats supports for now cache segments based on static partitions in JSON format. You can configure how many chunks will be used to split static caches. If rows count are around 0-2000 per table you can adjust $sql_cache_segments value to zero. Also you can configure cache segments for 5 to default for many rows count.

DBX ABQ JSON Cache
DBX ABQ JSON Cache

Cache partitions updates automatically after every database change such as delete, insert, update, inject queries.

Now RevolveR DBX under testing and I need some time to update RevolveR CMS code.