Pen Settings



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


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


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.


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.


                <div class="background--path"></div>
  <h1 class="m-t-0 m-b-30">Trip Idea Generator <span class="version">v1.0</span></h1>

  <button id="trigger" class="button m-b-50">Get another trip idea</button>

  <div id="idea-container" class="trip-idea__container m-b-20">
    <div id="place-image" class="trip-idea-image m-b-30"></div>
    <div class="d-inline-block m-b-20 p-x-15">
      <p class="trip-label">What</p>
      <p id="activity" class="trip-value">Getting lost</p>
    <div class="d-inline-block m-b-30 p-x-15">
      <p class="trip-label">Where</p>
      <p id="place" class="trip-value">Paris, France</p>

  <div class="attribution m-b-100">
    <p>👏 Thanks for the photo,
      <a class="attr-link" id="photographer-link" href="" target="_blank">
        <span id="photographer">Yeo Khee</span>

  <p>&copy; 2018 <a class="attr-link" href="" target="_blank">Adam Ruf</a> for <a class="attr-link" href="" target="_blank">UX Design Contest #6</a></p>

  <script src="app.js"></script>


                * {
  margin: 0;

body {
  background: rgb(255,255,187);
  background: linear-gradient(160deg, rgba(255,255,187,1) 0%, rgba(255,212,224,1) 100%) center center fixed;
  color: rgba(31,33,39,0.6);
  font-family: Montserrat, Helvetica Neue, Tahoma, sans-serif;
  font-weight: 400;
  padding: 20px;
  padding-top: 100px;
  text-align: center;
  z-index: -2;

.background--path {
  background: url('') left center;
  background-size: contain;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.5;
  z-index: -1;


h1 {
  color: rgba(31,33,39,0.6);
  font-size: 50px;
  font-weight: 400;
  line-height: 1.1;

.m-b-20 { margin-bottom: 20px !important; }

.m-b-30 { margin-bottom: 30px !important; }

.m-b-50 { margin-bottom: 50px !important; }

.m-b-100 { margin-bottom: 100px !important; }

.m-r-30 { margin-right: 30px !important; }

.m-t-0 { margin-top: 0 !important;}

.p-x-15 {
  padding-left: 15px;
  padding-right: 15px;

.version {
  font-size: 30px;

.button {
  background: #1F2127;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.11), 0 4px 6px rgba(0,0,0,0.08);
  font-family: Montserrat;
  font-size: 25px;
  font-weight: 400;
  color: white;
  padding: 12px 20px;
  text-transform: uppercase;
  transform: translateY(0);
  transition: all 0.3s ease-in-out;

@media screen and (max-width: 529px) {
  .button {
    font-size: 20px;

.button:hover {
  box-shadow: 0 3px 5px rgba(0,0,0,0.09), 0 7px 10px rgba(0,0,0,0.06);
  transform: translateY(-2px);

.button:active:focus {
  box-shadow: 0 1px 3px rgba(0,0,0,0.11), 0 4px 6px rgba(0,0,0,0.08);
  transform: translateY(2px);

.button:focus {
  outline: none !important;
  box-shadow: 0 0 50px rgba(255,212,224,1), 0 3px 5px rgba(0,0,0,0.09), 0 7px 10px rgba(0,0,0,0.06);
  transform: translateY(-2px);

.trip-idea__container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 5px rgba(0,0,0,0.11), 0 5px 10px rgba(0,0,0,0.08);
  margin: 0 auto;
  min-height: 400px;
  max-width: 600px;

.trip-idea-image {
  background: #ECF4F9;
  background-image: url('');
  background-position-y: center;
  background-size: cover;
  border-radius: 10px 10px 0 0;
  height: 250px;
  max-width: 600px;

.trip-label {
  font-size: 16px;
  text-transform: uppercase;

.trip-value {
  color: #1F2127;
  font-size: 25px;
  font-weight: 700;
  text-transform: capitalize;

.d-inline-block {
  display: inline-block;

.attribution {
  background: rgba(255,255,255,0.5);
  border-radius: 50px;
  margin: 0 auto;
  max-width: 380px;
  padding: 12px 26px;

.attr-link {
  color: rgba(31,33,39,0.6);
  text-decoration: underline;

.attr-link:focus {
  color: rgb(31,33,39);



                // Create an Array of activities
var activities = ["birdwatching", "detectoring", "skydiving", "museum hopping", "gallery hopping", "sightseeing", "dog walking", "juggling", "orienteering", "treasure hunting"];

// Create an Array of Objects of location-related information
var place = [];
place[0] = { place:"Seville, Spain", photo:"url('')", photographer:"Henrique Ferreira", photographerLink:"" };
place[1] = { place:"Detroit, USA", photo:"url('')", photographer:"Doug Zuba", photographerLink:"" };
place[2] = { place:"Canberra, Australia", photo:"url('')", photographer:"Social Estate", photographerLink:"" };
place[3] = { place:"Hamburg, Germany", photo:"url('')", photographer:"Patrick Baum", photographerLink:"" };
place[4] = { place:"Kaohsiung, Taiwan", photo:"url('", photographer:"Dominik Vanyi", photographerLink:"" };
place[5] = { place:"Antwerp, Belgium", photo:"url('", photographer:"Kristaps Grundsteins", photographerLink:"" };
place[6] = { place:"Matera, Italy", photo:"url('')", photographer:"carlo testa", photographerLink:"" };
place[7] = { place:"San Juan, Puerto Rico", photo:"url('')", photographer:"Cristian Escobar", photographerLink:"" };
place[8] = { place:"Guanajuato, Mexico", photo:"url('')", photographer:"Alfonso Navarro", photographerLink:"" };
place[9] = { place:"Oslo, Norway", photo:"url('')", photographer:"Vidar Nordli-Mathisen", photographerLink:"" };

// Create a function to call when someone clicks the button
function randomTripIdea() {

  // Randomly select an activity and assign the value to a variable
  var randActivity = activities[Math.floor(Math.random() * activities.length)];

  // Randomly select a place and assign the value to a variable
  var randPlace = place[Math.floor(Math.random() * place.length)];

  // Blur the current trip idea
  document.getElementById('idea-container').style.filter = "blur(5px)";

  // Insert randomly selected activity
  document.getElementById('activity').innerHTML = randActivity;

  // Insert the location name
  document.getElementById('place').innerHTML =;

  // Insert the location photo
  document.getElementById('place-image').style.backgroundImage =;

  // Insert the photographer name
  document.getElementById('photographer').innerHTML = randPlace.photographer;

  // Insert the photographer link
  document.getElementById('photographer-link').href = randPlace.photographerLink;

  // Remove blur filter


// Set up the button to run the random-selection function
document.getElementById("trigger").onclick = function() { randomTripIdea() };