Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Eyes on the screen
ESC
1
2
3
4
5
6
7
8
9
0
-
+
BACK
TAB
Q
W
E
R
T
Y
U
I
O
P
[
]
\
CAPS
A
S
D
F
G
H
J
K
L
:
''
ENTER
SHIFT
Z
X
C
V
B
N
M
,
.
;
SHIFT
Hands on the keyboard
css
body { background-color: black; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 500; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; } .title { color: mintcream; text-transform: uppercase; margin-top: 3em; margin-bottom: 3em; font-size: 1em; letter-spacing: 0.3em; } .keyboard { display: flex; flex-direction: column; } .row { list-style: none; display: flex; } li { height: 3em; width: 3em; color: rgba(0,0,0,0.7); border-radius: 0.4em; line-height: 3em; letter-spacing: 1px; margin: 0.4em; transition: 0.3s; text-align: center; font-size: 1em; } #tab { width: 5em; } #caps { width: 6em; } #left-shift { width: 8em; } #enter { width: 6em; } #right-shift { width: 8em; } #back { width: 5em; } .pinky { background-color: crimson; border: 2px solid crimson; } .pinky.selected { color: crimson; } .ring { background-color: coral; border: 2px solid coral; } .ring.selected { color: coral; } .middle { background-color: darkorange; border: 2px solid darkorange; } .middle.selected { color: darkorange; } .pointer1st { background-color: gold; border: 2px solid gold; } .pointer1st.selected { color: gold; } .pointer2nd { background-color: khaki; border: 2px solid khaki; } .pointer2nd.selected { color: khaki; } .fill-out-key { background-color: slategrey; border: 2px solid slategrey; } .selected { background-color: transparent; -webkit-animation: vibrate-1 0.3s linear infinite both; animation: vibrate-1 0.3s linear infinite both; } /* ---------------------------------------------- * Generated by Animista * Licensed under FreeBSD License. * See http://animista.net/license for more info. * w: http://animista.net, t: @cssanimista * ---------------------------------------------- */ .hit { -webkit-animation: hit 0.3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both; animation: hit 0.3s cubic-bezier(0.390, 0.575, 0.565, 1.000) both; } @-webkit-keyframes hit { 0% { -webkit-transform: scale(1.2); transform: scale(1.2); } 100% { -webkit-transform: scale(1); transform: scale(1); } } @keyframes hit { 0% { -webkit-transform: scale(1.2); transform: scale(1.2); } 100% { -webkit-transform: scale(1); transform: scale(1); } } @-webkit-keyframes vibrate-1 { 0% { -webkit-transform: translate(0); transform: translate(0); } 20% { -webkit-transform: translate(-2px, 2px); transform: translate(-2px, 2px); } 40% { -webkit-transform: translate(-2px, -2px); transform: translate(-2px, -2px); } 60% { -webkit-transform: translate(2px, 2px); transform: translate(2px, 2px); } 80% { -webkit-transform: translate(2px, -2px); transform: translate(2px, -2px); } 100% { -webkit-transform: translate(0); transform: translate(0); } } @keyframes vibrate-1 { 0% { -webkit-transform: translate(0); transform: translate(0); } 20% { -webkit-transform: translate(-2px, 2px); transform: translate(-2px, 2px); } 40% { -webkit-transform: translate(-2px, -2px); transform: translate(-2px, -2px); } 60% { -webkit-transform: translate(2px, 2px); transform: translate(2px, 2px); } 80% { -webkit-transform: translate(2px, -2px); transform: translate(2px, -2px); } 100% { -webkit-transform: translate(0); transform: translate(0); } }
JavaScript
const keys = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"]; const timestamps = []; timestamps.unshift(getTimestamp()); function getRandomNumber(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } function getRandomKey() { return keys[getRandomNumber(0, keys.length-1)] } function targetRandomKey() { const key = document.getElementById(getRandomKey()); key.classList.add("selected"); let start = Date.now() } function getTimestamp() { return Math.floor(Date.now() / 1000) } document.addEventListener("keyup", event => { const keyPressed = String.fromCharCode(event.keyCode); const keyElement = document.getElementById(keyPressed); const highlightedKey = document.querySelector(".selected"); keyElement.classList.add("hit") keyElement.addEventListener('animationend', () => { keyElement.classList.remove("hit") }) if (keyPressed === highlightedKey.innerHTML) { timestamps.unshift(getTimestamp()); const elapsedTime = timestamps[0] - timestamps[1]; console.log(`Character per minute ${60/elapsedTime}`) highlightedKey.classList.remove("selected"); targetRandomKey(); } }) targetRandomKey();
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>键盘英雄-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号