以下が具体的なコードになります。ランダムな文字列と文字サイズの設定、スタイルの調整にご注意ください。
```html
<!DOCTYPE html>
<html>
<head>
<title>Matrix-Style ASCII Animation</title>
<meta charset="utf-8">
<style>
/* スタイルの設定 */
body {
background: black;
color: #0F0;
font-family: "Courier New", monospace;
font-size: 12px;
letter-spacing: 2px;
line-height: 1.8em;
text-align: center;
}
.matrix {
margin: 0;
padding: 0;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
/* 効果を再現したいため、下のほど薄くなるように */
.fall {
opacity: 1;
filter: alpha(opacity=100);
position: absolute;
display: block;
top: -50px; /* スクロール位置の初期値 */
animation: drop 10s linear infinite; /* アニメーションの設定 */
}
/* 薄くするため、0.7ずつずらして暗い色にしていく */
.fall:nth-child(2n+1) {
color: rgba(0, 255, 0, 0.7);
animation-delay: 0.2s;
}
.fall:nth-child(3n+1) {
color: rgba(0, 255, 0, 0.5);
animation-delay: 0.4s;
}
.fall:nth-child(4n+1) {
color: rgba(0, 255, 0, 0.3);
animation-delay: 0.6s;
}
.fall:nth-child(5n+1) {
color: rgba(0, 255, 0, 0.1);
animation-delay: 0.8s;
}
@keyframes drop {
0% {
top: -50px;
}
100% {
top: 105%; /* スクロール位置の最終値 */
}
}
</style>
</head>
<body>
<!-- JavaScriptのランダムな文字列の生成 -->
<script>
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < Math.floor(30 + Math.random() * 20); i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
</script>
<!-- 文字列を垂直に表示する -->
<div class="matrix">
<script>
for (var i = 0; i < text.length; i++) {
// スペースを挿入してアスペクト比を調整する
var space = Math.floor(Math.random() * 5) + 5;
var cell = document.createElement("span");
cell.innerHTML = text.charAt(i) + Array(space).join(" ");
cell.className = "fall";
document.body.appendChild(cell);
}
</script>
</div>
</body>
</html>
```