Skip to content

Instantly share code, notes, and snippets.

@shunkino
Forked from gucchan22/webrokeup.html
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save shunkino/cbc5ccb6669b79cff1e1 to your computer and use it in GitHub Desktop.

Select an option

Save shunkino/cbc5ccb6669b79cff1e1 to your computer and use it in GitHub Desktop.
We broke up
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>We broke up</title>
<link href='http://fonts.googleapis.com/css?family=Cookie' rel='stylesheet' type='text/css'>
<style type="text/css">
div#question {
font-size:4em;
font-family: 'Cookie', cursive;
-webkit-text-stroke-color: #000;
-webkit-text-stroke-width: 1px;
}
</style>
</head>
<body>
<h1>生まれ変わる7.24</h1>
<script type="text/javascript">
// "f", "j", "m", "q", "s", "x", "v" are not available right now.
// commit this if you're free.
// using Japanese to cover letters above.
// m -> midori, s -> murasaki, q -> quro??, f ->
var table = {
a:["black",3], b:["black",1], c:["black",4], d:["red",3], e:["red",2],
g:["green",4], h:["white",2], i:["white",3], k:["black",5], l:["purple",5],
n:["green",5], o:["yellow",5], p:["purple",1], r:["red",1], t:["white",4],
u:["purple",2],w:["white",1], y:["yellow",1]
};
var toggle = false;
function click_evt() {
if(toggle) {
document.getElementById("question").innerHTML = "";
}
var msg = document.getElementById("itext").value.replace(/\s+/g,"").toLowerCase();
for(var i = 0; i < msg.length; i++) {
document.getElementById("question").innerHTML += "<span style='color:"+table[msg[i]][0]+";'>"+table[msg[i]][1]+" </span>";
toggle = true;
}
}
</script>
<form action="" onsubmit="click_evt();return false;" accept-charset="utf-8">
<input type="text" id="itext" value="We broke up">
<input type="button" id="announce" onclick="click_evt()" value="what's your announcement?">
</form>
<div id="question"></div>
</body>
</html>
@shunkino

shunkino commented Aug 8, 2015

Copy link
Copy Markdown
Author

警告出た部分をちょっと修正。"y"じゃなくて"v"なのも地味に。

日本語にしても割と無理だった

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment