当前位置:   article > 正文

JS特效第86弹:炫酷的2022新年快乐html网页特效_js新年特效

js新年特效

        一款效果超级炫酷的2022新年快乐html网页特效(完全可以根据实际情况修改相应的年份),霓虹的城市夜景和绚烂的烟花很是特别,该html页面还有交互效果,点击鼠标就会呈现烟花绽放的特效,唯美不过如此,先来看看效果:

        一部分关键的代码如下:

  1. <!DOCTYPE html>
  2. <html lang="en" >
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="apple-mobile-web-app-title" content="CodePen">
  6. <title>2022新年快乐(午夜放映,点击观看烟花)</title>
  7. <link rel="stylesheet" href="css/style.css">
  8. <style>
  9. html, body {
  10. margin: 0;
  11. padding: 0;
  12. overflow: hidden;
  13. background: #000;
  14. font-family: Montserrat, sans-serif;
  15. background-image: url(img/pexels-photo-219692.jpeg);
  16. background-size: cover;
  17. background-position: center;
  18. }
  19. canvas {
  20. mix-blend-mode: lighten;
  21. cursor: pointer;
  22. }
  23. #hero {
  24. display: inline;
  25. position: absolute;
  26. top: 50%;
  27. left: 50%;
  28. transform: translate(-50%, -50%);
  29. mix-blend-mode: color-dodge;
  30. }
  31. #year {
  32. font-size: 30vw;
  33. color: #d0d0d0;
  34. font-weight: bold;
  35. }
  36. #timeleft {
  37. color: #fbfbfb;
  38. font-size: 2.5vw;
  39. text-align: center;
  40. font-family: Lora, serif;
  41. }
  42. </style>
  43. <script>
  44. window.console = window.console || function(t) {};
  45. </script>
  46. <script>
  47. if (document.location.search.match(/type=embed/gi)) {
  48. window.parent.postMessage("resize", "*");
  49. }
  50. </script>
  51. </head>
  52. <body translate="no" >
  53. <div id="hero">
  54. <di
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/90861
推荐阅读
相关标签
  

闽ICP备14008679号