1 Star 0 Fork 39

MeenJ./OCDeer.css

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
button.css 13.38 KB
一键复制 编辑 原始数据 按行查看 历史
馒头拿来摸摸 提交于 2021-07-08 07:35 . update button.css.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
html,
body {
/* background-color: #000000; */
display: grid;
height: 100%;
place-items: center;
overflow: hidden;
}
/*流光溢彩*/
.btn-1 {
position: relative;
height: 60px;
width: 200px;
margin-top: 500px;
margin-left: 10px;
margin: 0 35px;
border-radius: 50px;
border: none;
outline: none;
background: #fff;
color: #111;
font-size: 20px;
letter-spacing: 2px;
cursor: pointer
}
.btn-1:first-child:hover {
background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
background-size: 400%;
}
.btn-1:last-child:hover {
background: linear-gradient(90deg, #fa7199, #f5ce62, #e43603, #fa7199);
background-size: 400%;
}
.btn-1:first-child:before,
.btn-1:last-child:before {
content: '';
position: absolute;
background: inherit;
top: -5px;
right: -5px;
bottom: -5px;
left: -5px;
border-radius: 50px;
filter: blur(20px);
opacity: 0;
transition: opacity 0.5s;
}
.btn-1:first-child:hover:before,
.btn-1:last-child:hover:before {
opacity: 1;
z-index: -1;
}
.btn-1:hover {
z-index: 1;
animation: glow 8s linear infinite;
}
@keyframes glow {
0% {
background-position: 0%;
}
100% {
background-position: 400%;
}
}
/*flash*/
.btn-2 {
border: 2px solid black;
background: transparent;
text-transform: uppercase;
color: black;
padding: 15px 50px;
outline: none;
overflow: hidden;
position: relative;
z-index: 20;
}
.btn-2:after {
content: "";
display: block;
position: absolute;
top: -36px;
left: -100px;
background: black;
width: 50px;
height: 125px;
opacity: 20%;
transform: rotate(-45deg);
}
.btn-2:hover::after {
left: 120%;
transition: all 600ms cubic-bezier(0.3, 1, 0.2, 1);
-webkit-transform: all 600ms cubic-bezier(0.3, 1, 0.2, 1);
}
/* 波动效果 */
.btn-3 {
width: 600px;
height: 400px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.btn-3 button {
left: 50%;
transform: translateX(-50%);
position: relative;
text-decoration: none;
font-size: 24px;
display: block;
width: 200px;
height: 40px;
text-align: center;
line-height: 40px;
overflow: hidden;
margin-top: 20px;
transition: 0.8s linear;
box-sizing: border-box;
}
.btn-3 button::before {
left: 0;
content: "";
position: absolute;
z-index: -1;
transition: 0.8s linear;
}
.btn-3 button.up {
color: #ff6348;
border: 1px solid #ff6348;
}
.btn-3 button.up::before {
top: 0;
width: 100%;
height: 0;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
background: #ff6348;
}
.btn-3 button.up:hover::before {
height: 200%;
}
.btn-3 button.up:hover {
color: black;
}
.btn-3 button.left {
color: #1e90ff;
border: 1px solid #1e90ff;
}
.btn-3 button.left::before {
top: 0;
width: 0;
height: 100%;
border-top-right-radius: 50%;
border-bottom-right-radius: 50%;
background: #1e90ff;
}
.btn-3 button.left:hover::before {
width: 200%;
}
.btn-3 button.left:hover {
color: white;
}
/* 流光边框 */
.btn-4 {
position: relative;
display: inline-block;
padding: 15px 30px;
color: #2196f3;
text-transform: uppercase;
letter-spacing: 4px;
text-decoration: none;
font-size: 24px;
overflow: hidden;
transition: 0.2s;
}
.btn-4 span {
position: absolute;
display: block;
}
.btn-4 span:nth-child(1) {
top: 0;
left: -100%;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, #2196f3);
}
.btn-4:hover span:nth-child(1) {
left: 100%;
transition: 1s;
}
.btn-4 span:nth-child(3) {
bottom: 0;
right: -100%;
width: 100%;
height: 2px;
background: linear-gradient(270deg, transparent, #2196f3);
}
.btn-4:hover span:nth-child(3) {
right: 100%;
transition: 1s;
transition-delay: 0.5s;
}
.btn-4 span:nth-child(2) {
top: -100%;
right: 0;
width: 2px;
height: 100%;
background: linear-gradient(180deg, transparent, #2196f3);
}
.btn-4:hover span:nth-child(2) {
right: 100%;
transition: 1.5s;
transition-delay: 0.5s;
}
.btn-4 span:nth-child(4) {
bottom: -100%;
left: 0;
width: 2px;
height: 100%;
background: linear-gradient(360deg, transparent, #2196f3);
}
.btn-4:hover span:nth-child(4) {
bottom: 100%;
transition: 1s;
transition-delay: 0.75s;
}
/* 折叠双层按钮 */
.btn-5 {
position: relative;
display: inline-block;
width: 160px;
height: 50px;
/* box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2); */
}
.btn-5 span {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #6c4ba5;
color: #ffaa7f;
display: flex;
align-items: center;
justify-content: center;
text-transform: uppercase;
font-size: 18px;
}
.btn-5 span:nth-child(2) {
color: #6c4ba5;
background: #ffaa7f;
overflow: hidden;
z-index: 2;
transition: 0.5s;
clip-path: polygon(59% 1%, 100% 0%, 100% 100%, 60% 100%, 40% 51%);
}
.btn-5 span:nth-child(2):hover {
clip-path: polygon(0 0, 100% 0%, 100% 100%, 0 100%, 0 54%);
}
.btn-5 span:nth-child(1):hover~span:nth-child(2) {
clip-path: polygon(100% 0, 100% 0%, 100% 100%, 100% 100%, 100% 52%);
}
/* btn6 */
.btn-6 {
position: relative;
padding: 10px 30px;
margin: 0 45px;
color: #21ebff;
text-decoration: none;
font-size: 20px;
text-transform: uppercase;
transition: 0.5s;
overflow: hidden;
-webkit-box-reflect: below 1px linear-gradient(transparent, #0003);
}
.btn-6:hover {
background: #21ebff;
color: #111;
box-shadow: 0 0 50px #21ebff;
transition-delay: 0.5s;
}
.btn-6:nth-child(1) {
filter: hue-rotate(115deg);
}
.btn-6:nth-child(3) {
filter: hue-rotate(270deg);
}
.btn-6::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
border-top: 2px solid #21ebff;
border-left: 2px solid #21ebff;
transition: 0.5s;
transition-delay: 0.5s;
}
.btn-6:hover::before {
width: 100%;
height: 100%;
transition-delay: 0s;
}
.btn-6::after {
content: '';
position: absolute;
right: 0;
bottom: 0;
width: 10px;
height: 10px;
border-bottom: 2px solid #21ebff;
border-right: 2px solid #21ebff;
transition: 0.5s;
transition-delay: 0.5s;
}
.btn-6:hover::after {
width: 100%;
height: 100%;
transition-delay: 0s;
}
/* 边框变色 */
.container {
text-align: center;
padding: 200px 0;
}
.btn-7 {
background: none;
border: 0;
outline: 0;
color: #2196f3;
font-family: 'JetBrains Mono';
font-size: 20px;
cursor: pointer;
border: 2px solid #2196f3;
width: 250px;
height: 50px;
position: relative;
}
.btn-7 label {
position: absolute;
left: 0;
top: 0;
line-height: 50px;
width: 100%;
height: 100%;
z-index: 1;
background-color: #FFFFFF;
}
.btn-7::before {
content: '';
position: absolute;
left: -2px;
top: -2px;
width: 0px;
height: 0;
z-index: 0;
background-color: #e94118;
transition: width .5s, height .5s;
}
.btn-7::after {
content: '';
position: absolute;
right: -2px;
bottom: -2px;
width: 0;
height: 0;
z-index: 0;
background-color: #e94118;
transition: width .5s, height .5s;
/* width: calc(100% + 4px);
height: calc(100% + 4px); */
}
.btn-7:hover {
color: #e94118;
}
.btn-7:hover::before {
width: calc(100% + 4px);
height: calc(100% + 4px);
}
.btn-7:hover::after {
width: calc(100% + 4px);
height: calc(100% + 4px);
}
/* 绘制边框 btn-8*/
.btn-8 {
position: relative;
width: 240px;
height: 60px;
text-align: center;
}
.rectangle {
stroke-width: 8px;
stroke: #ff6348;
fill: transparent;
/* Core part of the animation */
stroke-dasharray: 100 500;
stroke-dashoffset: -372;
}
.btn {
color: black;
font-size: 18px;
letter-spacing: 6px;
position: relative;
top: -48px;
}
@keyframes extend {
to {
stroke-dasharray: 600;
stroke-dashoffset: 0;
stroke-width: 2;
}
}
.btn-8:hover .rectangle {
animation: 0.5s extend linear forwards;
}
.btn-9 {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 180px;
height: 50px;
/* border: 1px solid #fff; */
background: #fff;
color: #ff6348;
font-size: 18px;
line-height: 50px;
text-align: center;
text-transform: uppercase;
text-decoration: none;
font-family: geneva;
}
.btn-9::before,
.btn-9::after,
.btn-9 span::before,
.btn-9 span::after {
content: '';
position: absolute;
width: 10px;
height: 10px;
background: #ff6348;
mix-blend-mode: hue;
transition: 1s;
}
.btn-9::before {
top: -2px;
left: -2px;
}
.btn-9::after {
top: -2px;
right: -2px;
}
.btn-9 span::before {
bottom: -2px;
left: -2px;
}
.btn-9 span::after {
bottom: -2px;
right: -2px;
}
/* 上下左右 */
.btn-9:hover::before,
.btn-9:hover::after,
.btn-9:hover span::before,
.btn-9:hover span::after {
width: calc(180px / 2);
height: calc(50px / 2);
}
/*波动按钮 btn-10*/
.btn-10 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: block;
padding: 10px 15px;
border: 1px solid #262626;
color: #262626;
text-transform: uppercase;
text-decoration: none;
letter-spacing: 2px;
transition: .5s;
}
.btn-10:hover {
background: #262626;
color: #fff;
}
.btn-10:before {
content: '';
position: absolute;
top: -1px;
left: -1px;
width: 100%;
height: 100%;
background: transparent;
border: 1px solid #262626;
}
.btn-10:hover:before {
transform: scale(1.2, 1.4);
opacity: 0;
transition: .5s;
}
/*btn-11 故障风*/
.btn-11,
.btn-11::after {
font-family: 'Do Hyeon', sans-serif;
width: 260px;
height: 80px;
text-align: center;
font-size: 22px;
line-height: 80px;
color: rgb(255, 251, 251);
background: linear-gradient(30deg, transparent 10%, rgb(255, 136, 0) 10% 95%, rgb(0, 255, 149) 95%);
box-shadow: 5px 0 0 rgb(0, 204, 255);
cursor: pointer;
position: relative;
}
.btn-11::after {
content: 'Button';
position: absolute;
top: 0;
left: 0;
text-shadow: -5px -2px 0 rgb(0, 183, 255),
5px 2px 0 rgb(0, 255, 115);
visibility: hidden;
}
.btn-11:hover::after {
animation: san 1s;
animation-timing-function: steps(1, end);
}
/*
clip-path: inset(20% -5px 60% 0);
clip-path: inset(50% -5px 30% 0);
clip-path: inset(80% -5px 5% 0);
clip-path: inset(0 -5px 80% 0);
*/
@keyframes san {
0% {
clip-path: inset(20% -5px 60% 0);
transform: translate(-6px, 5px);
visibility: visible;
}
10% {
clip-path: inset(50% -5px 30% 0);
transform: translate(6px, -5px);
}
20% {
clip-path: inset(20% -5px 60% 0);
transform: translate(5px, 0px);
}
30% {
clip-path: inset(80% -5px 5% 0);
transform: translate(-8px, 5px);
}
40% {
clip-path: inset(0 -5px 80% 0);
transform: translate(-4px, -3px);
}
50% {
clip-path: inset(50% -5px 30% 0);
transform: translate(-6px, -5px);
}
60% {
clip-path: inset(80% -5px 5% 0);
transform: translate(-7px, 5px);
}
70% {
clip-path: inset(0 -5px 80% 0);
transform: translate(3px, 6px);
}
80% {
clip-path: inset(50% -5px 30% 0);
transform: translate(5px, 5px);
}
90% {
clip-path: inset(20% -5px 60% 0);
transform: translate(6px, -5px);
}
100% {
clip-path: inset(0 -5px 80% 0);
transform: translate(1px, 5px);
}
}
/*btn-12 绘制边框-流光*/
.btn-12 {
position: relative;
width: 300px;
height: 95px;
color: rgb(18, 190, 243);
letter-spacing: 12px;
font-size: 35px;
line-height: 100px;
text-align: center;
text-transform: uppercase;
user-select: none;
text-decoration: none;
overflow: hidden;
/* box-shadow: inset 0 0 10px rgb(14, 20, 105), */
0 0 5px rgb(9, 208, 235);
transition: all 0.5s;
}
.btn-12:hover {
text-shadow: 0 0 5px rgb(18, 190, 243),
0 0 8px rgb(18, 190, 243),
0 0 10px rgb(18, 190, 243);
/* box-shadow: inset 0 0 10px rgb(14, 20, 105),
0 0 5px rgb(9, 208, 235),
0 0 10px rgb(9, 208, 235); */
}
.btn-12 span {
position: absolute;
}
.btn-12 span:nth-child(1) {
top: 0;
left: 0;
width: 100%;
height: 2px;
background-image: linear-gradient(to right, transparent, rgb(0, 153, 255));
animation: move1 2s linear infinite;
}
@keyframes move1 {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100%);
}
}
.btn-12 span:nth-child(2) {
top: 0;
right: 0;
width: 2px;
height: 100%;
transform: translateY(-100%);
background-image: linear-gradient(to bottom, transparent, rgb(0, 153, 255));
animation: move2 2s linear infinite;
animation-delay: 1s;
}
@keyframes move2 {
100% {
transform: translateY(100%);
}
}
.btn-12 span:nth-child(3) {
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-image: linear-gradient(to left, transparent, rgb(0, 153, 255));
animation: move3 2s linear infinite;
}
@keyframes move3 {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
.btn-12 span:nth-child(4) {
top: 0;
left: 0;
width: 2px;
height: 100%;
transform: translateY(100%);
background-image: linear-gradient(to top, transparent, rgb(0, 153, 255));
animation: move4 2s linear infinite;
animation-delay: 1s;
}
@keyframes move4 {
100% {
transform: translateY(-100%);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
CSS
1
https://gitee.com/MQueenJ/ocdeer.git
git@gitee.com:MQueenJ/ocdeer.git
MQueenJ
ocdeer
OCDeer.css
master

搜索帮助