Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
File
Edit
Search
Options
Help
css
* { box-sizing: border-box; } body { min-height: 100vh; display: grid; grid-template-rows: -webkit-min-content 1fr -webkit-min-content; grid-template-rows: min-content 1fr min-content; font-family: "Inconsolata", monospace; font-weight: bold; letter-spacing: 0.03em; font-size: 1.25rem; line-height: 1; } nav { background-color: #a8a8a8; } nav ul { list-style: none; margin: 0; padding: 0.15rem 2rem; display: -webkit-box; display: flex; } nav ul li + li { margin-left: 1rem; } nav ul li:last-child { margin-left: auto; } main { background-color: #0b00a8; color: #a8a8a8; padding: 1.25rem 1rem; box-shadow: inset 0 0 0 7px #0b00a8, inset 0 0 0 9px currentcolor; position: relative; } main:focus { outline: none; } main:before { content: "HELLOWORLD.BAT"; position: absolute; top: 0; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); background-color: #a8a8a8; color: #0b00a8; padding: 0 0.75rem; } main span { display: -webkit-inline-box; display: inline-flex; } footer { background-color: #00a7a8; color: #fff; padding: 0.05rem 1rem; display: -webkit-box; display: flex; } footer span { margin-left: 2rem; } .cursor:after { content: ""; display: inline-block; width: 1ch; height: 1.1em; background-color: #0b00a8; margin: -0.03em 0 -0.03em -0.03em; } .cursor.active:after { -webkit-animation: cursor 400ms ease-in-out infinite; animation: cursor 400ms ease-in-out infinite; } @-webkit-keyframes cursor { 0%, 100% { background-color: #0b00a8; } 50% { background-color: #a8a8a8; } } @keyframes cursor { 0%, 100% { background-color: #0b00a8; } 50% { background-color: #a8a8a8; } }
JavaScript
const main = document.querySelector("main"); const hwArray = `HELLO WORLD`.split(""); const msgArray = `You may type your own content here.`.split(""); const typeSpeed = 130; const hwDuration = typeSpeed * hwArray.length; const msgDuration = typeSpeed * msgArray.length; const msgDelay = hwDuration + 300; const newLineDelay = hwDuration + msgDuration + 300; // Type scripted messages const type = (msgArray, target) => { msgArray.map((l, i) => { const letter = document.createTextNode(l); const delay = typeSpeed * i; setTimeout(() => { main.querySelector(target).appendChild(letter); }, delay); }); }; // Clear cursor animation from previous line // Only works for new lines, doesn't work if you backspace to previous line const clearCursor = () => { document.querySelector(".cursor.active").classList.remove("active"); }; // Create new line const newLine = () => { const line = document.createElement("DIV"); line.innerHTML = '
'; main.appendChild(line); clearCursor(); }; // Type initial greeting setTimeout(() => { type(hwArray, "span"); }, 1000); // Type instructions setTimeout(() => { newLine(); type(msgArray, "div span"); }, msgDelay + 1000); // Type new line for user content setTimeout(() => { newLine(); }, newLineDelay + 1000); // If new line, drop "active" class // from first active cursor to remove animation main.addEventListener("keydown", (e) => { const key = e.keyCode; if (key === 13) { setTimeout(() => { clearCursor(); }, 10); } });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>仿MS-DOS编辑器-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号