Từ Trường THPT chuyên Hoàng Văn Thụ, Hòa Bình
Thông tin
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Code Animation</title>
<style>
body {
background-color: black;
color: #00ff00;
font-family: monospace;
padding: 20px;
}
.terminal {
border: 2px solid #00ff00;
padding: 10px;
width: 600px;
height: 200px;
overflow: hidden;
}
</style>
</head>
<body>
<div class="terminal">
<span id="code"></span>
</div>
<script>
const code = `
include <bits/stdc++.h>
using namespace std; const string fix = "LeThanhTung ⟶ "; class LeThanhTung { private: bool handsome, clever, smart; string since; public: void nhap(bool handsome, bool clever, string since) { this->handsome = handsome; this->clever = clever; this->since = since; } void print() { string vara = handsome ? "Dep trai: " : "None\n"; cout << fix << vara << endl; } }; `; let index = 0; function typeCode() { if (index < code.length) { document.getElementById("code").innerHTML += code[index]; index++; setTimeout(typeCode, 30); } } typeCode(); </script> </body> </html>