纯css实现任天堂游戏机布局效果
代码语言:html
所属分类:布局界面
代码描述:纯css实现任天堂游戏机布局效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <style> :root { --red: #FA4233; --blue: #00ABD1; --scene-bg: hotpink; --switch-width: 77.12vw; --switch-height: 32.48vw; --switch-body-width: 55.52vw; --screen-bg: #030303; --screen-body-bg: #2C2E2F; --screen-inner-bg: #1E1E1E; --screen-reflect-color: rgba(255, 255, 255, 0.1); --screen-width: 52.8vw; --screen-height: 29.84vw; --screen-inner-width: 44.64vw; --screen-inner-height: 24.4vw; --joycon-width: 10.72vw; --joycon-button-bg: #323639; } *, *::before, *::after { box-sizing: border-box; } body { margin: 0; font-family: sans-serif; } .scene { width: 100vw; height: 100vh; background-color: var(--scene-bg); display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; } .switch { position: relative; width: var(--switch-width); height: var(--switch-height); } .screen { width: var(--screen-width); height: var(--screen-height); border-radius: 0.48vw; background-color: var(--screen-bg); display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; } .screen-body { width: var(--switch-body-width); height: 100%; position: absolute; bottom: 0; left: var(--joycon-width); border-radius: 0.32vw; background-color: var(--screen-body-bg); display: -webkit-box; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; } .screen-body::before, .screen-body::after { content: ""; width: 0.8vw; height: 1.28vw; position: absolute; top: 0; z-index: 1; background-color: var(--scene-bg); } .screen-body::before { .........完整代码请登录后点击上方下载按钮下载查看
网友评论0