js+css实现mac苹果电脑复制粘贴程序员专用键盘代码
代码语言:html
所属分类:布局界面
代码描述:js+css实现mac苹果电脑复制粘贴程序员专用键盘代码
代码标签: js css mac 苹果 电脑 复制 粘贴 程序员 专用 键盘 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> <style> * { border: 0; box-sizing: border-box; margin: 0; padding: 0; } :root { --hue: 0; --sat: 0%; --bg: hsl(var(--hue),var(--sat),90%); --fg: hsl(var(--hue),var(--sat),10%); --trans-dur: 0.3s; font-size: calc(16px + (24 - 16) * (100vw - 320px) / (2560 - 320)); } body, button { color: var(--fg); font: 1em/1.5 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif; } body { background-color: var(--bg); background-image: linear-gradient(-45deg,hsla(var(--hue),var(--sat),0%,0),hsla(var(--hue),var(--sat),0%,0.3)); display: flex; height: 100vh; transition: background-color var(--trans-dur), color var(--trans-dur); } .keyboard, .keyboard:before, .keyboard:after { transition: background-color var(--trans-dur), box-shadow var(--trans-dur); } .keyboard, .keyboard__key-lines { display: flex; } .keyboard { background-color: hsl(var(--hue),var(--sat),80%); background-image: linear-gradient(90deg,hsla(var(--hue),var(--sat),10%,0.4),hsla(var(--hue),var(--sat),10%,0)); border-radius: 0.75em; box-shadow: -0.5em -0.5em 0.75em hsla(0,0%,0%,0.6), 0 0 0 1px hsl(var(--hue),var(--sat),67%) inset; align-items: center; margin: auto; padding: 0.375em; position: relative; width: 18.5em; height: 6.5em; } .keyboard:before, .keyboard:after { background-color: hsl(var(--hue),var(--sat),90%); content: ""; display: block; position: absolute; bottom: 100%; } .keyboard:before { box-shadow: -0.5em -0.5em 0.75em hsla(0,0%,0%,0.6), 0.25em 0 0.25em hsla(var(--hue),var(--sat),10%,0.2) inset, 0.25em -1.25em 0.5em hsla(var(--hue),var(--sat),10%,0.5) inset; left: calc(50% - 0.5em); width: 1em; height: 40em; } .keyboard:after { border-radius: 0.25em 0.25em 0 0; box-shadow: 0.375em -0.25em 0.5em hsla(var(--hue),var(--sat),10%,0.5) inset; left: calc(50% - 0.75em); width: 1.5em; height: 1.25em; } .keyboard__cmd { display: block; width: 1em; height: 1em; } .keyboard__key { background-color: hsl(var(--hue),var(--sat),95%); border-radius: 0.5em; box-shadow: -0.4em -0.25em 0.25em hsla(0,0%,0%,0.25), 0 0 0 0.1em hsla(0,0%,0%,0.3), 0.04em 0.04em 0.04em hsla(0,0%,0%,0.4) inset, -0.1em -0.1em 0.04em hsla(0,0%,100%,0.8) inset; color: hsl(var(--hue),var(--sat),50%); margin: 0 0.375em; outline: transparent; padding: 0.75em; position: relative; width: 5em; height: 5em; transition: background-color var(--trans-dur), box-shadow 0.15s, color var(--trans-dur); -webkit-appearance: none; appearance: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; } .keyboard__key--meta { width: 5.5em; } .keyboard__key:active, .keyboard__key.active { box-shadow: 0 0 0.2em hsla(0,0%,0%,0.2), 0 0 0 0.1em hsla(0,0%,0%,0.4), 0 -0.05em 0 hsla(0,0%,0%,0.6) inset, -0.05em -0.15em 0.05em hsla(0,0%,100%,0.8) inset; } .keyboard__key-line { font-size: 2em; line-height: 1; } .keyboard__key-line--small { font-size: 0.875em; } .keyboard__key-line--tr { margin: 0 0 auto auto; } .keyboard__key-line--br { margin: auto 0 0 auto; } .keyboard__key-lines { display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100%; height: 100%; transition: transform 0.15s; } .keyboard__key:active .keyboard__key-lines, .keyboard__key.active .keyboard__key-lines { .........完整代码请登录后点击上方下载按钮下载查看
网友评论0