css+js实现sony psp游戏机手柄效果代码
代码语言:html
所属分类:布局界面
代码描述:css+js实现sony psp游戏机手柄效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @font-face { font-family: BioRhyme; src: url("//repo.bfw.wiki/bfwrepo/font/biorhyme.woff") format("woff"); font-display: swap; } @font-face { font-family: Plation; src: url("//repo.bfw.wiki/bfwrepo/font/plation.woff2") format("woff2"), url("//repo.bfw.wiki/bfwrepo/font/plation.woff") format("woff"); font-display: swap; } @font-face { font-family: "BTSEPS2"; src: url("//repo.bfw.wiki/bfwrepo/font/btseps2.woff2") format("woff2"), url("//repo.bfw.wiki/bfwrepo/font/btseps2.woff") format("woff"); font-display: swap; } body { background: #223; margin: 0; } .container { display: flex; justify-content: center; margin-top: 9em; } .created { background: url(//repo.bfw.wiki/bfwrepo/image/62bd155f1c952.png), linear-gradient(to bottom, #884ced, #ec1cce); background-size: 75px 75px, cover; background-repeat: no-repeat; position: absolute; top: 0; right: 0; width: 250px; height: 75px; display: flex; flex-direction: column; align-items: center; padding-left: 2em; } .created span, .created h2, .created p, .created a { font-family: Montserrat; margin: 0; } .created a, .created p, .created span { color: #fff; } .created h2 { font-weight: 700; transform: translate(0, -4px); } .created a { -webkit-text-decoration-color: rgba(255,255,255,0.4); text-decoration-color: rgba(255,255,255,0.4); } .created a:hover { color: #e6e82a; } </style> </head> <body > <div class="container"> <console-psp></console-psp> </div> <script > class PSPRoundButton extends HTMLElement { constructor() { super(); this.attachShadow({ mode: "open" }); } static get styles() { return (/* css */` :host { } span { border-top: 1px solid #222; border-left: 1px solid #333; border-radius: 40%; padding: 1px 6px; } `); } connectedCallback() { this.text = this.getAttribute("text"); this.render(); } render() { this.shadowRoot.innerHTML = /* html */` <style>${PSPRoundButton.styles}</style> <span>${this.text}</span> `; }} customElements.define("psp-round-button", PSPRoundButton); class PSPLeftContents extends HTMLElement { constructor() { super(); this.attachShadow({ mode: "open" }); } static get styles() { return (/* css */` :host { display: flex; flex-direction: column; width: 90%; height: 100%; transform: translateX(-5%); } .logo { font-family: "Plation"; font-size: 50px; display: flex; transform: translate(-5px, -5px) scale(0.35); } .p { color: #ccc; transform: skewY(20deg) translateZ(40px) translateX(-4px) translateY(-7px); position: relative; font-size: 60px; perspective: 2000px; z-index: 10; } .s { position: absolute; z-index: 5; width: 58px; font-size: 70px; perspective: 1000px; transform: translateX(10px) skewX(381deg) skewY(355deg) rotateX(65deg) rotateY(12deg) rotateZ(308deg) translateX(0) t.........完整代码请登录后点击上方下载按钮下载查看
网友评论0