Sure thing.
This is all placed in "Custom <head> content":
<meta property="og:image" content="http://www.re-form.dk/wp-content/uploads/2017/10/FB--cover--02.png" />
<script src="http://re-form.dk/blotter/js/blotter.min.js"></script>
<script src="http://re-form.dk/blotter/js/materials/liquidDistortMaterial.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<script>
window.laytheme.on("newpageshown", function(layoutObj, type, obj){
if(type == "page" && obj.id == 582) {
const createBlotterGeneratorText = () => {
// Define text style
const text = new Blotter.Text('RE', {
family: "'reform_mmxx-4', serif",
size: 500,
paddingLeft: 100,
paddingRight: 100
});
// Use a material
// https://blotter.js.org/#/materials
let material = new Blotter.LiquidDistortMaterial();
// Set material opts
material.uniforms.uSpeed.value = 0.2;
material.uniforms.uVolatility.value = 0.5;
material.uniforms.uSeed.value = 0.1;
let blotter = new Blotter(material, {
texts: text
});
// Apply to element
let scope = blotter.forText(text);
let elem = document.getElementById('blotter-container');
scope.appendTo(elem);
};
WebFont.load({
custom: {
families: ['reform_mmxx-4'],
urls: ['http://www.http://www.re-form.dk/wp-content/uploads/2020/02/reform_mmxx-4.woff']
},
active: () => createBlotterGeneratorText()
});
}
});
</script>
<script>
window.laytheme.on("newpageshown", function(layoutObj, type, obj){
if(type == "page" && obj.id == 576, 568) {
const body = document.body;
const docEl = document.documentElement;
const MathUtils = {
lineEq: (y2, y1, x2, x1, currentVal) => {
// y = mx + b
var m = (y2 - y1) / (x2 - x1), b = y1 - m * x1;
return m * currentVal + b;
},
lerp: (a, b, n) => (1 - n) * a + n * b,
distance: (x1, x2, y1, y2) => {
var a = x1 - x2;
var b = y1 - y2;
return Math.hypot(a,b);
}
};
let winsize;
const calcWinsize = () => winsize = {width: window.innerWidth, height: window.innerHeight};
calcWinsize();
window.addEventListener('resize', calcWinsize);
const getMousePos = (ev) => {
let posx = 0;
let posy = 0;
if (!ev) ev = window.event;
if (ev.pageX || ev.pageY) {
posx = ev.pageX;
posy = ev.pageY;
}
else if (ev.clientX || ev.clientY) {
posx = ev.clientX + body.scrollLeft + docEl.scrollLeft;
posy = ev.clientY + body.scrollTop + docEl.scrollTop;
}
return {x: posx, y: posy};
}
let mousePos = {x: winsize.width/2, y: winsize.height/2};
window.addEventListener('mousemove', ev => mousePos = getMousePos(ev));
const elem = document.querySelector('.content__text');
const textEl = elem.querySelector('span.content__text-inner');
const createBlotterText = () => {
const text = new Blotter.Text(textEl.innerHTML, {
family : "'reform_mmxx-3', serif",
weight: 500,
size: 500,
paddingLeft: 20,
paddingRight: 20,
paddingTop: 200,
paddingBottom: 20,
fill : 'black',
});
elem.removeChild(textEl);
const material = new Blotter.LiquidDistortMaterial();
material.uniforms.uSpeed.value = 1;
material.uniforms.uVolatility.value = 1;
material.uniforms.uSeed.value = 0.1;
const blotter = new Blotter(material, {texts: text});
const scope = blotter.forText(text);
scope.appendTo(elem);
let lastMousePosition = {x: winsize.width/2, y: winsize.height/2};
let volatility = 0;
const render = () => {
const docScrolls = {left : body.scrollLeft + docEl.scrollLeft, top : body.scrollTop + docEl.scrollTop};
const relmousepos = {x : mousePos.x - docScrolls.left, y : mousePos.y - docScrolls.top };
const mouseDistance = MathUtils.distance(lastMousePosition.x, relmousepos.x, lastMousePosition.y, relmousepos.y);
volatility = MathUtils.lerp(volatility, Math.min(MathUtils.lineEq(0.9, 0, 50, 0, mouseDistance),0.9), 0.05);
material.uniforms.uVolatility.value = volatility;
lastMousePosition = {x: relmousepos.x, y: relmousepos.y};
requestAnimationFrame(render);
}
requestAnimationFrame(render);
};
WebFont.load({
custom: {
families: ['reform_mmxx-3'],
urls: ['http://www.re-form.dk/wp-content/uploads/2019/12/reform_mmxx-3.woff']
},
active: () => createBlotterText()
});
}
});
</script>
Many thanks for your time and help!