当前位置:   article > 正文

跨年、元旦、除夕(前端HTML)_春节前端代码

春节前端代码

目录

效果展示:

操作:

代码:


效果展示:

操作:

打开记事本粘贴代码

保存后更改后缀为html

双击运行

代码

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0">
  7. <title>新年快乐</title>
  8. </head>
  9. <body>
  10. <canvas class="canvas"></canvas>
  11. <div class="overlay">
  12. <div class="tabs">
  13. <div class="tabs-labels"><span class="tabs-label">Commands</span><span class="tabs-label">Info</span><span class="tabs-label">Share</span></div>
  14. <div class="tabs-panels">
  15. <ul class="tabs-panel commands">
  16. <li class="commands-item"><span class="commands-item-title">Text</span><span class="commands-item-info" data-demo="Hello :)">Type anything</span><span class="commands-item-action">Demo</span></li>
  17. <li class="commands-item"><span class="commands-item-title">Countdown</span><span class="commands-item-info" data-demo="#countdown 10">#countdown<span class="commands-item-mode">number</span></span><span class="commands-item-action">Demo</span></li>
  18. <li class="commands-item"><span class="commands-item-title">Icon</span><span class="commands-item-info" data-demo="#icon thumbs-up">#icon<span class="commands-item-mode">name</span>&nbsp;(using <a href="//fortawesome.github.io/Font-Awesome/#icons-new" target="_blank">Font Awesome</a>)</span><span class="commands-item-action">Demo</span></li>
  19. <li class="commands-item"><span class="commands-item-title">Time</span><span class="commands-item-info" data-demo="#time">#time</span><span class="commands-item-action">Demo</span></li>
  20. <li class="commands-item"><span class="commands-item-title">Rectangle</span><span class="commands-item-info" data-demo="#rectangle 30x15">#rectangle<span class="commands-item-mode">width x height</span></span><span class="commands-item-action">Demo</span></li>
  21. <li class="commands-item"><span class="commands-item-title">Circle</span><span class="commands-item-info" data-demo="#circle 25">#circle<span class="commands-item-mode">diameter</span></span><span class="commands-item-action">Demo</span></li>
  22. <li class="commands-item commands-item--gap"><span class="commands-item-title">Animate</span><span class="commands-item-info" data-demo="The time is|#time|#countdown 3|#icon thumbs-up"><span class="commands-item-mode">command1</span>&nbsp;|<span class="commands-item-mode">command2</span></span><span class="commands-item-action">Demo</span></li>
  23. </ul>
  24. <div class="tabs-panel ui-details">
  25. <div class="ui-details-content">
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <audio src="http://music.163.com/song/media/outer/url?id=41667067.mp3" autoplay="autoplay"></audio>
  32. <script>
  33. var str_text='新年倒计时|五|四|三|二|一|2024|新年快乐!|我会一直在!'
  34. var S = {
  35. init: function () {
  36. var action = window.location.href,
  37. i = action.indexOf('?a=');
  38. S.Drawing.init('.canvas');
  39. S.ShapeBuilder.init();
  40. S.UI.init();
  41. document.body.classList.add('body--ready');
  42. if (i !== -1) {
  43. S.UI.simulate(decodeURI(action).substring(i + 3));
  44. } else {
  45. S.UI.simulate(str_text);
  46. }
  47. S.Drawing.loop(function () {
  48. S.Shape.render();
  49. });
  50. }
  51. };
  52. window.addEventListener('load', function () {
  53. S.init();
  54. });
  55. S.Drawing = (function () {
  56. var canvas,
  57. context,
  58. renderFn,
  59. requestFrame = window.requestAnimationFrame ||
  60. window.webkitRequestAnimationFrame ||
  61. window.mozRequestAnimationFrame ||
  62. window.oRequestAnimationFrame ||
  63. window.msRequestAnimationFrame ||
  64. function (callback) {
  65. window.setTimeout(callback, 1000 / 60);
  66. };
  67. return {
  68. init: function (el) {
  69. canvas = document.querySelector(el);
  70. context = canvas.getContext('2d');
  71. this.adjustCanvas();
  72. window.addEventListener('resize', function () {
  73. S.Drawing.adjustCanvas();
  74. });
  75. },
  76. loop: function (fn) {
  77. renderFn = !renderFn ? fn : renderFn;
  78. this.clearFrame();
  79. renderFn();
  80. requestFrame.call(window, this.loop.bind(this));
  81. },
  82. adjustCanvas: function () {
  83. canvas.width = window.innerWidth;
  84. canvas.height = window.innerHeight;
  85. },
  86. clearFrame: function () {
  87. context.clearRect(0, 0, canvas.width, canvas.height);
  88. },
  89. getArea: function () {
  90. return { w: canvas.width, h: canvas.height };
  91. },
  92. drawCircle: function (p, c) {
  93. context.fillStyle = c.render();
  94. context.beginPath();
  95. context.arc(p.x, p.y, p.z, 0, 2 * Math.PI, true);
  96. context.closePath();
  97. context.fill();
  98. }
  99. };
  100. }());
  101. S.Point = function (args) {
  102. this.x = args.x;
  103. this.y = args.y;
  104. this.z = args.z;
  105. this.a = args.a;
  106. this.h = args.h;
  107. };
  108. S.Color = function (r, g, b, a) {
  109. this.r = r;
  110. this.g = g;
  111. this.b = b;
  112. this.a = a;
  113. };
  114. S.Color.prototype = {
  115. render: function () {
  116. return 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')';
  117. }
  118. };
  119. S.UI = (function () {
  120. var input = document.querySelector('.ui-input'),
  121. ui = document.querySelector('.ui'),
  122. help = document.querySelector('.help'),
  123. commands = document.querySelector('.commands'),
  124. overlay = document.querySelector('.overlay'),
  125. canvas = document.querySelector('.canvas'),
  126. interval,
  127. isTouch = ('ontouchstart' in window || navigator.msMaxTouchPoints),
  128. currentAction,
  129. resizeTimer,
  130. time,
  131. maxShapeSize = 30,
  132. firstAction = true,
  133. sequence = [],
  134. cmd = '#';
  135. function formatTime(date) {
  136. var h = date.getHours(),
  137. m = date.getMinutes();
  138. m = m < 10 ? '0' + m : m;
  139. return h + ':' + m;
  140. }
  141. function getValue(value) {
  142. return value && value.split(' ')[1];
  143. }
  144. function getAction(value) {
  145. value = value && value.split(' ')[0];
  146. return value && value[0] === cmd && value.substring(1);
  147. }
  148. function timedAction(fn, delay, max, reverse) {
  149. clearInterval(interval);
  150. currentAction = reverse ? max : 1;
  151. fn(currentAction);
  152. if (!max || (!reverse && currentAction < max) || (reverse && currentAction > 0)) {
  153. interval = setInterval(function () {
  154. currentAction = reverse ? currentAction - 1 : currentAction + 1;
  155. fn(currentAction);
  156. if ((!reverse && max && currentAction === max) || (reverse && currentAction === 0)) {
  157. clearInterval(interval);
  158. }
  159. }, delay);
  160. }
  161. }
  162. function reset(destroy) {
  163. clearInterval(interval);
  164. sequence = [];
  165. time = null;
  166. if (destroy) {
  167. S.Shape.switchShape(S.ShapeBuilder.letter(''));
  168. }
  169. }
  170. function performAction(value) {
  171. var action,
  172. current;
  173. overlay.classList.remove('overlay--visible');
  174. sequence = typeof(value) === 'object' ? value : sequence.concat(value.split('|'));
  175. timedAction(function () {
  176. current = sequence.shift();
  177. action = getAction(current);
  178. value = getValue(current);
  179. switch (action) {
  180. case 'countdown':
  181. value = parseInt(value, 10) || 10;
  182. value = value > 0 ? value : 10;
  183. timedAction(function (index) {
  184. if (index === 0) {
  185. if (sequence.length === 0) {
  186. S.Shape.switchShape(S.ShapeBuilder.letter(''));
  187. } else {
  188. performAction(sequence);
  189. }
  190. } else {
  191. S.Shape.switchShape(S.ShapeBuilder.letter(index), true);
  192. }
  193. }, 1000, value, true);
  194. break;
  195. case 'rectangle':
  196. value = value && value.split('x');
  197. value = (value && value.length === 2) ? value : [maxShapeSize, maxShapeSize / 2];
  198. S.Shape.switchShape(S.ShapeBuilder.rectangle(Math.min(maxShapeSize, parseInt(value[0], 10)), Math.min(maxShapeSize, parseInt(value[1], 10))));
  199. break;
  200. case 'circle':
  201. value = parseInt(value, 10) || maxShapeSize;
  202. value = Math.min(value, maxShapeSize);
  203. S.Shape.switchShape(S.ShapeBuilder.circle(value));
  204. break;
  205. case 'time':
  206. var t = formatTime(new Date());
  207. if (sequence.length > 0) {
  208. S.Shape.switchShape(S.ShapeBuilder.letter(t));
  209. } else {
  210. timedAction(function () {
  211. t = formatTime(new Date());
  212. if (t !== time) {
  213. time = t;
  214. S.Shape.switchShape(S.ShapeBuilder.letter(time));
  215. }
  216. }, 1000);
  217. }
  218. break;
  219. case 'icon':
  220. S.ShapeBuilder.imageFile('font-awesome/' + value + '.png', function (obj) {
  221. S.Shape.switchShape(obj);
  222. });
  223. break;
  224. default:
  225. S.Shape.switchShape(S.ShapeBuilder.letter(current[0] === cmd ? 'What?' : current));
  226. }
  227. }, 2500, sequence.length);
  228. }
  229. return {
  230. init: function () {
  231. if (isTouch) {
  232. document.body.classList.add('touch');
  233. }
  234. S.UI.Tabs.init();
  235. },
  236. simulate: function (action) {
  237. performAction(action);
  238. }
  239. };
  240. }());
  241. S.UI.Tabs = (function () {
  242. var labels = document.querySelector('.tabs-labels'),
  243. triggers = document.querySelectorAll('.tabs-label'),
  244. panels = document.querySelectorAll('.tabs-panel');
  245. function activate(i) {
  246. triggers[i].classList.add('tabs-label--active');
  247. panels[i].classList.add('tabs-panel--active');
  248. }
  249. function bindEvents() {
  250. labels.addEventListener('click', function (e) {
  251. var el = e.target,
  252. index;
  253. if (el.classList.contains('tabs-label')) {
  254. for (var t = 0; t < triggers.length; t++) {
  255. triggers[t].classList.remove('tabs-label--active');
  256. panels[t].classList.remove('tabs-panel--active');
  257. if (el === triggers[t]) {
  258. index = t;
  259. }
  260. }
  261. activate(index);
  262. }
  263. });
  264. }
  265. return {
  266. init: function () {
  267. activate(0);
  268. bindEvents();
  269. }
  270. };
  271. }());
  272. S.Dot = function (x, y) {
  273. this.p = new S.Point({
  274. x: x,
  275. y: y,
  276. z: 5,
  277. a: 1,
  278. h: 0
  279. });
  280. this.e = 0.07;
  281. this.s = true;
  282. this.c = new S.Color(255, 255, 255, this.p.a);
  283. this.t = this.clone();
  284. this.q = [];
  285. };
  286. S.Dot.prototype = {
  287. clone: function () {
  288. return new S.Point({
  289. x: this.x,
  290. y: this.y,
  291. z: this.z,
  292. a: this.a,
  293. h: this.h
  294. });
  295. },
  296. _draw: function () {
  297. this.c.a = this.p.a;
  298. S.Drawing.drawCircle(this.p, this.c);
  299. },
  300. _moveTowards: function (n) {
  301. var details = this.distanceTo(n, true),
  302. dx = details[0],
  303. dy = details[1],
  304. d = details[2],
  305. e = this.e * d;
  306. if (this.p.h === -1) {
  307. this.p.x = n.x;
  308. this.p.y = n.y;
  309. return true;
  310. }
  311. if (d > 1) {
  312. this.p.x -= ((dx / d) * e);
  313. this.p.y -= ((dy / d) * e);
  314. } else {
  315. if (this.p.h > 0) {
  316. this.p.h--;
  317. } else {
  318. return true;
  319. }
  320. }
  321. return false;
  322. },
  323. _update: function () {
  324. var p,
  325. d;
  326. if (this._moveTowards(this.t)) {
  327. p = this.q.shift();
  328. if (p) {
  329. this.t.x = p.x || this.p.x;
  330. this.t.y = p.y || this.p.y;
  331. this.t.z = p.z || this.p.z;
  332. this.t.a = p.a || this.p.a;
  333. this.p.h = p.h || 0;
  334. } else {
  335. if (this.s) {
  336. this.p.x -= Math.sin(Math.random() * 3.142);
  337. this.p.y -= Math.sin(Math.random() * 3.142);
  338. } else {
  339. this.move(new S.Point({
  340. x: this.p.x + (Math.random() * 50) - 25,
  341. y: this.p.y + (Math.random() * 50) - 25,
  342. }));
  343. }
  344. }
  345. }
  346. d = this.p.a - this.t.a;
  347. this.p.a = Math.max(0.1, this.p.a - (d * 0.05));
  348. d = this.p.z - this.t.z;
  349. this.p.z = Math.max(1, this.p.z - (d * 0.05));
  350. },
  351. distanceTo: function (n, details) {
  352. var dx = this.p.x - n.x,
  353. dy = this.p.y - n.y,
  354. d = Math.sqrt(dx * dx + dy * dy);
  355. return details ? [dx, dy, d] : d;
  356. },
  357. move: function (p, avoidStatic) {
  358. if (!avoidStatic || (avoidStatic && this.distanceTo(p) > 1)) {
  359. this.q.push(p);
  360. }
  361. },
  362. render: function () {
  363. this._update();
  364. this._draw();
  365. }
  366. };
  367. S.ShapeBuilder = (function () {
  368. var gap = 13,
  369. shapeCanvas = document.createElement('canvas'),
  370. shapeContext = shapeCanvas.getContext('2d'),
  371. fontSize = 500,
  372. fontFamily = 'Avenir, Helvetica Neue, Helvetica, Arial, sans-serif';
  373. function fit() {
  374. shapeCanvas.width = Math.floor(window.innerWidth / gap) * gap;
  375. shapeCanvas.height = Math.floor(window.innerHeight / gap) * gap;
  376. shapeContext.fillStyle = 'red';
  377. shapeContext.textBaseline = 'middle';
  378. shapeContext.textAlign = 'center';
  379. }
  380. function processCanvas() {
  381. var pixels = shapeContext.getImageData(0, 0, shapeCanvas.width, shapeCanvas.height).data,
  382. dots = [],
  383. x = 0,
  384. y = 0,
  385. fx = shapeCanvas.width,
  386. fy = shapeCanvas.height,
  387. w = 0,
  388. h = 0;
  389. for (var p = 0; p < pixels.length; p += (4 * gap)) {
  390. if (pixels[p + 3] > 0) {
  391. dots.push(new S.Point({
  392. x: x,
  393. y: y
  394. }));
  395. w = x > w ? x : w;
  396. h = y > h ? y : h;
  397. fx = x < fx ? x : fx;
  398. fy = y < fy ? y : fy;
  399. }
  400. x += gap;
  401. if (x >= shapeCanvas.width) {
  402. x = 0;
  403. y += gap;
  404. p += gap * 4 * shapeCanvas.width;
  405. }
  406. }
  407. return { dots: dots, w: w + fx, h: h + fy };
  408. }
  409. function setFontSize(s) {
  410. shapeContext.font = 'bold ' + s + 'px ' + fontFamily;
  411. }
  412. function isNumber(n) {
  413. return !isNaN(parseFloat(n)) && isFinite(n);
  414. }
  415. return {
  416. init: function () {
  417. fit();
  418. window.addEventListener('resize', fit);
  419. },
  420. imageFile: function (url, callback) {
  421. var image = new Image(),
  422. a = S.Drawing.getArea();
  423. image.onload = function () {
  424. shapeContext.clearRect(0, 0, shapeCanvas.width, shapeCanvas.height);
  425. shapeContext.drawImage(this, 0, 0, a.h * 0.6, a.h * 0.6);
  426. callback(processCanvas());
  427. };
  428. image.onerror = function () {
  429. callback(S.ShapeBuilder.letter('What?'));
  430. };
  431. image.src = url;
  432. },
  433. circle: function (d) {
  434. var r = Math.max(0, d) / 2;
  435. shapeContext.clearRect(0, 0, shapeCanvas.width, shapeCanvas.height);
  436. shapeContext.beginPath();
  437. shapeContext.arc(r * gap, r * gap, r * gap, 0, 2 * Math.PI, false);
  438. shapeContext.fill();
  439. shapeContext.closePath();
  440. return processCanvas();
  441. },
  442. letter: function (l) {
  443. var s = 0;
  444. setFontSize(fontSize);
  445. s = Math.min(fontSize,
  446. (shapeCanvas.width / shapeContext.measureText(l).width) * 0.8 * fontSize,
  447. (shapeCanvas.height / fontSize) * (isNumber(l) ? 1 : 0.45) * fontSize);
  448. setFontSize(s);
  449. shapeContext.clearRect(0, 0, shapeCanvas.width, shapeCanvas.height);
  450. shapeContext.fillText(l, shapeCanvas.width / 2, shapeCanvas.height / 2);
  451. return processCanvas();
  452. },
  453. rectangle: function (w, h) {
  454. var dots = [],
  455. width = gap * w,
  456. height = gap * h;
  457. for (var y = 0; y < height; y += gap) {
  458. for (var x = 0; x < width; x += gap) {
  459. dots.push(new S.Point({
  460. x: x,
  461. y: y,
  462. }));
  463. }
  464. }
  465. return { dots: dots, w: width, h: height };
  466. }
  467. };
  468. }());
  469. S.Shape = (function () {
  470. var dots = [],
  471. width = 0,
  472. height = 0,
  473. cx = 0,
  474. cy = 0;
  475. function compensate() {
  476. var a = S.Drawing.getArea();
  477. cx = a.w / 2 - width / 2;
  478. cy = a.h / 2 - height / 2;
  479. }
  480. return {
  481. shuffleIdle: function () {
  482. var a = S.Drawing.getArea();
  483. for (var d = 0; d < dots.length; d++) {
  484. if (!dots[d].s) {
  485. dots[d].move({
  486. x: Math.random() * a.w,
  487. y: Math.random() * a.h
  488. });
  489. }
  490. }
  491. },
  492. switchShape: function (n, fast) {
  493. var size,
  494. a = S.Drawing.getArea(),
  495. d = 0,
  496. i = 0;
  497. width = n.w;
  498. height = n.h;
  499. compensate();
  500. if (n.dots.length > dots.length) {
  501. size = n.dots.length - dots.length;
  502. for (d = 1; d <= size; d++) {
  503. dots.push(new S.Dot(a.w / 2, a.h / 2));
  504. }
  505. }
  506. d = 0;
  507. while (n.dots.length > 0) {
  508. i = Math.floor(Math.random() * n.dots.length);
  509. dots[d].e = fast ? 0.25 : (dots[d].s ? 0.14 : 0.11);
  510. if (dots[d].s) {
  511. dots[d].move(new S.Point({
  512. z: Math.random() * 20 + 10,
  513. a: Math.random(),
  514. h: 18
  515. }));
  516. } else {
  517. dots[d].move(new S.Point({
  518. z: Math.random() * 5 + 5,
  519. h: fast ? 18 : 30
  520. }));
  521. }
  522. dots[d].s = true;
  523. dots[d].move(new S.Point({
  524. x: n.dots[i].x + cx,
  525. y: n.dots[i].y + cy,
  526. a: 1,
  527. z: 5,
  528. h: 0
  529. }));
  530. n.dots = n.dots.slice(0, i).concat(n.dots.slice(i + 1));
  531. d++;
  532. }
  533. for (i = d; i < dots.length; i++) {
  534. if (dots[i].s) {
  535. dots[i].move(new S.Point({
  536. z: Math.random() * 20 + 10,
  537. a: Math.random(),
  538. h: 20
  539. }));
  540. dots[i].s = false;
  541. dots[i].e = 0.04;
  542. dots[i].move(new S.Point({
  543. x: Math.random() * a.w,
  544. y: Math.random() * a.h,
  545. a: 0.3, //.4
  546. z: Math.random() * 4,
  547. h: 0
  548. }));
  549. }
  550. }
  551. },
  552. render: function () {
  553. for (var d = 0; d < dots.length; d++) {
  554. dots[d].render();
  555. }
  556. }
  557. };
  558. }());
  559. </script>
  560. </body>
  561. <style>
  562. /*! shape-shifter 2013-08-14 */
  563. /*! normalize.css v2.0.1 | MIT License | git.io/normalize */
  564. article,
  565. aside,
  566. details,
  567. figcaption,
  568. figure,
  569. footer,
  570. header,
  571. hgroup,
  572. nav,
  573. section,
  574. summary {
  575. display: block
  576. }
  577. audio,
  578. canvas,
  579. video {
  580. display: inline-block
  581. }
  582. audio:not([controls]) {
  583. display: none;
  584. height: 0
  585. }
  586. [hidden] {
  587. display: none
  588. }
  589. html {
  590. font-family: sans-serif;
  591. -webkit-text-size-adjust: 100%;
  592. -ms-text-size-adjust: 100%
  593. }
  594. body {
  595. margin: 0
  596. }
  597. a:focus {
  598. outline: thin dotted
  599. }
  600. a:active,
  601. a:hover {
  602. outline: 0
  603. }
  604. h1 {
  605. font-size: 2em
  606. }
  607. abbr[title] {
  608. border-bottom: 1px dotted
  609. }
  610. b,
  611. strong {
  612. font-weight: 700
  613. }
  614. dfn {
  615. font-style: italic
  616. }
  617. mark {
  618. background: #ff0;
  619. color: #000
  620. }
  621. code,
  622. kbd,
  623. pre,
  624. samp {
  625. font-family: monospace, serif;
  626. font-size: 1em
  627. }
  628. pre {
  629. white-space: pre;
  630. white-space: pre-wrap;
  631. word-wrap: break-word
  632. }
  633. q {
  634. quotes: "\201C" "\201D" "\2018" "\2019"
  635. }
  636. small {
  637. font-size: 80%
  638. }
  639. sub,
  640. sup {
  641. font-size: 75%;
  642. line-height: 0;
  643. position: relative;
  644. vertical-align: baseline
  645. }
  646. sup {
  647. top: -.5em
  648. }
  649. sub {
  650. bottom: -.25em
  651. }
  652. img {
  653. border: 0
  654. }
  655. svg:not(:root) {
  656. overflow: hidden
  657. }
  658. figure {
  659. margin: 0
  660. }
  661. fieldset {
  662. border: 1px solid silver;
  663. margin: 0 2px;
  664. padding: .35em .625em .75em
  665. }
  666. legend {
  667. border: 0;
  668. padding: 0
  669. }
  670. button,
  671. input,
  672. select,
  673. textarea {
  674. font-family: inherit;
  675. font-size: 100%;
  676. margin: 0
  677. }
  678. button,
  679. input {
  680. line-height: normal
  681. }
  682. button,
  683. html input[type=button],
  684. input[type=reset],
  685. input[type=submit] {
  686. -webkit-appearance: button;
  687. cursor: pointer
  688. }
  689. button[disabled],
  690. input[disabled] {
  691. cursor: default
  692. }
  693. input[type=checkbox],
  694. input[type=radio] {
  695. box-sizing: border-box;
  696. padding: 0
  697. }
  698. input[type=search] {
  699. -webkit-appearance: textfield;
  700. -moz-box-sizing: content-box;
  701. -webkit-box-sizing: content-box;
  702. box-sizing: content-box
  703. }
  704. input[type=search]::-webkit-search-cancel-button,
  705. input[type=search]::-webkit-search-decoration {
  706. -webkit-appearance: none
  707. }
  708. button::-moz-focus-inner,
  709. input::-moz-focus-inner {
  710. border: 0;
  711. padding: 0
  712. }
  713. textarea {
  714. overflow: auto;
  715. vertical-align: top
  716. }
  717. table {
  718. border-collapse: collapse;
  719. border-spacing: 0
  720. }
  721. body {
  722. font-family: Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  723. background: #000000;
  724. color: #666;
  725. font-size: 16px;
  726. line-height: 1.5em
  727. }
  728. h1 {
  729. color: #111;
  730. margin: 0 0 12px;
  731. font-size: 24px;
  732. line-height: 1.5em
  733. }
  734. p {
  735. margin: 0 0 10x
  736. }
  737. a {
  738. color: #888;
  739. text-decoration: none;
  740. border-bottom: 1px solid #ccc
  741. }
  742. a:hover {
  743. border-bottom-color: #888
  744. }
  745. body,
  746. .overlay {
  747. -webkit-perspective: 1000;
  748. -webkit-perspective-origin-y: 25%
  749. }
  750. .body--ready {
  751. background: -webkit-linear-gradient(top, #000000 0, #000000 120%);
  752. background: -moz-linear-gradient(top, #000000 0, #000000 120%);
  753. background: -o-linear-gradient(top, #000000 0, #000000 120%);
  754. background: -ms-linear-gradient(top, #000000 0, #000000 120%);
  755. background: linear-gradient(top, #000000 0, #000000 120%)
  756. }
  757. .body--ready .overlay {
  758. -webkit-transition: -webkit-transform .7s cubic-bezier(0.694, .0482, .335, 1), opacity .7s cubic-bezier(0.694, .0482, .335, 1);
  759. -moz-transition: -moz-transform .7s cubic-bezier(0.694, .0482, .335, 1), opacity .7s cubic-bezier(0.694, .0482, .335, 1);
  760. -ms-transition: -ms-transform .7s cubic-bezier(0.694, .0482, .335, 1), opacity .7s cubic-bezier(0.694, .0482, .335, 1);
  761. -o-transition: -o-transform .7s cubic-bezier(0.694, .0482, .335, 1), opacity .7s cubic-bezier(0.694, .0482, .335, 1);
  762. transition: transform .7s cubic-bezier(0.694, .0482, .335, 1), opacity .7s cubic-bezier(0.694, .0482, .335, 1)
  763. }
  764. .body--ready .ui,
  765. .body--ready .help {
  766. display: block
  767. }
  768. .ui {
  769. display: none;
  770. position: absolute;
  771. left: 50%;
  772. bottom: 5%;
  773. width: 300px;
  774. margin-left: -150px
  775. }
  776. .ui-input {
  777. width: 100%;
  778. height: 50px;
  779. background: 0;
  780. font-size: 24px;
  781. font-weight: 700;
  782. color: #fff;
  783. text-align: center;
  784. border: 0;
  785. border-bottom: 2px solid #fff
  786. }
  787. .ui-input:focus {
  788. outline: 0;
  789. border: 0;
  790. border-bottom: 2px solid #fff
  791. }
  792. .ui-return {
  793. display: none;
  794. position: absolute;
  795. top: 20px;
  796. right: 0;
  797. padding: 3px 2px 0;
  798. font-size: 10px;
  799. line-height: 10px;
  800. color: #fff;
  801. border: 1px solid #fff
  802. }
  803. .ui--enter .ui-return {
  804. display: block
  805. }
  806. .ui--wide {
  807. width: 76%;
  808. margin-left: 12%;
  809. left: 0
  810. }
  811. .ui--wide .ui-return {
  812. right: -20px
  813. }
  814. .help {
  815. display: none;
  816. position: absolute;
  817. top: 40px;
  818. right: 40px;
  819. width: 25px;
  820. height: 25px;
  821. text-align: center;
  822. font-size: 13px;
  823. line-height: 27px;
  824. font-weight: 700;
  825. cursor: pointer;
  826. background: #fff;
  827. color: #79a8ae;
  828. opacity: .9;
  829. -webkit-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  830. -moz-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  831. -ms-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  832. -o-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  833. transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1)
  834. }
  835. .help:hover {
  836. opacity: 1
  837. }
  838. .overlay {
  839. position: absolute;
  840. top: 50%;
  841. left: 50%;
  842. width: 550px;
  843. height: 490px;
  844. margin: -260px 0 0 -275px;
  845. opacity: 0;
  846. -webkit-transform: rotateY(90deg);
  847. -moz-transform: rotateY(90deg);
  848. -ms-transform: rotateY(90deg);
  849. -o-transform: rotateY(90deg);
  850. transform: rotateY(90deg)
  851. }
  852. .overlay--visible {
  853. opacity: 1;
  854. -webkit-transform: rotateY(0);
  855. -moz-transform: rotateY(0);
  856. -ms-transform: rotateY(0);
  857. -o-transform: rotateY(0);
  858. transform: rotateY(0)
  859. }
  860. .ui-share,
  861. .ui-details {
  862. opacity: .9;
  863. background: #fff;
  864. z-index: 2
  865. }
  866. .ui-details-content,
  867. .ui-share-content {
  868. padding: 100px 50px
  869. }
  870. .commands {
  871. margin: 0;
  872. padding: 0;
  873. list-style: none;
  874. cursor: pointer
  875. }
  876. .commands-item {
  877. font-size: 12px;
  878. line-height: 22px;
  879. font-weight: 700;
  880. text-transform: uppercase;
  881. letter-spacing: 1px;
  882. padding: 20px;
  883. background: #fff;
  884. margin-top: 1px;
  885. color: #333;
  886. opacity: .9;
  887. -webkit-transition: -webkit-transform .7s cubic-bezier(0.694, .0482, .335, 1), opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  888. -moz-transition: -moz-transform .1s cubic-bezier(0.694, .0482, .335, 1), opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  889. -ms-transition: -ms-transform .1s cubic-bezier(0.694, .0482, .335, 1), opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  890. -o-transition: -o-transform .1s cubic-bezier(0.694, .0482, .335, 1), opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  891. transition: transform .1s cubic-bezier(0.694, .0482, .335, 1), opacity .1s cubic-bezier(0.694, .0482, .335, 1)
  892. }
  893. .commands-item--gap {
  894. margin-top: 9px
  895. }
  896. .commands-item:hover {
  897. opacity: 1
  898. }
  899. .commands-item:hover .commands-item-action {
  900. background: #333
  901. }
  902. .commands-item a {
  903. display: inline-block
  904. }
  905. .commands-item-mode {
  906. display: inline-block;
  907. margin-left: 3px;
  908. font-style: italic;
  909. color: #ccc
  910. }
  911. .commands-item-title {
  912. display: inline-block;
  913. width: 150px
  914. }
  915. .commands-item-info {
  916. display: inline-block;
  917. width: 300px;
  918. font-size: 14px;
  919. text-transform: none;
  920. letter-spacing: 0;
  921. font-weight: 400;
  922. color: #aaa
  923. }
  924. .commands-item-action {
  925. display: inline-block;
  926. float: right;
  927. margin-top: 3px;
  928. text-transform: uppercase;
  929. font-size: 10px;
  930. line-height: 10px;
  931. color: #fff;
  932. background: #90c9d1;
  933. padding: 5px 10px 4px;
  934. border-radius: 3px
  935. }
  936. .commands-item:first-child {
  937. margin-top: 0
  938. }
  939. .twitter-share {
  940. position: absolute;
  941. top: 4px;
  942. right: 20px
  943. }
  944. .tabs-labels {
  945. margin-bottom: 9px
  946. }
  947. .tabs-label {
  948. display: inline-block;
  949. background: #fff;
  950. padding: 10px 20px;
  951. font-size: 12px;
  952. line-height: 22px;
  953. font-weight: 700;
  954. text-transform: uppercase;
  955. letter-spacing: 1px;
  956. color: #333;
  957. opacity: .5;
  958. cursor: pointer;
  959. margin-right: 2px;
  960. -webkit-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  961. -moz-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  962. -ms-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  963. -o-transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1);
  964. transition: opacity .1s cubic-bezier(0.694, .0482, .335, 1)
  965. }
  966. .tabs-label:hover {
  967. opacity: .9
  968. }
  969. .tabs-label--active {
  970. opacity: .9
  971. }
  972. .tabs-panel {
  973. display: none
  974. }
  975. .tabs-panel--active {
  976. display: block
  977. }
  978. .tab-panel {
  979. position: absolute;
  980. top: 0;
  981. left: 0;
  982. width: 100%
  983. }
  984. .touch .ui-input {
  985. display: none
  986. }
  987. @media screen and (max-height:600px) {
  988. .ui-input {
  989. color: #111;
  990. border-color: #111
  991. }
  992. .ui-input:focus {
  993. border-color: #111
  994. }
  995. }
  996. </style>
  997. </html>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/149193
推荐阅读