let conv = [ { "when": "8 hours ago", "who": "Paulo", "from": "Brazil", "what": "Relaxing Background Images", },{ "when": "14 hours ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "25 hours ago", "who": "D.A.", "from": "United Kingdom", "what": "ZENmix Divine Vibrations Royalty-Free Pack", },{ "when": "44 hours ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "47 hours ago", "who": "Jahwan", "from": "South Korea", "what": "ZENmix Creator Export Credits Small", },{ "when": "2 days ago", "who": "Mareike", "from": "Germany", "what": "ZENmix EMDR Music Royalty-Free Pack", },{ "when": "2 days ago", "who": "", "from": "United States", "what": "ZENmix Meditation Music Royalty-Free Secret MEGA Pack", },{ "when": "2 days ago", "who": "", "from": "United States", "what": "ZENmix Meditation Music Royalty-Free MEGA Pack Bundle", },{ "when": "1 days ago", "who": "Jamal", "from": "United Kingdom", "what": "ZENmix Garden of Tranquility song", },{ "when": "1 days ago", "who": "Angela", "from": "Switzerland", "what": "ZENmix Meditation Music Royalty-Free Secret MEGA Pack", },{ "when": "1 days ago", "who": "Angela", "from": "Switzerland", "what": "ZENmix Meditation Music Royalty-Free MEGA Pack Bundle", },{ "when": "1 days ago", "who": "Yuko", "from": "Canada", "what": "ZENmix Chakra Music Royalty-Free Pack", },{ "when": "1 days ago", "who": "Kevin", "from": "Germany", "what": "ZENmix Garden of Tranquility song", },{ "when": "1 days ago", "who": "Mark", "from": "United States", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "1 days ago", "who": "Mark", "from": "United States", "what": "ZENmix Garden of Tranquility song", },{ "when": "1 days ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "1 days ago", "who": "Kevin", "from": "Germany", "what": "ZENmix Meditation Music Royalty-Free Secret MEGA Pack", },{ "when": "1 days ago", "who": "Kevin", "from": "Germany", "what": "ZENmix Serenity in Motion Royalty-Free Pack", },{ "when": "1 days ago", "who": "Jamal", "from": "United Kingdom", "what": "ZENmix Serenity in Motion Royalty-Free Pack", },{ "when": "1 days ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "1 days ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "1 days ago", "who": "robert", "from": "United Kingdom", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "1 days ago", "who": "Mark", "from": "United States", "what": "ZENmix Heavenly Dreams Song", },{ "when": "1 days ago", "who": "Spenser", "from": "Canada", "what": "ZENmix Meditation Music Royalty-Free MEGA Pack Bundle", },{ "when": "1 days ago", "who": "Sarah", "from": "Germany", "what": "ZENmix Chakra Music Royalty-Free Pack", },{ "when": "1 days ago", "who": "Sarah", "from": "Germany", "what": "ZENmix Buy 5, Get 1 Free Royalty-Free Bundle", },{ "when": "1 days ago", "who": "Sarah", "from": "Germany", "what": "ZENmix Hidden Gem Royalty-Free Pack", },{ "when": "1 days ago", "who": "Sarah", "from": "Germany", "what": "ZENmix Meditation Music Royalty-Free Secret MEGA Pack", },{ "when": "1 days ago", "who": "Sarah", "from": "Germany", "what": "ZENmix Buy 5, Get 1 Free Royalty-Free Bundle", },{ "when": "1 days ago", "who": "Lee-Anne", "from": "United Kingdom", "what": "ZENmix Breathe Music Royalty-Free Pack", },{ "when": "1 days ago", "who": "Tina", "from": "United States", "what": "ZENmix Hidden Gem Royalty-Free Pack", },{ "when": "1 days ago", "who": "Tina", "from": "United States", "what": "ZENmix Flow and Let Go Music Royalty-Free Pack", },{ "when": "1 days ago", "who": "Sarah", "from": "Germany", "what": "ZENmix Meditation Music Royalty-Free MEGA Pack Bundle", },{ "when": "1 days ago", "who": "Mark", "from": "United States", "what": "ZENmix Serenity in Motion Royalty-Free Pack", },{ "when": "1 days ago", "who": "Anna", "from": "United States", "what": "ZENmix Divine Vibrations Royalty-Free Pack", },{ "when": "1 days ago", "who": "Lena", "from": "United States", "what": "ZENmix Serenity in Motion Royalty-Free Pack", },{ "when": "1 days ago", "who": "Linda", "from": "United States", "what": "ZENmix Serenity in Motion Royalty-Free Pack", },{ "when": "1 days ago", "who": "Holly", "from": "United States", "what": "ZENmix Pure Tones Convenience Bundle", },{ "when": "1 days ago", "who": "Holly", "from": "United States", "what": "ZENmix Pure Angel Frequencies Convenience Pack", },{ "when": "1 days ago", "who": "", "from": "Canada", "what": "Unlock Your Potential - Motivation Music", },{ "when": "1 days ago", "who": "Felix", "from": "Switzerland", "what": "ZENmix Binaural Beats Convenience Pack", },{ "when": "2 days ago", "who": "Chantelle", "from": "United States", "what": "ZENmix Buy 5, Get 1 Free Royalty-Free Bundle", },{ "when": "2 days ago", "who": "KO", "from": "South Korea", "what": "ZENmix Lucid Dreaming Music Royalty-Free Pack", },{ "when": "2 days ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "2 days ago", "who": "Tina", "from": "United States", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "2 days ago", "who": "Ralph", "from": "United States", "what": "ZENmix Pure Angel Frequencies Convenience Pack", },{ "when": "2 days ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "2 days ago", "who": "Jacqueline", "from": "Malaysia", "what": "ZENmix Hidden Gem Royalty-Free Pack", },{ "when": "2 days ago", "who": "Jacqueline", "from": "Malaysia", "what": "ZENmix Sleep Melodies Royalty-Free Pack", },{ "when": "2 days ago", "who": "Neil", "from": "Australia", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "2 days ago", "who": "Shawna", "from": "United States", "what": "ZENmix Meditation Music Royalty-Free MEGA Pack Bundle", },{ "when": "2 days ago", "who": "Someone", "from": "United States", "what": "ZENmix Creator Monthly", },{ "when": "2 days ago", "who": "robert", "from": "United Kingdom", "what": "ZENmix Divine Vibrations Royalty-Free Pack", },{ "when": "2 days ago", "who": "Therese", "from": "United States", "what": "ZENmix Creator Export Credits Small", },{ "when": "2 days ago", "who": "Craig", "from": "Vietnam", "what": "ZENmix Heavenly Dreams Song", },{ "when": "2 days ago", "who": "Craig", "from": "Philippines", "what": "ZENmix Garden of Tranquility song", },{ "when": "2 days ago", "who": "Craig", "from": "Australia", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "2 days ago", "who": "Tina", "from": "United States", "what": "ZENmix Lucid Dreaming Music Royalty-Free Pack", },{ "when": "2 days ago", "who": "Tina", "from": "United States", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "2 days ago", "who": "Tina", "from": "United States", "what": "Reiki 3 Minute Timer Music - 26x 3 Minute Bells", },{ "when": "2 days ago", "who": "hajun", "from": "South Korea", "what": "ZENmix Garden of Tranquility song", },{ "when": "2 days ago", "who": "Neil", "from": "Australia", "what": "ZENmix Meditation Music Royalty-Free Secret MEGA Pack", },{ "when": "2 days ago", "who": "Neil", "from": "Australia", "what": "ZENmix Lucid Dreaming Music Royalty-Free Pack", },{ "when": "2 days ago", "who": "Natália", "from": "Czech Republic", "what": "ZENmix Creator Export Credits Small", }, ] let convIndex = 0 let widget = `

${conv[0].who} from ${conv[0].from}

bought ${conv[0].what} recently

${conv[0].when}

` let css = ` .conversion-widget { font-family: Helvetica, sans-serif; font-size: 14px; display: flex; background-color: white; border: 1px solid #eee; border-radius: 12px; box-shadow: 0 4px 12px rgba(120, 120, 120, 0.3); color: #4a4a4a; padding: 10px; z-index: 99; flex-direction: row; } .conversion-widget img { display: flex; height: 70px; width: 70px; } #conversion-widget-right { width: 100%; } .conversion-widget .conversion-brand a { display: flex; color: #51c2d5; text-decoration: none; } .conversion-widget .conversion-brand { display: flex; justify-content: flex-end; align-items: center; font-size: 12px; margin: 0 18px; } .conversion-widget .conversion-brand svg{ display: flex; height: 25px; width: 25px; } .conversion-widget.conversion-widget-bottom-right { position: fixed; bottom: 10px; right: 10px; } .conversion-widget.conversion-widget-bottom-left { position: fixed; top: 0px; left: 0px; width: 100%; } .conversion-widget #conversion-head span { font-size: 15px; font-weight: bold; color: #222222; text-align: left; padding: 0; } .conversion-widget p { margin: 2px 8px !important; } #conversion-when { color: rgb(187, 187, 187); } @media only screen and (min-width: 700px) { .conversion-widget.conversion-widget-bottom-left { position: fixed; top: auto; bottom: 10px; left: 10px; width: auto; } } .conversion-fade-in { animation: conversion-fadeIn ease 2s forwards; -webkit-animation: conversion-fadeIn ease 2s forwards; -moz-animation: conversion-fadeIn ease 2s forwards; -o-animation: conversion-fadeIn ease 2s forwards; -ms-animation: conversion-fadeIn ease 2s forwards; } @keyframes conversion-fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-moz-keyframes conversion-fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-webkit-keyframes conversion-fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-o-keyframes conversion-fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-ms-keyframes conversion-fadeIn { 0% {opacity:0;} 100% {opacity:1;} } .conversion-fade-out { animation: conversion-fadeOut ease 2s forwards; -webkit-animation: conversion-fadeOut ease 2s forwards; -moz-animation: conversion-fadeOut ease 2s forwards; -o-animation: conversion-fadeOut ease 2s forwards; -ms-animation: conversion-fadeOut ease 2s forwards; } @keyframes conversion-fadeOut { 0% {opacity:1;} 100% {opacity:0;} } @-moz-keyframes conversion-fadeOut { 0% {opacity:1;} 100% {opacity:0;} } @-webkit-keyframes conversion-fadeOut { 0% {opacity:1;} 100% {opacity:0;} } @-o-keyframes conversion-fadeOut { 0% {opacity:1;} 100% {opacity:0;} } @-ms-keyframes conversion-fadeOut { 0% {opacity:1;} 100% {opacity:0;} } ` function triggerHide() { setTimeout(function(){ document.getElementById("conversion-widget").classList.add("conversion-fade-out") document.getElementById("conversion-widget").classList.remove("conversion-fade-in") triggerNext() }, 6000); } function triggerNext() { setTimeout(function(){ convIndex++ if (convIndex >= conv.length) { convIndex =0 } document.getElementById("conversion-who").innerHTML = `${conv[convIndex].who}` document.getElementById("conversion-from").innerHTML = `${conv[convIndex].from}` document.getElementById("conversion-when").innerHTML = conv[convIndex].when document.getElementById("conversion-what").innerHTML = conv[convIndex].what document.getElementById("conversion-widget").classList.add("conversion-fade-in") document.getElementById("conversion-widget").classList.remove("conversion-fade-out") triggerHide() }, 6000); } setTimeout(function(){ let style = document.createElement('style'); style.innerHTML = css var head = document.getElementsByTagName("head")[0] head.append(style) let body = document.getElementsByTagName("body")[0] body.insertAdjacentHTML('beforeend', widget); document.getElementById("conversion-widget").classList.add("conversion-fade-in") triggerHide() }, 5000);