button.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  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: 15px;
  50. display: inline-block;
  51. text-align: center;
  52. width: 122px;
  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: 120px;
  64. border: 1px solid #eb9e05;
  65. opacity: 1;
  66. transition: all 0.6s;
  67. }
  68. .java:hover {
  69. background: #eb9e05;
  70. color: #fff;
  71. }
  72. .java:active {
  73. opacity: 0.7;
  74. }
  75. .c {
  76. height: 44px;
  77. line-height: 44px;
  78. background: #55acee;
  79. transition: all 0.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: 120px;
  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: 0.8;
  132. }
  133. .js {
  134. width: 160px;
  135. height: 42px;
  136. line-height: 42px;
  137. background: #0d6;
  138. width: 120px;
  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: 0.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 0.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: 0.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: 0.8;
  251. }
  252. .ruby:active {
  253. opacity: 0.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(
  398. to right,
  399. #f6d365 0%,
  400. #fda085 51%,
  401. #f6d365 100%
  402. );
  403. }
  404. .python-2 {
  405. background-image: linear-gradient(
  406. to right,
  407. #fbc2eb 0%,
  408. #a6c1ee 51%,
  409. #fbc2eb 100%
  410. );
  411. }
  412. .python-3 {
  413. background-image: linear-gradient(
  414. to right,
  415. #84fab0 0%,
  416. #8fd3f4 51%,
  417. #84fab0 100%
  418. );
  419. }
  420. .python-4 {
  421. background-image: linear-gradient(
  422. to right,
  423. #a1c4fd 0%,
  424. #c2e9fb 51%,
  425. #a1c4fd 100%
  426. );
  427. }
  428. .python-5 {
  429. background-image: linear-gradient(
  430. to right,
  431. #ffecd2 0%,
  432. #fcb69f 51%,
  433. #ffecd2 100%
  434. );
  435. }
  436. .php,
  437. .php::after {
  438. -webkit-transition: all 0.5s;
  439. -moz-transition: all 0.5s;
  440. -o-transition: all 0.5s;
  441. transition: all 0.5s;
  442. }
  443. .php {
  444. border: 1px solid #c147e6;
  445. color: #c147e6;
  446. width: 120px;
  447. height: 42px;
  448. line-height: 42px;
  449. position: relative;
  450. z-index: 1;
  451. text-transform: uppercase;
  452. }
  453. .php:hover {
  454. color: #fff;
  455. }
  456. .php::before,
  457. .php::after {
  458. background: #c147e6;
  459. content: "";
  460. position: absolute;
  461. z-index: -2;
  462. border-radius: 3px;
  463. }
  464. .php-1::after {
  465. height: 0;
  466. left: 0;
  467. top: 0;
  468. width: 100%;
  469. }
  470. .php-1:hover:after {
  471. height: 100%;
  472. }
  473. .php-2::after {
  474. height: 100%;
  475. left: 0;
  476. top: 0;
  477. width: 0;
  478. }
  479. .php-2:hover:after {
  480. width: 100%;
  481. }
  482. .php-3::after {
  483. height: 0;
  484. left: 50%;
  485. top: 50%;
  486. width: 0;
  487. }
  488. .php-3:hover:after {
  489. height: 100%;
  490. left: 0;
  491. top: 0;
  492. width: 100%;
  493. }
  494. .php-4::before {
  495. height: 100%;
  496. left: 0;
  497. top: 0;
  498. width: 100%;
  499. }
  500. .php-4::after {
  501. background: #fff;
  502. height: 100%;
  503. left: 0;
  504. top: 0;
  505. width: 100%;
  506. }
  507. .php-4:hover:after {
  508. height: 0;
  509. left: 50%;
  510. top: 50%;
  511. width: 0;
  512. }
  513. .php-5 {
  514. overflow: hidden;
  515. }
  516. .php-5::after {
  517. height: 100%;
  518. left: -35%;
  519. top: 0;
  520. transform: skew(50deg);
  521. transition-duration: 0.6s;
  522. transform-origin: top left;
  523. width: 0;
  524. }
  525. .php-5:hover:after {
  526. height: 100%;
  527. width: 135%;
  528. }
  529. .kotlin {
  530. background: none;
  531. border: 1px solid;
  532. width: 120px;
  533. height: 42px;
  534. line-height: 42px;
  535. letter-spacing: inherit;
  536. text-transform: inherit;
  537. transition: color 1s;
  538. }
  539. .kotlin-1 {
  540. color: #9c89f7;
  541. }
  542. .kotlin-1:hover {
  543. animation: halftone 1s forwards;
  544. background: radial-gradient(circle, #9c89f7 0.2em, transparent 0.25em) 0 0/1.25em
  545. 1.25em,
  546. radial-gradient(circle, #9c89f7 0.2em, transparent 0.25em) 6.25em 6.25em/1.25em
  547. 1.25em;
  548. color: #e4f789;
  549. }
  550. @keyframes halftone {
  551. 100% {
  552. background-size: 2.375em 2.375em, 0.1em 0.1em;
  553. }
  554. }
  555. .kotlin-2 {
  556. color: #82f6d8;
  557. }
  558. .kotlin-2:hover {
  559. animation: stripes-move 0.75s infinite linear;
  560. background: repeating-linear-gradient(
  561. 45deg,
  562. #82f6d8 0,
  563. #82f6d8 0.25em,
  564. transparent 0.25em,
  565. transparent 0.5em
  566. );
  567. color: #f682a0;
  568. }
  569. @keyframes stripes-move {
  570. 100% {
  571. background-position: 5em 0px;
  572. }
  573. }
  574. .kotlin-3 {
  575. color: #d3f169;
  576. }
  577. .kotlin-3:hover {
  578. animation: sawtooth 0.35s infinite linear;
  579. background: linear-gradient(45deg, #d3f169 0.5em, transparent 0.5em) 0 0/1em
  580. 1em,
  581. linear-gradient(-45deg, #d3f169 0.5em, transparent 0.5em) 0 0/1em 1em;
  582. color: #8769f1;
  583. }
  584. @keyframes sawtooth {
  585. 100% {
  586. background-position: 1em 0;
  587. }
  588. }
  589. .kotlin-4 {
  590. color: #eea163;
  591. }
  592. .kotlin-4:hover {
  593. animation: zigzag 1s linear infinite;
  594. background: linear-gradient(
  595. 135deg,
  596. rgba(238, 161, 99, 0.25) 0.25em,
  597. transparent 0.25em
  598. ) -0.5em 0,
  599. linear-gradient(
  600. 225deg,
  601. rgba(238, 161, 99, 0.25) 0.25em,
  602. transparent 0.25em
  603. ) -0.5em 0,
  604. linear-gradient(
  605. 315deg,
  606. rgba(238, 161, 99, 0.25) 0.25em,
  607. transparent 0.25em
  608. )
  609. 0 0,
  610. linear-gradient(
  611. 45deg,
  612. rgba(238, 161, 99, 0.25) 0.25em,
  613. transparent 0.25em
  614. )
  615. 0 0;
  616. background-size: 0.75em 0.75em;
  617. color: #63b0ee;
  618. }
  619. @keyframes zigzag {
  620. 100% {
  621. background-position: 1em 0, 1em 0, -0.75em 0, -0.75em 0;
  622. }
  623. }
  624. .kotlin-5 {
  625. color: #f9879b;
  626. }
  627. .kotlin-5:hover {
  628. animation: pulse 1s ease-in infinite;
  629. background: radial-gradient(
  630. circle,
  631. rgba(249, 135, 155, 0.25) 43%,
  632. transparent 50%
  633. )
  634. 0 0/1em 1em,
  635. radial-gradient(circle, rgba(249, 135, 155, 0.25) 43%, transparent 50%)
  636. 0.5em 0.5em/2em 2em;
  637. color: #0bdcb7;
  638. }
  639. @keyframes pulse {
  640. 50% {
  641. background-position: 0.66em 0.66em, -0.33em -0.33em;
  642. }
  643. 100% {
  644. background-size: 2em 2em, 1em 1em;
  645. background-position: -1.5em -1.5em, -1em -1em;
  646. }
  647. }
  648. .vb:before,
  649. .vb:after {
  650. box-sizing: border-box;
  651. }
  652. .vb {
  653. position: relative;
  654. width: 120px;
  655. color: #fa5555;
  656. height: 40px;
  657. line-height: 42px;
  658. border: 2px solid #fa5555;
  659. border-radius: 14px;
  660. text-transform: uppercase;
  661. }
  662. .dot {
  663. content: "";
  664. position: absolute;
  665. top: 0;
  666. width: 32px;
  667. height: 100%;
  668. border-radius: 50%;
  669. transition: all 300ms ease;
  670. display: none;
  671. }
  672. .dot:after {
  673. content: "";
  674. position: absolute;
  675. top: -6px;
  676. height: 5px;
  677. width: 5px;
  678. background: #fa5555;
  679. border-radius: 50%;
  680. border: 4px solid #fa5555;
  681. box-shadow: 0 0 0.7em #fff, 0 0 2em #fa5555;
  682. }
  683. .vb:hover .dot,
  684. .vb:focus .dot {
  685. animation: atom 2s infinite linear;
  686. display: block;
  687. }
  688. /*calc(122px - 36px) 按钮宽度 - dot宽度 - 边框宽度*/
  689. @keyframes atom {
  690. 0% {
  691. transform: translateX(0) rotate(0);
  692. }
  693. 30% {
  694. transform: translateX(calc(122px - 36px)) rotate(0);
  695. }
  696. 50% {
  697. transform: translateX(calc(122px - 36px)) rotate(180deg);
  698. }
  699. 80% {
  700. transform: translateX(0) rotate(180deg);
  701. }
  702. 100% {
  703. transform: translateX(0) rotate(360deg);
  704. }
  705. }
  706. .btn-down {
  707. position: absolute;
  708. top: calc(50vh - 280px);
  709. text-align: center;
  710. border-radius: 4px;
  711. cursor: pointer;
  712. left: calc(50vw - 87px);
  713. width: 122px;
  714. line-height: 44px;
  715. color: #fff;
  716. background: #2194e0;
  717. opacity: 1;
  718. }
  719. .btn-down:active {
  720. opacity: 0.8;
  721. }
  722. </style>
  723. </html>