Last active
December 17, 2015 10:39
-
-
Save sters/5596434 to your computer and use it in GitHub Desktop.
ohirune
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
<!-- | |
moved: https://github.com/sters/ohirunejs | |
--> | |
<html> | |
<body> | |
<a id="ohirune" target="_blank">おひるね</a> | |
<a id="okita" target="_blank">おきた</a> | |
<script type="text/javascript"> | |
(function(){ | |
function ohirune_web(mode){ | |
var ohuton = ["[▓▓]", "[__]"]; | |
var text = { | |
"okita" : ["おきたよっ", "ふわぁ…"], | |
"ohirune" : ["Zzz…", "おひるねするよっ"] | |
}; | |
var kao = { | |
"okita" : "(:3", | |
"ohirune" : "(¦3" | |
}; | |
var hashtag = " #おひるねサークル"; | |
mode = mode || "okita"; | |
if(kao[mode] == null || text[mode] == null) | |
return "なにかがおかしいよ"; | |
var t = text[mode]; | |
return t[parseInt(Math.random() * t.length)] | |
+ kao[mode] | |
+ ohuton[parseInt(Math.random() * ohuton.length)] | |
+ hashtag; | |
} | |
var share = "http://twitter.com/share?url=&text="; | |
var modes = ["okita", "ohirune"]; | |
for(var i=0; i<modes.length; i++) { | |
(function(mode){ | |
var element = document.getElementById(mode); | |
if(element == null) return; | |
element.onclick = function(){ | |
this.href = share + encodeURIComponent(ohirune_web(mode)); | |
}; | |
element.onclick(); | |
})(modes[i]); | |
} | |
})(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment