Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                #wrapper
  h1 Viral Post Titles
  button(onclick="javascript: generateTen()") Generate More
  ul#topics
              
            
!

CSS

              
                #wrapper {
  margin: 30px;
  ul {
    list-style: inside;
    margin: 10px 5px;
    padding: 0;
    
    li {
      text-transform: capitalize;
    }
  }
}
              
            
!

JS

              
                const adjectives = ['Defiant', 'Homeless', 'Adorable', 'Delightful', 'Homely', 'Quaint', 'Adventurous', 'Depressed', 'Horrible', 'Aggressive', 'Determined', 'Hungry', 'Real', 'Agreeable', 'Different', 'Hurt', 'Relieved', 'Alert', 'Difficult', 'Repulsive', 'Alive', 'Disgusted', 'Ill', 'Rich', 'Amused', 'Distinct', 'Important', 'Angry', 'Disturbed', 'Impossible', 'Scary', 'Annoyed', 'Dizzy', 'Inexpensive', 'Selfish', 'Annoying', 'Doubtful', 'Innocent', 'Shiny', 'Anxious', 'Drab', 'Inquisitive', 'Shy', 'Arrogant', 'Dull', 'Itchy', 'Silly', 'Ashamed', 'Sleepy', 'Attractive', 'Eager', 'Jealous', 'Smiling', 'Average', 'Easy', 'Jittery', 'Smoggy', 'Awful', 'Elated', 'Jolly', 'Sore', 'Elegant', 'Joyous', 'Sparkling', 'Bad', 'Embarrassed', 'Splendid', 'Beautiful', 'Enchanting', 'Kind', 'Spotless', 'Better', 'Encouraging', 'Stormy', 'Bewildered', 'Energetic', 'Lazy', 'Strange', 'Black', 'Enthusiastic', 'Light', 'Stupid', 'Bloody', 'Envious', 'Lively', 'Successful', 'Blue', 'Evil', 'Lonely', 'Super', 'Blue-eyed', 'Excited', 'Long', 'Blushing', 'Expensive', 'Lovely', 'Talented', 'Bored', 'Exuberant', 'Lucky', 'Tame', 'Brainy', 'Tender', 'Brave', 'Fair', 'Magnificent', 'Tense', 'Breakable', 'Faithful', 'Misty', 'Terrible', 'Bright', 'Famous', 'Modern', 'Tasty', 'Busy', 'Fancy', 'Motionless', 'Thankful', 'Fantastic', 'Muddy', 'Thoughtful', 'Calm', 'Fierce', 'Mushy', 'Thoughtless', 'Careful', 'Filthy', 'Mysterious', 'Tired', 'Cautious', 'Fine', 'Tough', 'Charming', 'Foolish', 'Nasty', 'Troubled', 'Cheerful', 'Fragile', 'Naughty', 'Clean', 'Frail', 'Nervous', 'Ugliest', 'Clear', 'Frantic', 'Nice', 'Ugly', 'Clever', 'Friendly', 'Nutty', 'Uninterested', 'Cloudy', 'Frightened', 'Unsightly', 'Clumsy', 'Funny', 'Obedient', 'Unusual', 'Colorful', 'Obnoxious', 'Upset', 'Combative', 'Gentle', 'Odd', 'Uptight', 'Comfortable', 'Gifted', 'Old-fashioned', 'Concerned', 'Glamorous', 'Open', 'Vast', 'Condemned', 'Gleaming', 'Outrageous', 'Victorious', 'Confused', 'Glorious', 'Outstanding', 'Vivacious', 'Cooperative', 'Good', 'Courageous', 'Gorgeous', 'Panicky', 'Wandering', 'Crazy', 'Graceful', 'Perfect', 'Weary', 'Creepy', 'Grieving', 'Plain', 'Wicked', 'Crowded', 'Grotesque', 'Pleasant', 'Wide-eyed', 'Cruel', 'Grumpy', 'Poised', 'Wild', 'Curious', 'Poor', 'Witty', 'Cute', 'Handsome', 'Powerful', 'Worrisome', 'Happy', 'Precious', 'Worried', 'Dangerous', 'Healthy', 'Prickly', 'Wrong', 'Dark', 'Helpful', 'Proud', 'Dead', 'Helpless', 'Putrid', 'Zany', 'Defeated', 'Hilarious', 'Puzzled', 'Zealous'];

const keywords = ['facebook', 'youtube', 'amazon', 'gmail', 'google', 'weather', 'ebay', 'yahoo', 'walmart', 'yahoo mail', 'google translate', 'google maps', 'craigslist', 'netflix', 'google docs', 'translate', 'home depot', 'news', 'fox news', 'calculator', 'usps tracking', 'cnn', 'hotmail', 'google drive', 'maps', 'paypal', 'lowes', 'instagram', 'msn', 'amazon prime', 'target', 'espn', 'zillow', 'bank of america', 'wells fargo', 'twitter', 'google classroom', 'indeed', 'best buy', 'speed test', 'linkedin', 'aol mail', 'hulu', 'you tube', 'pinterest', 'trump', 'nba', 'roblox', 'capital one', 'traductor', 'nfl', 'facebook login', 'costco', 'youtube to mp3', 'ups tracking', 'chase', 'kohls', 'reddit', 'google flights', 'american airlines', 'bing', 'etsy', 'twitch', 'dominos', 'airbnb', 'spotify', 'fedex tracking', 'nfl scores', 'restaurants near me', 'macys', 'aol', 'google scholar', 'pizza hut', 'women’s world cup 2019', 'usps', 'expedia', 'discord', 'credit karma', 'outlook', 'southwest airlines', 'verizon', 'walgreens', 'harbor freight', 'entertainment', 'pandora', 'bed bath and beyond', 'united airlines', 'turbotax', 'facebook log in', 'google news', 'amazon prime video', 'sports', 'wayfair', 'fb', 'solitaire', 'autozone', 'ikea', 'timer', 'spanish to english', 'xfinity', 'qanon', 'covid', 'Trudeau', 'Biden', 'Hillary Clinton'];

const pluralizers = ['tricks', 'hacks', 'stories', 'ideas', 'puzzles', 'pro-tips', 'babes', 'blogs', 'pics', 'chicks', 'dudes', 'magazines', 'videos', 'articles'];

const promises = ['you won\'t believe!', 'that will knock your socks off!', 'that will save you money!', 'which are guaranteed to help you find true love.', 'that are going to change your life!', 'that will make you popular at school.', 'that will make your crush instantly propose.', 'that will make you shit your pants.', 'you will love', 'your grandma will love', 'that will make your daddy love you', 'that will blow your mind', 'which will turn you into a prince', 'which will save your life!', 'that will turn you into a genie.', 'that will set your genie free', 'that will bring you true love'];

function getRandomValueFromList(list) {
  return list[Math.floor(Math.random()*list.length)]
}

function generateViralTitle() {
  const number = Math.floor((Math.random() * 100) + 1);
  const adjective = getRandomValueFromList(adjectives);
  const keyword = getRandomValueFromList(keywords);  
  const pluralizer = getRandomValueFromList(pluralizers);
  const promise = getRandomValueFromList(promises);
  const titleContainer = document.createElement('li');
  titleContainer.classList.add('topic');
  
  titleContainer.innerHTML = `${number} ${adjective} ${keyword} ${pluralizer} ${promise}`;
  
  document.querySelector('#topics').append(titleContainer);
}

function generateTen() {
  for (var i = 0; i < 10; i++) {
    generateViralTitle();
  }  
}

generateTen();



              
            
!
999px

Console