Skip to content

Instantly share code, notes, and snippets.

@closer
Created March 31, 2010 03:27
Show Gist options
  • Select an option

  • Save closer/349905 to your computer and use it in GitHub Desktop.

Select an option

Save closer/349905 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>Text Shadow</title>
</head>
<body>
<p id="text" style="text-align:center;line-height:120px;virtical-align:bottom;">HTML5(CSS3)</p>
<script type="text/javascript">
var $ = function(id){return document.getElementById(id)};
function setTextShadow(color, left, bottom, blur) {
$('text').style.textShadow = '' + color + ' ' + left + 'px ' + bottom + 'px ' + blur + 'px';
}
var left = 0, bottom = 0, blur = 0, font_size = 0, bairitsu = 1, rotate = 90;
setInterval(function(){
left += 0.1;
bottom += 0.1;
blur += 0.005;
font_size += 0.01;
bairitsu += 0.01;
rotate += 1;
setTextShadow("#F33", Math.sin(left) * Math.sin(bairitsu) * 50, Math.cos(bottom) * Math.sin(bairitsu) * 50, (Math.cos(blur) + 1) * 5);
$('text').style.fontSize = (25 + Math.sin(font_size) * 15) + 'px';
$('text').style.WebkitTransform = "rotate("+rotate+"deg)";
$('text').style.MozTransform = "rotate("+rotate+"deg)";
}, 5);
</script>
</body>
</html>
@closer
Copy link
Author

closer commented Mar 31, 2010

ドロップシャドウとかフォントサイズとかぐりぐりなるようにしてみた

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