css实现立体块状菜单悬浮模糊效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现立体块状菜单悬浮模糊效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html> <html> <head> <meta charset="utf-8"> <style> @import url('https://fonts.googleapis.com/css?family=Oswald:400,700'); * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Oswald', sans-serif; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #434750; } ul { position: relative; transform: skewY(-15deg); } ul li { position: relative; list-style: none; width: 200px; background: #3e3f46; padding: 15px; z-index: var(--i); transition: 0.5s; } ul li:hover { background: #33a3ee; transform: translateX(-50px); transform: scale(0.8); filter: blur(calc(var(--card-height) / 10)); background-image: linear-gradient( var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2); opacity: 1; transition: opacity .5s; animation: spin 2.5s linear infinite; } @keyframes spin { 0% { --rotate: 0deg; } 100% { --rotate: 360deg; } } @property --rotate { syntax: "<angle>"; initial-value: 132deg; inherits: false; } :root { --card-height: 65vh; --card-width: calc(var(--card-height) / 1.5); } body { min-height: 100vh; background: #212534; display: flex; align-items: center; flex-direction: column; padding-top: 2rem; padding-bottom: 2rem; box-sizing: border-box; } .card { background: #191c29; width: var(--card-width); height: var(--card-height); padding: 3px; position: relative; border-radius: 6px; justify-content: center; align-items: center; text-align: center; display: flex; font-size: 1.5em; color: rgb(88 199 250 / 0%); cursor: pointer; font-family: cursive; } .card:hover { color: rgb(88 199 250 / 100%); transition: color 1s; } .card:hover:before, .card:hover:after { animation: none; opacity: 0; } .card::before { content: ""; width: 104%; height: 102%; border-radius: 8px; background-image: linear-gradient( .........完整代码请登录后点击上方下载按钮下载查看
网友评论0