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

              
                <audio id="sound" src="http://www.tp-strudengau.at/nana.mp3"></audio>

<audio src="http://www.tp-strudengau.at/bb.mp3" id="bomb"></audio>

<img id="batman" src="https://d13yacurqjgara.cloudfront.net/users/502620/screenshots/2037285/batman_run.gif">

<img id="pow" src="https://24.media.tumblr.com/5308be6d5dd4c505c05d2b47289c0670/tumblr_mjj2sgWlTM1rhelkjo1_500.gif" alt="" />

<h1 id="winner">Stefan Baumgartner</h1>

<link href="https://fonts.googleapis.com/css?family=Bangers" rel="stylesheet">

              
            
!

CSS

              
                body {
  background-color: #f7f7f8;
  position: relative;
  min-height: 100vh;
  margin: 0;
}

.hidden {
  display: none !important;
}

#batman {
  width: 50%;
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-200%, -50%);
  transition: none;
}

.start #batman {
  transform: translate(-50%, -50%);
  transition: transform 6s ease;
}

#pow {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100%;
  display: none;
  transform: translate(-50%, -50%);
}

.end #pow {
  display: block;
}

h1 {
  font-family: 'Bangers';
  font-size: 60px;
  font-weight: normal;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  margin: 0;
}

h1.in {
  transition: opacity 2s ease;
  opacity: 1;
}
              
            
!

JS

              
                var running = false;

$('body').on('click', (e) => {
  if(running) return;
  running = true;
  $('body').removeClass('end');
  $('#pow').removeClass('hidden');
  $('#winner').removeClass('in');
  $('#sound')[0].currentTime = 0;
  $('#bomb')[0].currentTime = 0;
  $('#sound')[0].play();
  $('#bomb')[0].pause();
  $('body').addClass('start');
  setTimeout(end, 9000);
});

const end = () => {
  $('body').addClass('end');
  $('body').removeClass('start');
  $('#sound')[0].pause();
  $('#bomb')[0].play();
  setTimeout(removeBomb, 1000);
}

const removeBomb = () => {
  $('#pow').addClass('hidden');
  const idx = parseInt(Math.random() * uniques.length);
  $('#winner').text(uniques[idx]);
  $('#winner').addClass('in');
  running = false;
  uniques.splice(idx, 1);
}

const fb =  ["Felix Valmont", "Willi Twyn", "Christina Stuerz", "Frederic Köberl", "Emanuel Zeilinger", "David Tanzer", "Florian Harwöck", "Stefan Starke", "Robert Kohel", "Adrian Fü", "Kai Takac", "Patrick Steiner", "Hannes Sachsenhofer", "Christian Haider", "Franz Ebner", "Michael Schober", "Daniel Bauer", "Dom Kai", "Peter Studener", "Renate Wölbitsch", "Michael Kirchmair", "Jürgen Ratzenböck", "Manuela Seethaler", "Michael Wimmer", "Isabella Bognermayr", "MMatthiass KKoglerr", "Martin Weber", "Fabian Hurnaus", "David Brunnthaler", "Gerald Hoheneder", "Elisabeth Rosemann", "Thomas Einwaller", "Daniel Dekic", "Hannes Brandstätter-Müller", "Robert Schmelzer", "Onur Sen"];

const meetup = ["Hanna", "Felix Valmont", "Onur Sen", "Matthias 'Yolgie' Holzinger", "Sebastian Gierlinger", "Thomas L", "Rene Pirringer", "Elmar Putz", "Christoph Zauner", "Joachim Zenkel", "Robert Baumgartner", "Thomas Pichler", "Rene Reiter", "Stefan Baumgartner", "Thomas Einwaller", "Thomas Scheinecker", "chris.net", "Clem Niem", "Martin Jobst", "Gergely Kalapos", "Christian Haider", "Charlie Frauscher", "Mario Rader", "Joachim", "Florian Harwöck", "Johannes Strassmayr", "Johannes Krenn", "Wolfgang Hafenscher", "Rudolf Kussberger", "Herbert Teibler", "Hannes Brandstätter-Müller", "Michael Weichselbaumer", "Andi", "Nikolaus Weingartmair", "Christoph F", "Frederic Köberl", "Christopher Bradley", "Iva", "Martin Niederl", "Peter Stritzinger", "Andreas Altendorfer", "Thomas Kent Rohrberg", "Martin Weber", "Thomas Fischl", "Aleksandar Djurdjic", "Josef Altmann", "Manuel Moser", "Andreas Frühwirt", "Patrick Steiner", "Harald Seltner", "Hal Ko", "Karl Artmann", "bullshit", "Elisabeth Rosemann", "Alexander Rosemann", "Dominik Hurnaus", "Hannes Sachsenhofer", "Doris Tiefenthaler", "Mia Baumgartner", "Clemens Tiefenthaler"];

const members = meetup.concat(fb);

const uniques = Array.from(new Set(members));
console.log(uniques);
console.log(uniques.length);
              
            
!
999px

Console