Created
August 31, 2012 22:32
-
-
Save kwood/3560131 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- saved from url=(0058)http://guidebook.com/guide/3672/web/?dataSource=paxxp.html --> | |
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> | |
<style> | |
html, body{ | |
background-color:#f9f9f9; | |
} | |
*{ | |
font-family:"Helvetica Neue", "Helvetica", Arial, sans-serif; | |
} | |
.container{ | |
padding:10px; | |
text-align:center; | |
} | |
.logo{ | |
background:transparent url(pax_xp_logo.png) left top no-repeat; | |
width:150px; | |
height:150px; | |
background-size:150px 150px; | |
-webkit-background-size:150px 150px; | |
-moz-background-size:150px 150px; | |
background-size:150px 150px; | |
margin:20px auto 50px auto; | |
} | |
#phrase{ | |
font-size:20px; | |
font-weight:bold; | |
color:#aaa; | |
} | |
#phrase .letters{ | |
color:#444; | |
} | |
.instructions{ | |
font-size:12px; | |
color:#666; | |
background-color:#eee; | |
display:inline-block; | |
padding:20px; | |
border-radius:5px; | |
margin-top:50px; | |
box-shadow:0 1px 1px rgba(0,0,0,.12); | |
} | |
.instructions strong{ | |
display:block; | |
font-size:14px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="logo"></div> | |
<div id="phrase">__ __ ________ ______ ______ ___ __________ __ _________ _________</div> | |
<p class="instructions"> | |
<strong>Huh?</strong> | |
It wasn't enough to fill a convention with gaming, so we made the convention itself a game! Scattered throughout the show you'll find a series of QR codes... you know, those square shaped barcodes? Scan all 19 codes to complete the phrase. Deliver the phrase to Info Desk, and you'll score yourself a sweet PAX XP Keychain. Good luck! | |
</p> | |
</div><!-- end container--> | |
<script> | |
var phrase = "__ __ ________ ______ ______ ___ __________ __ _________ _________"; | |
var startIndex = parseInt(url_query('start')); | |
var letters = url_query('letters'); | |
var reset = url_query('reset'); | |
var storedPhrase = window.localStorage["guide_3672_paxphrase"]; | |
var cookiePhrase = readCookie("paxphrase"); | |
if(storedPhrase == undefined && cookiePhrase != null) | |
storedPhrase = cookiePhrase; | |
if(cookiePhrase == null && storedPhrase != undefined) | |
cookiePhrase = storedPhrase; | |
var phraseElement = document.getElementById('phrase'); | |
if(isNaN(startIndex) || !letters) { | |
startIndex = 0; | |
letters = ''; | |
} | |
if(!storedPhrase || reset == 'true') { | |
phrase = fillInLetters(phrase, startIndex, letters); | |
} | |
else { | |
phrase = fillInLetters(storedPhrase, startIndex, letters); | |
} | |
window.localStorage["guide_3672_paxphrase"] = phrase; | |
createCookie("paxphrase", phrase, 7); | |
phraseElement.innerHTML = htmlFormat(phrase); | |
function fillInLetters(phrase, startIndex, letters) { | |
var newPhrase = phrase.slice(0, startIndex) + letters + phrase.slice(startIndex + letters.length) | |
return newPhrase; | |
} | |
function htmlFormat(phrase) { | |
return phrase.replace(/([^_ ]+)/g, '<span class="letters">$&</span>'); | |
} | |
function url_query( query ) { | |
query = query.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var expr = "[\\?&]"+query+"=([^&#]*)"; | |
var regex = new RegExp( expr ); | |
var results = regex.exec( window.location.href ); | |
if( results !== null ) { | |
return results[1]; | |
return decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} else { | |
return false; | |
} | |
} | |
function createCookie(name,value,days) { | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
var expires = "; expires="+date.toGMTString(); | |
} | |
else var expires = ""; | |
document.cookie = name+"="+value+expires+"; path=/"; | |
} | |
function readCookie(name) { | |
var nameEQ = name + "="; | |
var ca = document.cookie.split(';'); | |
for(var i=0;i < ca.length;i++) { | |
var c = ca[i]; | |
while (c.charAt(0)==' ') c = c.substring(1,c.length); | |
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); | |
} | |
return null; | |
} | |
</script> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment