{% if not editmode and not pimcore_device().isPhone() %}
{% do pimcore_head_script().appendFile(asset('/build/js/tsparticles.min.js')) %}
<style>
{% if not editmode %}
#tsparticles{{randomId}} {
position: fixed;
top: 0;
width: 28vw;
height: 100vh;
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 50%;
z-index: -1;
padding-left: 0px;
}
#tsparticles{{randomId}}:before {
content: "";
background: black;
width: 100%;
height: 100%;
display: block;
top: -100%;
position: absolute;
}
{% endif %}
</style>
<script>
ready(() => {
const overlayElem = document.createElement("div");
overlayElem.id = "tsparticlesOverlay";
const tsparticlesContainer = document.getElementById('tsparticles{{randomId}}');
tsparticlesContainer.prepend(overlayElem);
const dnaContainer = document.querySelector('.dna-container');
if (dnaContainer) {
const dnaHeight = dnaContainer.clientHeight;
const scrollIncrement = dnaHeight/100;
window.addEventListener('scroll', () => {
overlayElem.style.transform = "translate3d(0px, " + Math.round(Math.max(window.scrollY/scrollIncrement, 0)) + "%, 0px)";
});
}
tsParticles.load("tsparticles{{randomId}}", {
autoPlay: true,
{% if not editmode %}
background: {
image: "linear-gradient(0deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(234,0,42,0.5) 52%)",
attachment: "fixed",
repeat: "no-repeat",
size: "100% 100vh",
opacity: 1
},
backgroundMask: {
composite: "destination-out",
{% if not editmode %}
cover: { color: { value: { r: 0, g: 0, b: 0 } }, opacity: 1 },
{% endif %}
enable: true
},
{% endif %}
backgroundMode: { enable: false, zIndex: -1 },
detectRetina: true,
fpsLimit: 30,
interactivity: {
detectsOn: "window",
events: {
onClick: { enable: true, mode: "push" },
onHover: {
enable: true,
mode: "bubble",
parallax: { enable: false, force: 60, smooth: 10 }
},
resize: true
},
modes: {
bubble: { distance: 220, duration: 2, opacity: 1, size: 20 },
push: { quantity: 1 },
}
},
motion: { disable: false, reduce: { factor: 10, value: true } },
particles: {
color: {
value: "#ffffff",
animation: { enable: false, speed: 1, sync: true }
},
links: {
blink: false,
{% if pimcore_checkbox('netAnimationWhite').isChecked() and not editmode %}
color: { value: "#EA002A" },
{% else %}
color: { value: "#ffffff" },
{% endif %}
consent: false,
distance: 150,
enable: true,
frequency: 1,
opacity: 1,
shadow: { blur: 5, color: { value: "#00ff00" }, enable: false },
triangles: { enable: false, frequency: 1 },
width: 1,
warp: false
},
move: {
angle: { offset: 45, value: 90 },
attract: { enable: false, rotate: { x: 600, y: 1200 } },
direction: "none",
distance: 0,
enable: true,
outModes: {
default: "bounce",
bottom: "bounce",
left: "bounce",
right: "bounce",
top: "bounce"
},
random: true,
size: false,
speed: 0.6,
straight: false,
trail: { enable: false, length: 10, fillColor: { value: "#000000" } },
vibrate: false,
warp: false
},
number: {
density: { enable: true, area: 800, factor: 1000 },
limit: 0,
value: 57
},
shape: {
options: {
image: {
src:
"/build/img/super.svg",
width: 100,
height: 100
},
},
type: "image"
},
size: {
random: { enable: true, minimumValue: 6 },
value: 10,
},
},
pauseOnBlur: true,
pauseOnOutsideViewport: true,
});
});
</script>
{% endif %}