Skip to content

Instantly share code, notes, and snippets.

@dpwiz
Created June 23, 2011 08:20
Show Gist options
  • Save dpwiz/1042148 to your computer and use it in GitHub Desktop.
Save dpwiz/1042148 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Problems, writer?</title>
</head>
<body style="padding: 0px; margin: 0px; font: Droid; color: #222;">
<div style="width: 800px; margin: auto;">
<h1 style="font: 25pt;">Can't write? Try this:</h1>
<div style="min-height: 12em; width: 700px; margin: 8ex auto 0.5ex auto; border-top: 2px solid #eee; border-bottom: 2px solid #eee; padding: 16px 64px;">
<div id="tip" style="height: 100%; font: Droid 25pt; color: #333; padding-left: 2em; text-align: left;"></div>
</div>
<div style="font: 10pt 'Droid Sans'; color: #888; text-align: center;">
Not working? Try <span onclick="get_tip()" style="text-decoration: underline;">another one</span>!
</div>
<h3 style="font: 25pt; text-align: right">Now get back to your stuff!</h3>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>
function get_tip() {
var number = (Math.random() * 101).toFixed(0)
if (number.length == 2) { number = "0" + number }
else if (number.length == 1) { number = "00" + number }
$("#tip").load("tip"+ number +".html")
}
jQuery(get_tip)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment