button.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. </head>
  6. <body>
  7. <div class="btns">
  8. <div class="btn java">JAVA攻城狮</div>
  9. <div class="btn golang">Golang工程师!</div>
  10. <div class="btn js"><span>js攻城狮</span></div>
  11. <div class="btn nodd-ruby ruby">
  12. <div class="anim"></div>
  13. <span>Ruby攻城狮</span>
  14. </div>
  15. <div class="btn vb">
  16. <span>VB攻城狮</span>
  17. <div class="dot"></div>
  18. </div>
  19. <div class="btn python python-1">python攻城狮</div>
  20. <div class="btn python python-2">python攻城狮</div>
  21. <div class="btn python python-3">python攻城狮</div>
  22. <div class="btn python python-4">python攻城狮</div>
  23. <div class="btn python python-5">python攻城狮</div>
  24. <div class="btn php php-1">php攻城狮</div>
  25. <div class="btn php php-2">php攻城狮</div>
  26. <div class="btn php php-3">php攻城狮</div>
  27. <div class="btn php php-4">php攻城狮</div>
  28. <div class="btn php php-5">php攻城狮</div>
  29. <div class="btn kotlin kotlin-3">kotlin攻城狮</div>
  30. <div class="btn kotlin kotlin-1">kotlin攻城狮</div>
  31. <div class="btn kotlin kotlin-4">kotlin攻城狮</div>
  32. <div class="btn kotlin kotlin-2">kotlin攻城狮</div>
  33. <div class="btn kotlin kotlin-5">kotlin攻城狮</div>
  34. <div class="btn c">C语言攻城狮</div>
  35. </div>
  36. </body>
  37. <style>
  38. .text-info {
  39. position: absolute;
  40. top: calc(50vh - 245px);
  41. text-align: center;
  42. font-size: 12px;
  43. color: #999;
  44. width: 100%;
  45. margin-left: -5px;
  46. }
  47. .btn {
  48. vertical-align: top;
  49. margin: 20px;
  50. display: inline-block;
  51. text-align: center;
  52. width: 160px;
  53. height: 44px;
  54. line-height: 44px;
  55. border-radius: 4px;
  56. color: #fff;
  57. cursor: pointer;
  58. }
  59. .java {
  60. color: #EB9E05;
  61. height: 42px;
  62. line-height: 42px;
  63. width: 158px;
  64. border: 1px solid #EB9E05;
  65. opacity: 1;
  66. transition: all .6s;
  67. }
  68. .java:hover {
  69. background: #EB9E05;
  70. color: #fff;
  71. }
  72. .java:active {
  73. opacity: .7;
  74. }
  75. .c {
  76. height: 44px;
  77. line-height: 44px;
  78. background: #55acee;
  79. transition: all .5s;
  80. box-shadow: 0px 5px 0px 0px #3486d5;
  81. }
  82. .c:hover {
  83. background-color: #6FC6FF;
  84. }
  85. .c:active {
  86. transform: translate(0px, 4px);
  87. -webkit-transform: translate(0px, 4px);
  88. box-shadow: 0px 1px 0px 0px #3486d5;
  89. }
  90. @keyframes sheen {
  91. 0% {
  92. transform: skewY(-45deg) translateX(0);
  93. }
  94. 100% {
  95. transform: skewY(-45deg) translateX(12.5em);
  96. }
  97. }
  98. .golang {
  99. vertical-align: top;
  100. height: 42px;
  101. line-height: 42px;
  102. width: 158px;
  103. color: #2194E0;
  104. border: 1px solid #2194E0;
  105. transition: all 0.2s ease-in-out;
  106. position: relative;
  107. opacity: 1;
  108. overflow: hidden;
  109. }
  110. .golang:before {
  111. content: "";
  112. background-color: rgba(255, 255, 255, 0.5);
  113. height: 100%;
  114. width: 3em;
  115. display: block;
  116. position: absolute;
  117. top: 0;
  118. left: -4.5em;
  119. transform: skewX(-45deg) translateX(0);
  120. transition: none;
  121. }
  122. .golang:hover {
  123. background-color: #2194E0;
  124. color: #fff;
  125. }
  126. .golang:hover:before {
  127. transform: skewX(-45deg) translateX(260px);
  128. transition: all 0.5s ease-in-out;
  129. }
  130. .golang:active {
  131. opacity: .8;
  132. }
  133. .js {
  134. width: 160px;
  135. height: 42px;
  136. line-height: 42px;
  137. background: #0D6;
  138. width: 158px;
  139. border: 1px solid #0D6;
  140. overflow: hidden;
  141. transition: all 0.5s;
  142. opacity: 1;
  143. }
  144. .js:hover,
  145. .js:active {
  146. text-decoration: none;
  147. color: #0C5;
  148. border-color: #0C5;
  149. background: #FFF;
  150. }
  151. .js:active {
  152. opacity: .8;
  153. }
  154. .js span {
  155. display: inline-block;
  156. position: relative;
  157. padding-right: 0;
  158. transition: padding-right 0.5s;
  159. }
  160. .js span:after {
  161. content: ' ';
  162. position: absolute;
  163. top: 0;
  164. right: -18px;
  165. opacity: 0;
  166. width: 10px;
  167. height: 10px;
  168. margin-top: -10px;
  169. background: rgba(0, 0, 0, 0);
  170. border: 2px solid #FFF;
  171. border-top: none;
  172. border-right: none;
  173. transition: opacity 0.5s, top 0.5s, right 0.5s;
  174. transform: rotate(-140deg);
  175. }
  176. .js:hover span,
  177. .js:active span {
  178. padding-right: 30px;
  179. }
  180. .js:hover span:after,
  181. .js:active span:after {
  182. transition: opacity 0.5s, top 0.5s, right 0.5s;
  183. opacity: 1;
  184. border-color: #0C5;
  185. right: 0;
  186. top: calc(50% + 2.5px);
  187. transform: rotate(-140deg);
  188. }
  189. .nodd-ruby {
  190. background: #C147E6;
  191. position: relative;
  192. overflow: hidden;
  193. z-index: 0;
  194. cursor: pointer;
  195. opacity: 1;
  196. transition: all .3s
  197. }
  198. input[type="checkbox"].toggle {
  199. -moz-appearance: none;
  200. -webkit-appearance: none;
  201. position: absolute;
  202. width: 100%;
  203. height: 100%;
  204. margin: 0;
  205. left: 0;
  206. top: 0;
  207. cursor: pointer;
  208. }
  209. input[type="checkbox"].toggle:focus {
  210. outline: 0;
  211. }
  212. .anim {
  213. transform: translate(-50%, -50%);
  214. position: absolute;
  215. top: 50%;
  216. left: 50%;
  217. z-index: -1;
  218. }
  219. .anim:before {
  220. position: relative;
  221. content: '';
  222. display: block;
  223. margin-top: 100%;
  224. }
  225. .anim:after {
  226. content: '';
  227. position: absolute;
  228. top: 0;
  229. bottom: 0;
  230. left: 0;
  231. right: 0;
  232. border-radius: 50%;
  233. }
  234. .node .toggle:checked+.anim {
  235. animation: .75s anim-in;
  236. }
  237. .node .toggle:checked+.anim:after {
  238. animation: anim-in-pseudo 0.75s;
  239. }
  240. .node .toggle:not(:checked)+.anim {
  241. animation: anim-out 0.75s;
  242. }
  243. .node .toggle:not(:checked)+.anim:after {
  244. animation: anim-out-pseudo 0.75s;
  245. }
  246. .node {
  247. background: #ed3f14;
  248. }
  249. .node:hover {
  250. opacity: .8;
  251. }
  252. .ruby:active {
  253. opacity: .8;
  254. }
  255. .ruby:hover>.anim {
  256. animation: anim-out 0.75s;
  257. }
  258. .ruby:hover>.anim:after {
  259. animation: anim-out-pseudo 0.75s;
  260. }
  261. @-webkit-keyframes anim-in {
  262. 0% {
  263. width: 0%;
  264. }
  265. 100% {
  266. width: 100%;
  267. }
  268. }
  269. @-moz-keyframes anim-in {
  270. 0% {
  271. width: 0%;
  272. }
  273. 100% {
  274. width: 100%;
  275. }
  276. }
  277. @-ms-keyframes anim-in {
  278. 0% {
  279. width: 0%;
  280. }
  281. 100% {
  282. width: 100%;
  283. }
  284. }
  285. @keyframes anim-in {
  286. 0% {
  287. width: 0%;
  288. }
  289. 100% {
  290. width: 100%;
  291. }
  292. }
  293. @-webkit-keyframes anim-in-pseudo {
  294. 0% {
  295. background: rgba(0, 0, 0, 0.3);
  296. }
  297. 100% {
  298. background: transparent;
  299. }
  300. }
  301. @-moz-keyframes anim-in-pseudo {
  302. 0% {
  303. background: rgba(0, 0, 0, 0.3);
  304. }
  305. 100% {
  306. background: transparent;
  307. }
  308. }
  309. @-ms-keyframes anim-in-pseudo {
  310. 0% {
  311. background: rgba(0, 0, 0, 0.3);
  312. }
  313. 100% {
  314. background: transparent;
  315. }
  316. }
  317. @keyframes anim-in-pseudo {
  318. 0% {
  319. background: rgba(0, 0, 0, 0.3);
  320. }
  321. 100% {
  322. background: transparent;
  323. }
  324. }
  325. @-webkit-keyframes anim-out {
  326. 0% {
  327. width: 0%;
  328. }
  329. 100% {
  330. width: 100%;
  331. }
  332. }
  333. @-moz-keyframes anim-out {
  334. 0% {
  335. width: 0%;
  336. }
  337. 100% {
  338. width: 100%;
  339. }
  340. }
  341. @-ms-keyframes anim-out {
  342. 0% {
  343. width: 0%;
  344. }
  345. 100% {
  346. width: 100%;
  347. }
  348. }
  349. @keyframes anim-out {
  350. 0% {
  351. width: 0%;
  352. }
  353. 100% {
  354. width: 100%;
  355. }
  356. }
  357. @-webkit-keyframes anim-out-pseudo {
  358. 0% {
  359. background: rgba(0, 0, 0, 0.35);
  360. }
  361. 100% {
  362. background: transparent;
  363. }
  364. }
  365. @-moz-keyframes anim-out-pseudo {
  366. 0% {
  367. background: rgba(0, 0, 0, 0.35);
  368. }
  369. 100% {
  370. background: transparent;
  371. }
  372. }
  373. @-ms-keyframes anim-out-pseudo {
  374. 0% {
  375. background: rgba(0, 0, 0, 0.35);
  376. }
  377. 100% {
  378. background: transparent;
  379. }
  380. }
  381. @keyframes anim-out-pseudo {
  382. 0% {
  383. background: rgba(0, 0, 0, 0.35);
  384. }
  385. 100% {
  386. background: transparent;
  387. }
  388. }
  389. .python {
  390. transition: 0.5s;
  391. background-size: 200% auto;
  392. }
  393. .python:hover {
  394. background-position: right center;
  395. }
  396. .python-1 {
  397. background-image: linear-gradient(to right, #f6d365 0%, #fda085 51%, #f6d365 100%);
  398. }
  399. .python-2 {
  400. background-image: linear-gradient(to right, #fbc2eb 0%, #a6c1ee 51%, #fbc2eb 100%);
  401. }
  402. .python-3 {
  403. background-image: linear-gradient(to right, #84fab0 0%, #8fd3f4 51%, #84fab0 100%);
  404. }
  405. .python-4 {
  406. background-image: linear-gradient(to right, #a1c4fd 0%, #c2e9fb 51%, #a1c4fd 100%);
  407. }
  408. .python-5 {
  409. background-image: linear-gradient(to right, #ffecd2 0%, #fcb69f 51%, #ffecd2 100%);
  410. }
  411. .php,
  412. .php::after {
  413. -webkit-transition: all 0.5s;
  414. -moz-transition: all 0.5s;
  415. -o-transition: all 0.5s;
  416. transition: all 0.5s;
  417. }
  418. .php {
  419. border: 1px solid #C147E6;
  420. color: #C147E6;
  421. width: 158px;
  422. height: 42px;
  423. line-height: 42px;
  424. position: relative;
  425. z-index: 1;
  426. text-transform: uppercase;
  427. }
  428. .php:hover {
  429. color: #fff;
  430. }
  431. .php::before,
  432. .php::after {
  433. background: #C147E6;
  434. content: '';
  435. position: absolute;
  436. z-index: -2;
  437. border-radius: 3px;
  438. }
  439. .php-1::after {
  440. height: 0;
  441. left: 0;
  442. top: 0;
  443. width: 100%;
  444. }
  445. .php-1:hover:after {
  446. height: 100%;
  447. }
  448. .php-2::after {
  449. height: 100%;
  450. left: 0;
  451. top: 0;
  452. width: 0;
  453. }
  454. .php-2:hover:after {
  455. width: 100%;
  456. }
  457. .php-3::after {
  458. height: 0;
  459. left: 50%;
  460. top: 50%;
  461. width: 0;
  462. }
  463. .php-3:hover:after {
  464. height: 100%;
  465. left: 0;
  466. top: 0;
  467. width: 100%;
  468. }
  469. .php-4::before {
  470. height: 100%;
  471. left: 0;
  472. top: 0;
  473. width: 100%;
  474. }
  475. .php-4::after {
  476. background: #fff;
  477. height: 100%;
  478. left: 0;
  479. top: 0;
  480. width: 100%;
  481. }
  482. .php-4:hover:after {
  483. height: 0;
  484. left: 50%;
  485. top: 50%;
  486. width: 0;
  487. }
  488. .php-5 {
  489. overflow: hidden;
  490. }
  491. .php-5::after {
  492. height: 100%;
  493. left: -35%;
  494. top: 0;
  495. transform: skew(50deg);
  496. transition-duration: 0.6s;
  497. transform-origin: top left;
  498. width: 0;
  499. }
  500. .php-5:hover:after {
  501. height: 100%;
  502. width: 135%;
  503. }
  504. .kotlin {
  505. background: none;
  506. border: 1px solid;
  507. width: 158px;
  508. height: 42px;
  509. line-height: 42px;
  510. letter-spacing: inherit;
  511. text-transform: inherit;
  512. transition: color 1s;
  513. }
  514. .kotlin-1 {
  515. color: #9c89f7;
  516. }
  517. .kotlin-1:hover {
  518. animation: halftone 1s forwards;
  519. background: radial-gradient(circle, #9c89f7 0.2em, transparent 0.25em) 0 0/1.25em 1.25em, radial-gradient(circle, #9c89f7 0.2em, transparent 0.25em) 6.25em 6.25em/1.25em 1.25em;
  520. color: #e4f789;
  521. }
  522. @keyframes halftone {
  523. 100% {
  524. background-size: 2.375em 2.375em, 0.1em 0.1em;
  525. }
  526. }
  527. .kotlin-2 {
  528. color: #82f6d8;
  529. }
  530. .kotlin-2:hover {
  531. animation: stripes-move 0.75s infinite linear;
  532. background: repeating-linear-gradient(45deg, #82f6d8 0, #82f6d8 0.25em, transparent 0.25em, transparent 0.5em);
  533. color: #f682a0;
  534. }
  535. @keyframes stripes-move {
  536. 100% {
  537. background-position: 5em 0px;
  538. }
  539. }
  540. .kotlin-3 {
  541. color: #d3f169;
  542. }
  543. .kotlin-3:hover {
  544. animation: sawtooth 0.35s infinite linear;
  545. background: linear-gradient(45deg, #d3f169 0.5em, transparent 0.5em) 0 0/1em 1em, linear-gradient(-45deg, #d3f169 0.5em, transparent 0.5em) 0 0/1em 1em;
  546. color: #8769f1;
  547. }
  548. @keyframes sawtooth {
  549. 100% {
  550. background-position: 1em 0;
  551. }
  552. }
  553. .kotlin-4 {
  554. color: #eea163;
  555. }
  556. .kotlin-4:hover {
  557. animation: zigzag 1s linear infinite;
  558. background: linear-gradient(135deg, rgba(238, 161, 99, 0.25) 0.25em, transparent 0.25em) -0.5em 0, linear-gradient(225deg, rgba(238, 161, 99, 0.25) 0.25em, transparent 0.25em) -0.5em 0, linear-gradient(315deg, rgba(238, 161, 99, 0.25) 0.25em, transparent 0.25em) 0 0, linear-gradient(45deg, rgba(238, 161, 99, 0.25) 0.25em, transparent 0.25em) 0 0;
  559. background-size: 0.75em 0.75em;
  560. color: #63b0ee;
  561. }
  562. @keyframes zigzag {
  563. 100% {
  564. background-position: 1em 0, 1em 0, -0.75em 0, -0.75em 0;
  565. }
  566. }
  567. .kotlin-5 {
  568. color: #f9879b;
  569. }
  570. .kotlin-5:hover {
  571. animation: pulse 1s ease-in infinite;
  572. background: radial-gradient(circle, rgba(249, 135, 155, 0.25) 43%, transparent 50%) 0 0/1em 1em, radial-gradient(circle, rgba(249, 135, 155, 0.25) 43%, transparent 50%) 0.5em 0.5em/2em 2em;
  573. color: #0bdcb7;
  574. }
  575. @keyframes pulse {
  576. 50% {
  577. background-position: 0.66em 0.66em, -0.33em -0.33em;
  578. }
  579. 100% {
  580. background-size: 2em 2em, 1em 1em;
  581. background-position: -1.5em -1.5em, -1em -1em;
  582. }
  583. }
  584. .vb:before,
  585. .vb:after {
  586. box-sizing: border-box;
  587. }
  588. .vb {
  589. position: relative;
  590. width: 158px;
  591. color: #FA5555;
  592. height: 40px;
  593. line-height: 42px;
  594. border: 2px solid #FA5555;
  595. border-radius: 14px;
  596. text-transform: uppercase;
  597. }
  598. .dot {
  599. content: '';
  600. position: absolute;
  601. top: 0;
  602. width: 32px;
  603. height: 100%;
  604. border-radius: 50%;
  605. transition: all 300ms ease;
  606. display: none;
  607. }
  608. .dot:after {
  609. content: '';
  610. position: absolute;
  611. top: -6px;
  612. height: 5px;
  613. width: 5px;
  614. background: #FA5555;
  615. border-radius: 50%;
  616. border: 4px solid #FA5555;
  617. box-shadow: 0 0 .7em #FFF,
  618. 0 0 2em #FA5555;
  619. }
  620. .vb:hover .dot,
  621. .vb:focus .dot {
  622. animation: atom 2s infinite linear;
  623. display: block;
  624. }
  625. /*calc(160px - 36px) 按钮宽度 - dot宽度 - 边框宽度*/
  626. @keyframes atom {
  627. 0% {
  628. transform: translateX(0) rotate(0);
  629. }
  630. 30% {
  631. transform: translateX(calc(160px - 36px)) rotate(0);
  632. }
  633. 50% {
  634. transform: translateX(calc(160px - 36px)) rotate(180deg);
  635. }
  636. 80% {
  637. transform: translateX(0) rotate(180deg);
  638. }
  639. 100% {
  640. transform: translateX(0) rotate(360deg);
  641. }
  642. }
  643. .btn-down {
  644. position: absolute;
  645. top: calc(50vh - 280px);
  646. text-align: center;
  647. border-radius: 4px;
  648. cursor: pointer;
  649. left: calc(50vw - 87px);
  650. width: 160px;
  651. line-height: 44px;
  652. color: #fff;
  653. background: #2194E0;
  654. opacity: 1;
  655. }
  656. .btn-down:active {
  657. opacity: .8;
  658. }
  659. </style>
  660. </html>