HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
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.1</span></h1>
<button id="trigger" class="button m-b-20">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-20"></div>
<div class="idea-container">
<div class="">
<p id="activity" class="trip-value">Wandering</p>
</div>
<div class="">
<p class="trip-label">in</p>
</div>
<div class="">
<p id="place" class="trip-value">Paris, France</p>
</div>
</div>
</div>
<div class="attribution m-b-100">
<p>👏 Thanks for the photo,
<a class="attr-link" id="photographer-link" href="https://unsplash.com/@yokeboy" target="_blank">
<span id="photographer">Yeo Khee</span>
</a>
</p>
</div>
<p>© 2018 <a class="attr-link" href="http://adamruf.com" target="_blank">Adam Ruf</a> for <a class="attr-link" href="http://uxdesigncontest.com" 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('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/path.svg') 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-8 {
padding-left: 8px;
padding-right: 8px;
}
.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;
transform: translateY(0);
transition: all 0.3s ease-in-out;
width: 100%;
max-width: 600px;
}
@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,
.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: 300px;
max-width: 600px;
}
.trip-idea-image {
background: #ECF4F9;
background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/paris%402x.jpg');
background-position-y: center;
background-size: cover;
border-radius: 10px 10px 0 0;
height: 250px;
max-width: 600px;
}
.idea-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 12px;
padding: 0 24px;
align-items: center;
justify-content: center;
padding-bottom: 24px;
}
.trip-label {
font-size: 20px;
font-weight: 500;
/* text-transform: uppercase; */
}
.trip-value {
color: #1F2127;
font-size: 25px;
font-weight: 700;
&::first-letter {
text-transform: uppercase;
}
}
.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:hover,
.attr-link:active,
.attr-link:focus {
color: rgb(31,33,39);
}
// Create an Array of activities
var activities = [
"birdwatch", "metal detect", "skydive", "visit a museum", "explore a gallery",
"sightsee", "walk dogs", "juggle", "orienteer", "hunt treasure",
"food tour", "take cooking class", "taste wine", "tour brewery", "admire street art",
"ghost tour", "solve escape room", "do scavenger hunt", "zip-line", "paraglide",
"ride hot air balloon", "kayak", "paddleboard", "snorkel", "hike",
"surf", "rock climb", "go canyoning", "raft rapids",
"ride horses", "bike", "walking tour", "visit a historical site", "make pottery",
"learn local craft", "attend language meetup", "enjoy festival", "watch outdoor movie", "stargaze",
"buy a souvenir", "fish", "camp", "boat tour", "ice skate",
"visit café", "taste tea", "meditate", "do yoga", "learn dance",
"sing karaoke", "perform at open mic", "watch sports event", "explore market", "browse flea market",
"architecture tour", "visit rooftop bar", "watch sunset", "hike at sunrise", "go glamping",
"stay in unique lodging", "visit farm", "volunteer", "join game night", "visit amusement park",
"try street food", "attempt food challenge", "tour factory", "taste cheese", "forage for food",
"pick fruit", "arrange flowers", "attend concert", "visit science center", "get spa treatment",
"try aerial silks", "climb indoor wall", "go geocaching", "explore urban areas", "watch comedy show",
"visit garden", "watch sports match", "visit animal sanctuary", "try fitness class",
"watch cultural performance", "try water sport", "throw axes", "have picnic", "buy groceries",
"mail postcard", "ride bicycle", "use public transport", "visit library", "attend community event",
"people-watch", "free tour", "visit school", "attend religious service", "explore neighborhood",
"get haircut", "shop at farmer's market", "attend political event", "work out", "try new cuisine",
"watch movie", "browse bookstore", "attend lecture", "go thrift shopping", "buy music",
"visit bathhouse", "watch sports practice", "visit community garden", "play at playground",
"attend town meeting", "visit courthouse", "admire public art", "explore cemetery",
"watch theater show", "visit fire station", "swim", "explore nature reserve",
"attend craft fair", "visit radio station", "try local dessert", "stargaze at observatory",
"listen to storytelling", "visit historical society", "attend auction", "tour recycling center",
"attend film festival", "visit animal shelter", "explore flea market", "visit art studio",
"listen to poetry", "visit community center", "watch game at sports bar", "tour vineyard",
"watch cooking demo", "eat a food truck meal", "play arcade games", "throw pottery",
"attend car show", "visit bakery", "enjoy carnival", "pick fruit at orchard",
"watch dance performance", "make cheese", "join pub quiz", "taste chocolate",
"enjoy food festival", "buy flowers", "play mini-golf", "eat ice cream",
"take art class", "watch coffee roasting", "play board games", "drink tea",
"attend beer festival", "taste spices", "join trivia night", "taste olive oil",
"paint and drink wine", "make soap", "sing karaoke", "buy candy",
"watch improv show", "drink kombucha", "solve escape room", "try on hats",
"attend poetry slam", "buy records", "throw axes", "shop for toys",
"watch stand-up comedy", "shop for antiques", "jump on trampolines", "pick herbs",
"take instrument lesson", "tip a busker", "go roller skating", "admire butterflies",
"knit", "shop for vintage clothes", "climb wall", "take language lesson",
"attend meetup", "forage mushrooms", "play ping pong", "practice local language",
"practice new language", "pick flowers", "try archery", "visit zoo",
"wander around", "visit a park", "paint pottery", "feed alpacas",
"visit aquarium", "ride a boat", "ride a bus", "ride a train/subway",
"get a foot massage", "get a massage", "try a local delicacy", "watch local TV",
"draw or paint a picture", "write a poem", "take landmark selfie", "take a funny photo",
"get a tower/high-up view", "enjoy a fancy meal"
];
// Create an Array of Objects of location-related information
var place = [];
place[0] = { place:"Seville, Spain", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/seville%402x.jpg')", photographer:"Henrique Ferreira", photographerLink:"https://unsplash.com/@rickpsd" };
place[1] = { place:"Detroit, USA", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/detroit%402x.jpg')", photographer:"Doug Zuba", photographerLink:"https://unsplash.com/@thezuba" };
place[2] = { place:"Canberra, Australia", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/canberra%402x.jpg')", photographer:"Social Estate", photographerLink:"https://unsplash.com/@socialestate" };
place[3] = { place:"Hamburg, Germany", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/hamburg%402x.jpg')", photographer:"Patrick Baum", photographerLink:"https://unsplash.com/@gecko81de" };
place[4] = { place:"Kaohsiung, Taiwan", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/kaohsiung%402x.jpg", photographer:"Dominik Vanyi", photographerLink:"https://unsplash.com/@dominik_photography" };
place[5] = { place:"Antwerp, Belgium", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/antwerp%402x.jpg", photographer:"Kristaps Grundsteins", photographerLink:"https://unsplash.com/@grundsteins" };
place[6] = { place:"Matera, Italy", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/matera%402x.jpg')", photographer:"carlo testa", photographerLink:"https://unsplash.com/@cha" };
place[7] = { place:"San Juan, Puerto Rico", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/sanjuan%402x.jpg')", photographer:"Cristian Escobar", photographerLink:"https://unsplash.com/@cristian1" };
place[8] = { place:"Guanajuato, Mexico", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/guanajuato%402x.jpg')", photographer:"Alfonso Navarro", photographerLink:"https://unsplash.com/@poncho_nj" };
place[9] = { place:"Oslo, Norway", photo:"url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/94276/oslo%402x.jpg')", photographer:"Vidar Nordli-Mathisen", photographerLink:"https://unsplash.com/@vidarnm" };
place[10] = { place:"Tokyo, Japan", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[11] = { place:"Rio de Janeiro, Brazil", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[12] = { place:"Cape Town, South Africa", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[13] = { place:"Venice, Italy", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[14] = { place:"Sydney, Australia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[15] = { place:"Marrakech, Morocco", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[16] = { place:"Reykjavik, Iceland", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[17] = { place:"Bangkok, Thailand", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[18] = { place:"Buenos Aires, Argentina", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[19] = { place:"Dublin, Ireland", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[20] = { place:"Amsterdam, Netherlands", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[21] = { place:"Prague, Czech Republic", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[22] = { place:"Istanbul, Turkey", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[23] = { place:"Seoul, South Korea", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[24] = { place:"Lisbon, Portugal", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[25] = { place:"Vancouver, Canada", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[26] = { place:"Dubrovnik, Croatia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[27] = { place:"Edinburgh, Scotland", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[28] = { place:"Singapore, Singapore", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[29] = { place:"Cusco, Peru", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[30] = { place:"Paris, France", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[31] = { place:"Rome, Italy", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[32] = { place:"London, United Kingdom", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[33] = { place:"New York City, USA", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[34] = { place:"Barcelona, Spain", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[35] = { place:"Dubai, United Arab Emirates", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[36] = { place:"San Francisco, USA", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[37] = { place:"Hong Kong, China", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[38] = { place:"Florence, Italy", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[39] = { place:"Vienna, Austria", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[40] = { place:"Bali, Indonesia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[41] = { place:"Berlin, Germany", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[42] = { place:"Kyoto, Japan", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[43] = { place:"Budapest, Hungary", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[44] = { place:"Athens, Greece", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[45] = { place:"Moscow, Russia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[46] = { place:"Queenstown, New Zealand", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[47] = { place:"Havana, Cuba", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[48] = { place:"Zurich, Switzerland", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[49] = { place:"Krakow, Poland", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[50] = { place:"Stockholm, Sweden", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[51] = { place:"Helsinki, Finland", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[52] = { place:"Copenhagen, Denmark", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[53] = { place:"Buenos Aires, Argentina", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[54] = { place:"Jerusalem, Israel", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[55] = { place:"Quebec City, Canada", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[56] = { place:"Bruges, Belgium", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[57] = { place:"Santorini, Greece", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[58] = { place:"Salzburg, Austria", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[59] = { place:"Chiang Mai, Thailand", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[60] = { place:"Cartagena, Colombia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[61] = { place:"Ljubljana, Slovenia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[62] = { place:"Porto, Portugal", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[63] = { place:"Dubrovnik, Croatia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[64] = { place:"San Sebastian, Spain", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[65] = { place:"Hanoi, Vietnam", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[66] = { place:"Luang Prabang, Laos", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[67] = { place:"Siem Reap, Cambodia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[68] = { place:"Hoi An, Vietnam", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[69] = { place:"Kuala Lumpur, Malaysia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[70] = { place:"Taipei, Taiwan", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[71] = { place:"Shanghai, China", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[72] = { place:"Beijing, China", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[73] = { place:"Jaipur, India", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[74] = { place:"Mumbai, India", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[75] = { place:"Cairo, Egypt", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[76] = { place:"Marrakesh, Morocco", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[77] = { place:"Nairobi, Kenya", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[78] = { place:"Cape Town, South Africa", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[79] = { place:"Zanzibar City, Tanzania", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[80] = { place:"Victoria Falls, Zimbabwe", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[81] = { place:"Petra, Jordan", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[82] = { place:"Beirut, Lebanon", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[83] = { place:"Tel Aviv, Israel", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[84] = { place:"Muscat, Oman", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[85] = { place:"Doha, Qatar", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[86] = { place:"Abu Dhabi, United Arab Emirates", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[87] = { place:"Medellin, Colombia", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[88] = { place:"Lima, Peru", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[89] = { place:"Santiago, Chile", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[90] = { place:"Montevideo, Uruguay", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[91] = { place:"Quito, Ecuador", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[92] = { place:"Mexico City, Mexico", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[93] = { place:"Oaxaca, Mexico", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[94] = { place:"Havana, Cuba", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[95] = { place:"Nassau, Bahamas", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[96] = { place:"Kingston, Jamaica", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
place[97] = { place:"Toronto, Canada", photo:"url('https://assets.codepen.io/94276/No+image+yet.png')", photographer:"Adam Ruf", photographerLink:"https://adamruf.com" };
// 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 = randPlace.place;
// Insert the location photo
document.getElementById('place-image').style.backgroundImage = randPlace.photo;
// Insert the photographer name
document.getElementById('photographer').innerHTML = randPlace.photographer;
// Insert the photographer link
document.getElementById('photographer-link').href = randPlace.photographerLink;
// Remove blur filter
document.getElementById('idea-container').removeAttribute("style");
}
// Set up the button to run the random-selection function
document.getElementById("trigger").onclick = function() { randomTripIdea() };
Also see: Tab Triggers