Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<div class="container">  
<h1 id="test"> they know...run</h1> 
</div>
              
            
!

CSS

              
                body{
  background-color:black
}
h1{
  font-family: 'Press Start 2P', cursive;
  color:saturate(lime,50%);
      text-align: center;
  user-select: none;    
  &::after{
    content:"_";
     animation: blink-animation 1s steps(5, start) infinite;
      
  }
}

.container{
  display:flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  height:100vh;
}

@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}
              
            
!

JS

              
                Splain.addEntry({
  people:{
    all:["{{people.presidents}}","{{people.primeministers}}","{{people.musicians}}","{{people.celebraties}}","{{people.actors}}"],
    presidents:["Geroge Bush","Donald Trump","Barack Obama","Abraham Lincoln","George Washington"],
    primeministers:["Tony Blair","Theresa May","Winston Churchill"],
    musicians:["Ozzy Osbourne","Taylor Swift","Sting","Billy Joel","Ringo Star","Michel Jackson", "Elton John", "Dr Dre"],
    celebraties:["Kim Kardashian","Logan Paul","Kate Moss"],
    actors:["Orlando Bloom","jJohnny Depp","Judy Dench","Jodie Whittaker"]
  },
  actions:{
    personal:["blink","poo","shake hands","grow any {{`armpit`|`nose`|`pubic`}} hair","squint","hold their breith", "roll their tounge","bend their elbow", "wee","click their fingers","run","blow a raspberry","click there fingers","wink"],
  bad:["hates","laughs at","makes fun of","campaigns against","doesnt believe in","overcharges","discriminates against","lies to","refuses to work with"],
   },
  institutions:{
    all:["{{institutions.companies}}","{{institutions.parties}}","{{institutions.charities}}","{{institutions.goverments}}","{{institutions.mediaOutlets}}"],
    companies:["microsoft","google","facebook","coca cola"],
    mediaOutlets:["bloomburg","bbC","channel 4","twitter","financial times","the bloke down the pub"],
    parties:["the tories", "labour", "the lib dems","the democrats", "the republicans","him with the eye. prescot? no. wait. brown."],
    charities:["the NHS","the red cross","MIND", "the National Trust","Oxfam","The Salvation Army","RSPCA"],
    goverments:["the {{nationalities}} goverment","area 51"]
  },
  groups:{
    target:["the poor","immigrants","millenials","the disabled","me","the truth","the working class","your childrens future"]
  },
  nationalities:["russian","english","german","french","polish","norwegian","american","japanese","chinese"],
  animals:["lizard","mole","insect"],
  connections:{
    charityToInstitution:["is a front for","collects data for","takes orders from","is run by"]
  },
  inability:["cant", "wont","refuses to","struggles to"],
  locations:{
    
  },
  conspiracies:{
    all:["{{{{conspiracies.precursor }}?4}}{{conspiracies.content.all}}{{{{ `...`conspiracies.ending}}?5}}"],
    precursor:["did you know","its runmoured","i heard","i have it on good evidence","its obvious","dont tell anyone but","somone said that","i read on the internet","a reliable source says"],
    content:{
      all:["{{conspiracies.content.people}}","{{conspiracies.content.charities}}","{{conspiracies.content.companies}}"],
      people:["{{people.all inability actions.personal}}","{{people.all `is`` actually`? `a` animals `person` }}", "{{people.all}} is a spy for {{institutions.all}}","{{people.all actions.bad groups.target}}"],
      charities:["{{institutions.charities connections.charityToInstitution institutions.companies|institutions.parties|institutions.goverments}}"],
      companies:["{{institutions.companies actions.bad groups.target}}"]
    },
    ending:["but dont tell anyone","keep it a secret","you heard it here first","it makes sense if you think about it"]
  }
});


// for(let i=0; i <10; i++) {
//   console.log(Splain.process("{{conspiracies.all}}"));
// }

let characters ="ABCDEFJHIJKLMNOPQRSTUVWXYZ!£$%&*"
let conspiracy = null;
String.prototype.replaceAt=function(index, replacement) {
    return this.substr(0, index) + replacement+ this.substr(index + replacement.length);
}

class Redacted {
  constructor(targetElement,finalString,typed,initializeTime, tickTime) {
    this.target = targetElement;
    if(typed === undefined) typed = true;
    this.typed = typed;
    this.typedLength = 0;
    this.typeTime = 30;
    this.initializeTime = initializeTime || 0;
    this.initialized = initializeTime == undefined? true: false;
    this.tickTime = tickTime || 100;
    this.finalString = finalString || targetElement.innerHTML;
    this.unresolved = [];
    this.currentString = "";
    for (var i = 0; i < this.finalString.length; i++) {
      if(this.finalString[i]!== ' '){
     this.unresolved.push(i);
      this.currentString += this.getRandomChar();
    }
      else this.currentString += " ";
    }

    if(this.initializeTime) setTimeout(()=>{
      this.initialized = true;
    },this.initializeTime)
    setTimeout(()=>{this.randomize()}, this.tickTime);
    if(this.typed)  setTimeout(()=>{this.type()}, this.typeTime);
  }
  
  getRandomChar() {
    return characters.charAt(Math.floor(Math.random() * characters.length))
  }
  
  adjustResolveSpeed() {
    let adjustedTime = this.tickTime *(1-this.unresolved.length/this.finalString.length);
    if(adjustedTime < 10) adjustedTime = 10;
    return adjustedTime;
  }
  
  type() {
    this.typedLength ++;
    if(this.typed && this.typedLength < this.finalString.length) {
       setTimeout(()=>{this.type()}, this.typeTime);
    }
  }
  
  randomize() {
    this.unresolved.forEach((n)=>{
     this.currentString =  this.currentString.replaceAt(n,this.getRandomChar());
    });
    
    if(this.initialized && (!this.typed ||(this.typed && this.typedLength >= this.finalString.length))) {
      this.resolveChar();
    }
    
    if(this.unresolved.length > 0) {
      setTimeout(()=>{this.randomize()},this.adjustResolveSpeed());
    }
    this.target.innerHTML = this.typed? this.currentString.substring(0,this.typedLength):this.currentString;
  }
  
  resolveChar() {
    let index = Math.floor(this.unresolved.length * Math.random());
    let charPos = this.unresolved[index]
    this.unresolved.splice(index,1);
    this.currentString = this.currentString.replaceAt(charPos,this.finalString.charAt(charPos));    
  }
   
}


let generateNewConspiracy = function() {
    let content = Splain.process("{{conspiracies.all}}");
    if(Math.random() >0.6) content = content.toUpperCase();
    conspiracy = new Redacted(document.getElementById("test"), content);
}
window.onload = function() {
  generateNewConspiracy();
}

window.onclick = function() {
   generateNewConspiracy();
}
              
            
!
999px

Console