button.html 14 KB

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