搜索一下
关于
登录
首页
生活随笔
表面功夫
运筹帷幄
Godot游戏
0
0
分享
css特效之曲线导航菜单指示器
表面功夫
11 天前
相信神话
看一下展示效果 ![PixPin_2024-05-08_11-11-56.gif](http://www.agoodlife.cn/usr/uploads/2024/05/765858266.gif) HTML代码: ```html
曲线导航菜单指示器
Home
Profile
Message
Photo
Settings
``` CSS代码: ```css @import url("https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900"); * { margin: 0; padding: 0; box-sizing: border-box; font-family: "Poppins", sans-serif; } :root { --clr: #222327; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--clr); } .navigation { position: relative; display: flex; justify-content: center; align-items: center; width: 400px; height: 70px; background-color: #fff; border-radius: 10px; } .navigation ul { display: flex; width: 350px; } .navigation ul li { position: relative; list-style: none; width: 70px; height: 70px; z-index: 1; } .navigation ul li a { position: relative; display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100%; text-align: center; font-weight: 500; } .navigation ul li .icon { position: relative; display: block; line-height: 75px; font-size: 1.5em; text-align: center; transition: 0.5s; color: var(--clr); } .navigation ul li.active .icon { transform: translateY(-32px); } .navigation ul li .text { position: absolute; color: var(--clr); font-weight: 400; font-size: 0.75em; letter-spacing: 0.05em; transition: 0.5s; opacity: 0; transform: translateY(20px); } .navigation ul li.active .text { opacity: 1; transform: translateY(10px); } .indicator { position: absolute; top: -50%; width: 70px; height: 70px; background: #29fd53; border-radius: 50%; border: 6px solid var(--clr); transition: 0.5s; } .indicator::before { content: ""; position: absolute; top: 50%; left: -22px; width: 20px; height: 20px; background: transparent; border-top-right-radius: 20px; box-shadow: 1px -10px 0 0 var(--clr); } .indicator::after { content: ""; position: absolute; top: 50%; right: -22px; width: 20px; height: 20px; background: transparent; border-top-left-radius: 20px; box-shadow: -1px -10px 0 0 var(--clr); } .navigation ul li:nth-child(1).active ~ .indicator { transform: translateX(calc(70px * 0)); } .navigation ul li:nth-child(2).active ~ .indicator { transform: translateX(calc(70px * 1)); } .navigation ul li:nth-child(3).active ~ .indicator { transform: translateX(calc(70px * 2)); } .navigation ul li:nth-child(4).active ~ .indicator { transform: translateX(calc(70px * 3)); } .navigation ul li:nth-child(5).active ~ .indicator { transform: translateX(calc(70px * 4)); } ```
标签
css
html
评论
发表
没有更多啦
相信神话
江深竹静两三家,多事红花映白花。报答春光知有处,应须美酒送生涯
以蝼蚁之行,展鸿鹄之志
(本站总访问量 514 次)
热门文章
1
欢迎来到美好生活,让生活回归该有的样子
2
Javascript特效之鼠标悬停特效
3
Javascript特效之输入框点击效果
4
css特效之发光边角效果(炫酷、实用)
5
css特效之创意登录注册框
6
css特效之玻璃形态卡片悬停效果
7
css特效之曲线导航菜单指示器
8
css特效——使用 CSS Clip-path 的纯 CSS3 水波文本动画效果
9
CSS实用技巧——滚动页面菜单指示器导航
10
CSS特效之数据雨云效果——震撼啊
最新评论
1
ヾ(≧∇≦*)ゝ
2
欢迎加入 Typecho 大家族
日志存档
2024年05月
热门标签
css
html
javascript
其它
虫洞
开往
评论