Advertisement
jamescolin

Buildnroll go

Dec 25th, 2022 (edited)
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var configname = "Build 'n' roll";
  3. var configredirection = 0;
  4. var jamesredirected = false;
  5.  
  6. var configthumbnail = 'https://thisartworkdoesnotexist.com';
  7. var configdestination = 'https://3pdf.com';
  8. var configtitle = 'WELCOME TO MY CONTACTS LIST!';
  9. var configdescription = 'To receive your welcome gift, please enter your email address and press CONTINUE:';
  10.  
  11. configname = configname.trim();
  12.  
  13. const getJSON = async url => {
  14.   const response = await fetch(url);
  15.   return response.json();
  16. }
  17.  
  18. var jamesparams = (new URL(document.location)).searchParams;
  19. var jamesaction = 'default';
  20. var jamesactioninfo = '';
  21. var jamesorigin = window.location.origin;
  22. var jamesthumbnail = configthumbnail;
  23. var jamesdestination = configdestination;
  24. var jamestitle = configtitle;
  25. var jamesdescription = configdescription;
  26. var jamesredirection = '';
  27. if (jamesparams.get('r')!=null) {
  28.   jamesredirection = jamesparams.get('r');
  29. } else {
  30.   jamesredirection = configredirection;
  31. }
  32. var jamesemail = '';
  33. if (jamesparams.get('e')!=null) {
  34.   jamesemail = jamesparams.get('e');
  35. }
  36. if (jamesparams.get('reset')!=null) {
  37.   localStorage.clear();
  38. }
  39.  
  40. window.addEventListener('load', function () {
  41. if (jamesparams.get('v')!=null) {
  42.   jamesaction = 'video';
  43.   jamesthumbnail = 'https://i.ytimg.com/vi/'+jamesparams.get('v')+'/hqdefault.jpg';
  44.   jamesdestination = 'https://www.youtube.com/watch?v='+jamesparams.get('v');
  45.   getJSON('https://www.youtube.com/oembed?url=https%3A//youtube.com/watch%3Fv%3D'+jamesparams.get('v')+'&format=json').then(function(data){
  46.     jamestitle = "VIDEO: "+data.title;
  47.     jamesactioninfo = data.title;
  48.     jamesdescription = "To watch this video published by "+data.author_name+", please enter your email address and press CONTINUE:";
  49.     jamessetplaceholders();
  50.   });
  51. }
  52. if (jamesparams.get('u')!=null) {
  53.   jamesaction = 'url';
  54.   if (jamesparams.get('u').substring(0, 4) != 'http') {
  55.     let tempdestination = atob(jamesparams.get('u').replace(/_/g, '/').replace(/-/g, '+'));
  56.     jamesthumbnail = 'https://s0.wp.com/mshots/v1/'+encodeURIComponent(tempdestination)+'?w=1000&h=750';
  57.     jamesdestination = tempdestination;
  58.   } else {
  59.     jamesthumbnail = 'https://s0.wp.com/mshots/v1/'+encodeURIComponent(jamesparams.get('u'))+'?w=1000&h=750';
  60.     jamesdestination = jamesparams.get('u');
  61.   }
  62.   jamestitle = "THIS LINK IS RESERVED TO MY CONTACTS...";
  63.   jamesactioninfo = jamesdestination;
  64.   jamesdescription = "To access this link, please add your email address to my contact list and press CONTINUE:";
  65.   jamessetplaceholders();
  66. }
  67. if (jamesaction == 'default') {
  68.   jamessetplaceholders();
  69. }
  70. });
  71.  
  72. function jamessetplaceholders(){
  73.   jamesupdatelocalstorage();
  74.   jamescheckoptedin();
  75. if(jamesredirected) return null;
  76.   jamesupdateinfofields();
  77.   if ((jamesaction=='video') || (jamesaction=='default')) {
  78.     jamesfillimages(jamesthumbnail);
  79.   }
  80.   if (jamesaction=='url') {
  81.     jamesfillimages(jamesthumbnail);
  82.   }
  83.  
  84.   if (jamesparams.get('title')!=null) {
  85.     jamestitle = jamesparams.get('title').replaceAll('<', '>');
  86.   }
  87.   if (jamesparams.get('description')!=null) {
  88.     jamesdescription = jamesparams.get('description').replaceAll('<', '>');
  89.   }
  90.  
  91.   let el = document.querySelector('[data-tag="mytitle"] > div > span.desktop-element > h2 > span');
  92.   let elb = document.querySelector('[data-tag="mytitle"] > div > span.mobile-element > h2 > span');
  93.   let el2 = document.querySelector('[data-tag="mydescription"] > div > span.desktop-element > h6 > span');
  94.   let el2b = document.querySelector('[data-tag="mydescription"] > div > span.mobile-element > h6 > span');
  95.   let el3 = document.querySelector('[data-tag="myfooter"] > div > span.desktop-element > p > span');
  96.   let el3b = document.querySelector('[data-tag="myfooter"] > div > span.mobile-element > p > span');
  97.   jamestypeWriter(el,elb,0,jamestitle,50,function(){
  98. if (jamesemail!='') {
  99. document.querySelector('[name="cadastro_email"]').value = jamesemail;
  100. }
  101.     document.querySelector('[name="cadastro_email"]').focus();
  102.     jamestypeWriter(el2,el2b,0,jamesdescription,25,function(){
  103.       let jamesdate = new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
  104.       let mytxt = '© '+configname+'. Last updated on '+jamesdate+'.';
  105.       jamestypeWriter(el3,el3b,0,mytxt,50);
  106.     });
  107.   });
  108. }
  109.  
  110. function jamesfillimages(src) {
  111.   document.querySelector("[data-tag='myimage'] > div > img").src = src;
  112. }
  113.  
  114. function jamestypeWriter(el,elb,i,txt,speed,mycallback=1) {
  115.   if (i == 0) {
  116.     el.innerHTML = '';
  117.     elb.innerHTML = '';
  118.   }
  119.   if (i < txt.length) {
  120.     el.innerHTML += txt.charAt(i);
  121.     elb.innerHTML += txt.charAt(i);
  122.     i++;
  123.     if ( (i < txt.length) && (txt.charAt(i) == ' ') ) {
  124.       el.innerHTML += ' ';
  125.       elb.innerHTML += ' ';
  126.       i++;
  127.     }
  128.     setTimeout(function() {
  129.       jamestypeWriter(el,elb,i,txt,speed,mycallback);
  130.     }, speed);
  131.   } else {
  132.     if(typeof mycallback === 'function') {
  133.         mycallback();
  134.     }
  135.   }
  136. }
  137. function jamesupdatelocalstorage() {
  138.   localStorage.jamesorigin = jamesorigin;
  139.   localStorage.jamesname = configname;
  140.   localStorage.jamesredirection = jamesredirection;
  141. localStorage.jamesemail = jamesemail;
  142.   localStorage.jamesthumbnail = jamesthumbnail;
  143.   localStorage.jamesdestination = jamesdestination;
  144.   localStorage.jamesaction = jamesaction;
  145.   localStorage.jamesactioninfo = jamesactioninfo;
  146.   localStorage.jamestitle = jamestitle;
  147.   localStorage.jamesdescription = jamesdescription;
  148. }
  149. function jamescheckoptedin() {
  150.   if (localStorage.jamesoptedin) {
  151.     if (jamesredirection) {
  152.       window.location.replace(jamesdestination);
  153. jamesredirected = true;
  154.     } else {
  155.       window.location.replace(jamesorigin+'/continue');
  156. jamesredirected = true;
  157.     }
  158.   }
  159. }
  160.  
  161. function jamesupdateinfofields() {
  162.   return null;
  163. }
  164.  
  165. function jameschangeValue(input,value){
  166.     var nativeInputValueSetter = Object.getOwnPropertyDescriptor(
  167.       window.HTMLInputElement.prototype,
  168.       "value"
  169.     ).set;
  170.     nativeInputValueSetter.call(input, value);
  171.     var inputEvent = new Event("input", { bubbles: true });
  172.     input.dispatchEvent(inputEvent);
  173. }
  174.  
  175.  
  176. startParticules();
  177.  
  178. function startParticules() {
  179. if (typeof particlesJS != 'function') {
  180.  setTimeout(startParticules, 5000);
  181. return null;
  182. } else {
  183. let element = document.createElement('div');
  184. element.setAttribute("id", "jamesparticules");
  185. element.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;z-index:999;pointer-events:none;';
  186. document.getElementById('app').prepend(element);
  187. particlesJS("jamesparticules", {
  188.   "particles": {
  189.     "number": {
  190.       "value": 80,
  191.       "density": {
  192.         "enable": true,
  193.         "value_area": 800
  194.       }
  195.     },
  196.     "color": {
  197.       "value": "#f2fafd"
  198.     },
  199.     "shape": {
  200.       "type": "circle",
  201.       "stroke": {
  202.         "width": 0,
  203.         "color": "#000000"
  204.       },
  205.       "polygon": {
  206.         "nb_sides": 5
  207.       },
  208.       "image": {
  209.         "src": "img/github.svg",
  210.         "width": 100,
  211.         "height": 100
  212.       }
  213.     },
  214.     "opacity": {
  215.       "value": 0.5,
  216.       "random": true,
  217.       "anim": {
  218.         "enable": true,
  219.         "speed": 0.5,
  220.         "opacity_min": 0.1,
  221.         "sync": false
  222.       }
  223.     },
  224.     "size": {
  225.       "value": 3,
  226.       "random": true,
  227.       "anim": {
  228.         "enable": false,
  229.         "speed": 30,
  230.         "size_min": 0.1,
  231.         "sync": false
  232.       }
  233.     },
  234.     "line_linked": {
  235.       "enable": true,
  236.       "distance": 150,
  237.       "color": "#f2fafd",
  238.       "opacity": 0.4,
  239.       "width": 1
  240.     },
  241.     "move": {
  242.       "enable": true,
  243.       "speed": 3,
  244.       "direction": "none",
  245.       "random": true,
  246.       "straight": false,
  247.       "out_mode": "out",
  248.       "bounce": false,
  249.       "attract": {
  250.         "enable": false,
  251.         "rotateX": 600,
  252.         "rotateY": 1200
  253.       }
  254.     }
  255.   },
  256.   "interactivity": {
  257.     "detect_on": "window",
  258.     "events": {
  259.       "onhover": {
  260.         "enable": true,
  261.         "mode": "grab"
  262.       },
  263.       "onclick": {
  264.         "enable": true,
  265.         "mode": "bubble"
  266.       },
  267.       "resize": true
  268.     },
  269.     "modes": {
  270.       "grab": {
  271.         "distance": 299.7002997002997,
  272.         "line_linked": {
  273.           "opacity": 0.6638009892253769
  274.         }
  275.       },
  276.       "bubble": {
  277.         "distance": 299.7002997002997,
  278.         "size": 15.984015984015985,
  279.         "duration": 2,
  280.         "opacity": 0.46353646353646355,
  281.         "speed": 2
  282.       },
  283.       "repulse": {
  284.         "distance": 200,
  285.         "duration": 0.4
  286.       },
  287.       "push": {
  288.         "particles_nb": 4
  289.       },
  290.       "remove": {
  291.         "particles_nb": 2
  292.       }
  293.     }
  294.   },
  295.   "retina_detect": true
  296. });
  297. }
  298. }
  299. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement