Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var configname = "Build 'n' roll";
- var configredirection = 0;
- var jamesredirected = false;
- var configthumbnail = 'https://thisartworkdoesnotexist.com';
- var configdestination = 'https://3pdf.com';
- var configtitle = 'WELCOME TO MY CONTACTS LIST!';
- var configdescription = 'To receive your welcome gift, please enter your email address and press CONTINUE:';
- configname = configname.trim();
- const getJSON = async url => {
- const response = await fetch(url);
- return response.json();
- }
- var jamesparams = (new URL(document.location)).searchParams;
- var jamesaction = 'default';
- var jamesactioninfo = '';
- var jamesorigin = window.location.origin;
- var jamesthumbnail = configthumbnail;
- var jamesdestination = configdestination;
- var jamestitle = configtitle;
- var jamesdescription = configdescription;
- var jamesredirection = '';
- if (jamesparams.get('r')!=null) {
- jamesredirection = jamesparams.get('r');
- } else {
- jamesredirection = configredirection;
- }
- var jamesemail = '';
- if (jamesparams.get('e')!=null) {
- jamesemail = jamesparams.get('e');
- }
- if (jamesparams.get('reset')!=null) {
- localStorage.clear();
- }
- window.addEventListener('load', function () {
- if (jamesparams.get('v')!=null) {
- jamesaction = 'video';
- jamesthumbnail = 'https://i.ytimg.com/vi/'+jamesparams.get('v')+'/hqdefault.jpg';
- jamesdestination = 'https://www.youtube.com/watch?v='+jamesparams.get('v');
- getJSON('https://www.youtube.com/oembed?url=https%3A//youtube.com/watch%3Fv%3D'+jamesparams.get('v')+'&format=json').then(function(data){
- jamestitle = "VIDEO: "+data.title;
- jamesactioninfo = data.title;
- jamesdescription = "To watch this video published by "+data.author_name+", please enter your email address and press CONTINUE:";
- jamessetplaceholders();
- });
- }
- if (jamesparams.get('u')!=null) {
- jamesaction = 'url';
- if (jamesparams.get('u').substring(0, 4) != 'http') {
- let tempdestination = atob(jamesparams.get('u').replace(/_/g, '/').replace(/-/g, '+'));
- jamesthumbnail = 'https://s0.wp.com/mshots/v1/'+encodeURIComponent(tempdestination)+'?w=1000&h=750';
- jamesdestination = tempdestination;
- } else {
- jamesthumbnail = 'https://s0.wp.com/mshots/v1/'+encodeURIComponent(jamesparams.get('u'))+'?w=1000&h=750';
- jamesdestination = jamesparams.get('u');
- }
- jamestitle = "THIS LINK IS RESERVED TO MY CONTACTS...";
- jamesactioninfo = jamesdestination;
- jamesdescription = "To access this link, please add your email address to my contact list and press CONTINUE:";
- jamessetplaceholders();
- }
- if (jamesaction == 'default') {
- jamessetplaceholders();
- }
- });
- function jamessetplaceholders(){
- jamesupdatelocalstorage();
- jamescheckoptedin();
- if(jamesredirected) return null;
- jamesupdateinfofields();
- if ((jamesaction=='video') || (jamesaction=='default')) {
- jamesfillimages(jamesthumbnail);
- }
- if (jamesaction=='url') {
- jamesfillimages(jamesthumbnail);
- }
- if (jamesparams.get('title')!=null) {
- jamestitle = jamesparams.get('title').replaceAll('<', '>');
- }
- if (jamesparams.get('description')!=null) {
- jamesdescription = jamesparams.get('description').replaceAll('<', '>');
- }
- let el = document.querySelector('[data-tag="mytitle"] > div > span.desktop-element > h2 > span');
- let elb = document.querySelector('[data-tag="mytitle"] > div > span.mobile-element > h2 > span');
- let el2 = document.querySelector('[data-tag="mydescription"] > div > span.desktop-element > h6 > span');
- let el2b = document.querySelector('[data-tag="mydescription"] > div > span.mobile-element > h6 > span');
- let el3 = document.querySelector('[data-tag="myfooter"] > div > span.desktop-element > p > span');
- let el3b = document.querySelector('[data-tag="myfooter"] > div > span.mobile-element > p > span');
- jamestypeWriter(el,elb,0,jamestitle,50,function(){
- if (jamesemail!='') {
- document.querySelector('[name="cadastro_email"]').value = jamesemail;
- }
- document.querySelector('[name="cadastro_email"]').focus();
- jamestypeWriter(el2,el2b,0,jamesdescription,25,function(){
- let jamesdate = new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
- let mytxt = '© '+configname+'. Last updated on '+jamesdate+'.';
- jamestypeWriter(el3,el3b,0,mytxt,50);
- });
- });
- }
- function jamesfillimages(src) {
- document.querySelector("[data-tag='myimage'] > div > img").src = src;
- }
- function jamestypeWriter(el,elb,i,txt,speed,mycallback=1) {
- if (i == 0) {
- el.innerHTML = '';
- elb.innerHTML = '';
- }
- if (i < txt.length) {
- el.innerHTML += txt.charAt(i);
- elb.innerHTML += txt.charAt(i);
- i++;
- if ( (i < txt.length) && (txt.charAt(i) == ' ') ) {
- el.innerHTML += ' ';
- elb.innerHTML += ' ';
- i++;
- }
- setTimeout(function() {
- jamestypeWriter(el,elb,i,txt,speed,mycallback);
- }, speed);
- } else {
- if(typeof mycallback === 'function') {
- mycallback();
- }
- }
- }
- function jamesupdatelocalstorage() {
- localStorage.jamesorigin = jamesorigin;
- localStorage.jamesname = configname;
- localStorage.jamesredirection = jamesredirection;
- localStorage.jamesemail = jamesemail;
- localStorage.jamesthumbnail = jamesthumbnail;
- localStorage.jamesdestination = jamesdestination;
- localStorage.jamesaction = jamesaction;
- localStorage.jamesactioninfo = jamesactioninfo;
- localStorage.jamestitle = jamestitle;
- localStorage.jamesdescription = jamesdescription;
- }
- function jamescheckoptedin() {
- if (localStorage.jamesoptedin) {
- if (jamesredirection) {
- window.location.replace(jamesdestination);
- jamesredirected = true;
- } else {
- window.location.replace(jamesorigin+'/continue');
- jamesredirected = true;
- }
- }
- }
- function jamesupdateinfofields() {
- return null;
- }
- function jameschangeValue(input,value){
- var nativeInputValueSetter = Object.getOwnPropertyDescriptor(
- window.HTMLInputElement.prototype,
- "value"
- ).set;
- nativeInputValueSetter.call(input, value);
- var inputEvent = new Event("input", { bubbles: true });
- input.dispatchEvent(inputEvent);
- }
- startParticules();
- function startParticules() {
- if (typeof particlesJS != 'function') {
- setTimeout(startParticules, 5000);
- return null;
- } else {
- let element = document.createElement('div');
- element.setAttribute("id", "jamesparticules");
- element.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;z-index:999;pointer-events:none;';
- document.getElementById('app').prepend(element);
- particlesJS("jamesparticules", {
- "particles": {
- "number": {
- "value": 80,
- "density": {
- "enable": true,
- "value_area": 800
- }
- },
- "color": {
- "value": "#f2fafd"
- },
- "shape": {
- "type": "circle",
- "stroke": {
- "width": 0,
- "color": "#000000"
- },
- "polygon": {
- "nb_sides": 5
- },
- "image": {
- "src": "img/github.svg",
- "width": 100,
- "height": 100
- }
- },
- "opacity": {
- "value": 0.5,
- "random": true,
- "anim": {
- "enable": true,
- "speed": 0.5,
- "opacity_min": 0.1,
- "sync": false
- }
- },
- "size": {
- "value": 3,
- "random": true,
- "anim": {
- "enable": false,
- "speed": 30,
- "size_min": 0.1,
- "sync": false
- }
- },
- "line_linked": {
- "enable": true,
- "distance": 150,
- "color": "#f2fafd",
- "opacity": 0.4,
- "width": 1
- },
- "move": {
- "enable": true,
- "speed": 3,
- "direction": "none",
- "random": true,
- "straight": false,
- "out_mode": "out",
- "bounce": false,
- "attract": {
- "enable": false,
- "rotateX": 600,
- "rotateY": 1200
- }
- }
- },
- "interactivity": {
- "detect_on": "window",
- "events": {
- "onhover": {
- "enable": true,
- "mode": "grab"
- },
- "onclick": {
- "enable": true,
- "mode": "bubble"
- },
- "resize": true
- },
- "modes": {
- "grab": {
- "distance": 299.7002997002997,
- "line_linked": {
- "opacity": 0.6638009892253769
- }
- },
- "bubble": {
- "distance": 299.7002997002997,
- "size": 15.984015984015985,
- "duration": 2,
- "opacity": 0.46353646353646355,
- "speed": 2
- },
- "repulse": {
- "distance": 200,
- "duration": 0.4
- },
- "push": {
- "particles_nb": 4
- },
- "remove": {
- "particles_nb": 2
- }
- }
- },
- "retina_detect": true
- });
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement