var vantaTypes = { "BIRDS": function(opts) { VANTA.BIRDS(opts) }, "CELLS": function(opts) { opts.color1 = opts.color; opts.color2 = opts.backgroundColor; VANTA.CELLS(opts) }, "DOTS": function(opts) { VANTA.DOTS(opts) }, "FOG": function(opts) { opts.highlightColor = opts.color; opts.midtoneColor = 0x7800ff; opts.lowlightColor = 0x110664; opts.baseColor = opts.backgroundColor; VANTA.FOG(opts) }, "GLOBE": function(opts) { VANTA.GLOBE(opts) }, "HALO": function(opts) { VANTA.HALO(opts) }, "NET": function(opts) { opts.points = 10.00; opts.maxDistance = 20.00; opts.spacing = 18.00; VANTA.NET(opts) }, "RINGS": function(opts) { VANTA.RINGS(opts) }, "TOPOLOGY": function(opts) { VANTA.TOPOLOGY(opts) }, "TRUNK": function(opts) { VANTA.TRUNK(opts) }, "WAVES": function(opts) { opts.color = opts.backgroundColor; VANTA.WAVES(opts) }, } var messages = [ "We're cooking something up!", "Stay tuned!", "Patience, my friend.", "What if...", "soon™" ] vantaType = Object.keys(vantaTypes)[Math.floor(Math.random()*Object.keys(vantaTypes).length)]; console.log(vantaType); vantaTypes[vantaType]({ //vantaTypes["FOG"]({ el: "#vanta-target", mouseControls: true, touchControls: true, gyroControls: false, minHeight: 200.00, minWidth: 200.00, scale: 1.00, scaleMobile: 1.00, color: 0xffa3a3, backgroundColor: 0x110664 }) $(document).ready(function() { document.getElementById('message').innerHTML = messages[Math.floor(Math.random()*messages.length)]; });