Skip to content

Instantly share code, notes, and snippets.

@samplereality
Created February 11, 2015 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samplereality/d65c32336efd49fbfda5 to your computer and use it in GitHub Desktop.
Save samplereality/d65c32336efd49fbfda5 to your computer and use it in GitHub Desktop.
A web-based version of JustToSayBot
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>This Is Just To Say</title>
<meta name="description" content="This Is Just To Say" />
<style type="text/css">
body
{
color: black;
background-color: #fff;
margin: 0px
}
#header {
font-family: "Times New Roman", Times, serif;
font-size: 28px;
color: #333;
position: absolute;
top: 0;
left: 0;
margin-left: 2%;
padding-left: 40px;
}
h3 {
color: gray;
}
#title {
color: silver;
font-size: 24px;
font-style: italic;
}
#page {
width: 45%;
margin-top: 75px;
margin-bottom: auto;
margin-left: 1.5em;
padding: 40px;
color: #333;
text-align: left;
line-height: 1.25em;
font-size: 24px;
}
#footer
{
font-size: 11px;
font-family: Verdana, Geneva, Arial, sans-serif;
margin-top: 20px;
margin-left: 1.5em;
width: 50%;
}
.button {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background-color:#ededed;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#525252;
font-family:arial;
font-size:12px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #f8f8ff;
margin-right:20px;
margin-top: 10px;
margin-left:10px;
margin-bottom: 10px;
}.button:hover {
background-color:#dcdcdc;
}.button:active {
position:relative;
top:1px;
}
#btn
{
/*padding-left: 10%;
border-left: 1px dashed #66c;*/
position: fixed;
text-align: right;
top: 0;
left: 50%;
width:30%;
margin-top: 150px;
padding-left: 10%;
/*background-color:#9C3;*/
text-align:left;
}
#footer a {
text-decoration:none;
color:gray;
}
#footer a:hover {
background:silver;
}
</style>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="rita.js"></script>
<script>
lexicon = new RiLexicon();
window.onload = generate;
function generate()
{
plums = lexicon.randomWord('NNS',1);
icebox = lexicon.randomWord('NN',2);
delicious = lexicon.randomWord('JJ',3);
sweet = lexicon.randomWord('JJ',1);
cold = lexicon. randomWord('JJ',1);
result = "I have eaten<br>the " + plums + "<br>that were in<br>the " + icebox + "<p>" + "Forgive me<br>they were " + delicious + "<br>so " + sweet + "<br>and so " + cold;
changeTextSimple('apology', result);
}
function changeTextSimple(idElement, result){
document.getElementById(idElement).innerHTML = result;
}
</script>
</head>
<body>
<div id="header"><h3>This Is Just To Say</h3>
</div>
<div id="page">
<span id="apology"></span>
<div id="btn">
<a href="#" onclick="generate()" class="button">Another Apology</a><br>
<div id="footer">
A web version of <a href="https://twitter.com/JustToSayBot">Just to Say Bot</a>. <br>Made by <a href="http://www.samplereality.com">Mark Sample</a> with <a href="http://rednoise.org/rita/index.html">RiTa</a>.</div>
</div>
</div>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment