Move vanta-js to separate partial to avoid duplication

This commit is contained in:
Bea 2020-11-04 23:38:08 +01:00
parent a39c83793e
commit f08c70ca67
4 changed files with 25 additions and 62 deletions

View File

@ -20,23 +20,4 @@
</main> </main>
{{!-- Vanta.JS Scripts to make the background cool, but disabled on mobile --}} {{!-- Vanta.JS Scripts to make the background cool, but disabled on mobile --}}
<script> {{> "vanta-js"}}
if(window.screen.width > 800)
{
document.write('<script src="{{asset "js/three.r95.min.js"}}"><\/script>' +
'<script src="{{asset "js/vanta.net.min.js"}}"><\/script>' +
'<script>' +
'VANTA.NET({'+
'el: "#vantajs",'+
'color: 0x3fd5ff,'+
'backgroundColor: 0x190f2b,'+
'mouseControls: true,'+
'touchControls: true,'+
'minHeight: 200.00,'+
'minWidth: 200.00,'+
'scale: 1.00,'+
'scaleMobile: 1.00'+
'})'+
'<\/script>');
}
</script>

View File

@ -20,23 +20,4 @@
</main> </main>
{{!-- Vanta.JS Scripts to make the background cool, but disabled on mobile --}} {{!-- Vanta.JS Scripts to make the background cool, but disabled on mobile --}}
<script> {{> "vanta-js"}}
if(window.screen.width > 800)
{
document.write('<script src="{{asset "js/three.r95.min.js"}}"><\/script>' +
'<script src="{{asset "js/vanta.net.min.js"}}"><\/script>' +
'<script>' +
'VANTA.NET({'+
'el: "#vantajs",'+
'color: 0x3fd5ff,'+
'backgroundColor: 0x190f2b,'+
'mouseControls: true,'+
'touchControls: true,'+
'minHeight: 200.00,'+
'minWidth: 200.00,'+
'scale: 1.00,'+
'scaleMobile: 1.00'+
'})'+
'<\/script>');
}
</script>

20
partials/vanta-js.hbs Normal file
View File

@ -0,0 +1,20 @@
<script>
if(window.screen.width > 800)
{
document.write('<script src="{{asset "js/three.r95.min.js"}}"><\/script>' +
'<script src="{{asset "js/vanta.net.min.js"}}"><\/script>' +
'<script>' +
'VANTA.NET({'+
'el: "#vantajs",'+
'color: 0x3fd5ff,'+
'backgroundColor: 0x190f2b,'+
'mouseControls: true,'+
'touchControls: true,'+
'minHeight: 200.00,'+
'minWidth: 200.00,'+
'scale: 1.00,'+
'scaleMobile: 1.00'+
'})'+
'<\/script>');
}
</script>

21
tag.hbs
View File

@ -31,23 +31,4 @@
</main> </main>
{{!-- Vanta.JS Scripts to make the background cool, but disabled on mobile --}} {{!-- Vanta.JS Scripts to make the background cool, but disabled on mobile --}}
<script> {{> "vanta-js"}}
if(window.screen.width > 800)
{
document.write('<script src="{{asset "js/three.r95.min.js"}}"><\/script>' +
'<script src="{{asset "js/vanta.net.min.js"}}"><\/script>' +
'<script>' +
'VANTA.NET({'+
'el: "#vantajs",'+
'color: 0x3fd5ff,'+
'backgroundColor: 0x190f2b,'+
'mouseControls: true,'+
'touchControls: true,'+
'minHeight: 200.00,'+
'minWidth: 200.00,'+
'scale: 1.00,'+
'scaleMobile: 1.00'+
'})'+
'<\/script>');
}
</script>