div+Css布局实现苹果电子笔效果代码
代码语言:html
所属分类:布局界面
代码描述:div+Css布局实现苹果电子笔效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"> <style> body { font-size: 10px; background-size: 1450px; background-position: 50% -10%; font-family: "Roboto", sans-serif; background-color: #fff; } .pencil { background-repeat: no-repeat; } .pencil--body { font-size: 1.5vmin; width: 3.1em; height: 54em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .pencil--inner { width: 100%; height: 54em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-top-right-radius: 1.5em; border-top-left-radius: 1.5em; box-shadow: inset rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, inset #d7d7d7 -0.5em 0px 17px -0.5em; background: linear-gradient(to bottom, transparent 70%, #EFEFEF 87%, rgba(239, 239, 239, 0.25) 95%) 50% 50%/100% 100%, linear-gradient(to right, #f1f1f1, rgba(251, 251, 251, 0.5) 25%, #fbfbfb 25%, #f2f2f2 75%) 50% 50%/100% 100%, #f1f1f1; background-repeat: no-repeat; } .pencil--center { width: 43%; height: 88%; position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); border-radius: 1em; background: #f2f2f2; box-shadow: inset rgba(60, 64, 67, 0.2) 0px 0em 2px 0px, rgba(60, 64, 67, 0.05) 0px 1px 3px 1px, inset 0.15em 0 0.3em -0.15em #fff, white 0px 0px 0.24em 0.05em; } .pencil--text { color: #75767A; font-weight: 400; font-style: normal; position: absolute; transform: rotate(-90deg); top: 5.5%; left: -65%; letter-spacing: 0em; font-size: 0.8em; display: flex; gap: 0.25em; align-items: center; } .pencil--text svg { fill: #75767A; height: 1.25em; } .pencil--top-line { width: 100%; height: 0.1em; background: orange; position: absolute; top: 13.6%; background: linear-gradient(to right, #b1b2b4, #cecfd1, #adafae 50%, #858688) 50% 50%/80% 100%, #fff; background-repeat: no-repeat; } .pencil--tip { width: 100%; height: 6.3em; position: absolute; bottom: 0%; z-index: 99; background: radial-gradient(150% 100% at 50% 0%, rgba(223, 223, 223, .........完整代码请登录后点击上方下载按钮下载查看
网友评论0