Skip to content

Instantly share code, notes, and snippets.

@rskull
Last active November 21, 2023 14:28
Show Gist options
  • Save rskull/1508075 to your computer and use it in GitHub Desktop.
Save rskull/1508075 to your computer and use it in GitHub Desktop.
I LOVE YOU
<!DOCTYPE html>
<html>
<head>
<title>I LOVE YOU</title>
<script>
onload = function () {
var d = document;
// フェードイン
function feedin (feed, speed) {
var filter = 0;
feed.style.opacity = 0;
feed.style.MozOpacity = 0;
var timer = setInterval(function () {
filter ++;
feed.style.opacity = (filter / 10);
feed.style.MozOpacity = (filter / 10);
if (filter == 10) {
clearInterval(timer);
}
},speed);
}
// I LOVE YOU
var str = [
[36,37,38,72,107,142,176,177,178],
[41,76,111,146,181,182,183],
[185,150,115,80,45,46,47,82,117,152,187],
[186,49,84,119,154,190],
[156,121,86,51,53,54,55,88,123,158,193,124,125,194,195],
[58,93,128,129,130,95,60,164,199],
[202,167,132,97,62,63,64,99,134,169,204],
[203,66,101,136,171,206,207,208,173,138,103,68]
];
// ブロック表示
for (i=0;i<245;i++) {
var box = d.createElement('div');
with (d.body.appendChild(box).style) {
if (i % 35 == 0) { clear = 'both'; }
border = 'solid #222 1px';
width = '20px';
height = '20px';
margin = '2px';
float = 'left';
}
}
// メッセージ表示
var mess = d.getElementsByTagName('div');
var i = 0, j = 0;
setInterval(function () {
feedin(mess[str[i][j]], 25);
mess[str[i][j]].style.background = '#F39'
j++;
if (i == str.length) { clearInterval(timer); }
if (j == str[i].length) { i++; j = 0; }
}, 50);
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment