当前位置:   article > 正文

html代码表白_学会这个你还没对象?程序员浪漫表白代码(JS+CSS+HTML)附带源码...

程序员html表白

0a342333b2194e6f62d2a02360ad227d.png

感谢键盘,十年如一日的守护我的双手!

也许程序猿不善言表,

温情藏匿于外冷内热之中,

但那些看起来冰冷的代码,

也能组合成最浪漫优美的情话,

今天我们就来看看程序员是如何把情话放进浪漫的代码。

下面这是最终效果静态展示,试试有惊喜哦!

5df1c7647e38da388976d13032234f48.png

话不多说,以下是HTML:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Pictures</title>
  8. <link rel="stylesheet" href="css/demo.css">
  9. </head>
  10. <body>
  11. <div class="wrapper">
  12. <ul>
  13. <li>
  14. <div class='picBox'>
  15. <div class='show'>
  16. <img height='180px' width='180px' src='img/pic1.png'>
  17. </div>
  18. <div class='hide'>
  19. <h3>
  20. 我❥
  21. </h3>
  22. </div>
  23. </div>
  24. </li>
  25. <li>
  26. <div class='picBox'>
  27. <div class='show'>
  28. <img height='180px' width='180px' src='img/pic2.png'>
  29. </div>
  30. <div class='hide'>
  31. <h3>
  32. 好❥
  33. </h3>
  34. </div>
  35. </div>
  36. </li>
  37. <li>
  38. <div class='picBox'>
  39. <div class='show'>
  40. <img height='180px' width='180px' src='img/pic3.png'>
  41. </div>
  42. <div class='hide'>
  43. <h3>
  44. 喜❥
  45. </h3>
  46. </div>
  47. </div>
  48. </li>
  49. <li>
  50. <div class='picBox'>
  51. <div class='show'>
  52. <image height='180px' width='180px' src='img/pic4.png'></image>
  53. </div>
  54. <div class='hide'>
  55. <h3>
  56. 欢❥
  57. </h3>
  58. </div>
  59. </div>
  60. </li>
  61. <li>
  62. <div class='picBox'>
  63. <div class='show'>
  64. <image height='180px' width='180px' src='img/pic2-1.png'></image>
  65. </div>
  66. <div class='hide'>
  67. <h3>
  68. 你❥
  69. </h3>
  70. </div>
  71. </div>
  72. </li>
  73. <li>
  74. <div class='picBox'>
  75. <div class='show'>
  76. <image height='180px' width='180px' src='img/pic2-2.png'></image>
  77. </div>
  78. <div class='hide'>
  79. <h3>
  80. 跟❥
  81. </h3>
  82. </div>
  83. </div>
  84. </li>
  85. <li>
  86. <div class='picBox'>
  87. <div class='show'>
  88. <image height='180px' width='180px' src='img/pic2-3.png'></image>
  89. </div>
  90. <div class='hide'>
  91. <h3>
  92. 我❥
  93. </h3>
  94. </div>
  95. </div>
  96. </li>
  97. <li>
  98. <div class='picBox'>
  99. <div class='show'>
  100. <image height='180px' width='180px' src='img/pic2-4.png'></image>
  101. </div>
  102. <div class='hide'>
  103. <h3>
  104. 在❥
  105. </h3>
  106. </div>
  107. </div>
  108. </li>
  109. <li>
  110. <div class='picBox'>
  111. <div class='show'>
  112. <image height='180px' width='180px' src='img/pic3-1.png'></image>
  113. </div>
  114. <div class='hide'>
  115. <h3>
  116. 一❥
  117. </h3>
  118. </div>
  119. </div>
  120. </li>
  121. <li>
  122. <div class='picBox'>
  123. <div class='show'>
  124. <image height='180px' width='180px' src='img/pic3-2.png'></image>
  125. </div>
  126. <div class='hide'>
  127. <h3>
  128. 起❥
  129. </h3>
  130. </div>
  131. </div>
  132. </li>
  133. <li>
  134. <div class='picBox'>
  135. <div class='show'>
  136. <image height='180px' width='180px' src='img/pic3-3.png'></image>
  137. </div>
  138. <div class='hide'>
  139. <h3>
  140. 好❥
  141. </h3>
  142. </div>
  143. </div>
  144. </li>
  145. <li>
  146. <div class='picBox'>
  147. <div class='show'>
  148. <image height='180px' width='180px' src='img/pic3-4.png'></image>
  149. </div>
  150. <div class='hide'>
  151. <h3>
  152. 吗❥
  153. </h3>
  154. </div>
  155. </div>
  156. </li>
  157. </ul>
  158. </div>
  159. <script src="js/jquery.min.js"></script>
  160. <script src="js/demo.js"></script>
  161. </body>
  162. </html>

以下是CSS:

  1. *{
  2. margin:0;
  3. }
  4. body{
  5. background-color: #2F2F2F;
  6. }
  7. .wrapper{
  8. max-width:900px;
  9. margin:80px auto;
  10. }
  11. .wrapper li{
  12. position: relative;
  13. width: 180px;
  14. height: 180px;
  15. list-style:none;
  16. margin: 5px;
  17. display: inline-block;
  18. perspective: 300px;
  19. }
  20. .picBox{
  21. position: absolute;
  22. top: 0;
  23. right: 0;
  24. bottom: 0;
  25. left: 0;
  26. transform-style: preserve-3d;
  27. transform-origin: 50% 50% -90px;
  28. animation: 200ms ease-out 0ms 1 normal forwards;
  29. }
  30. .show,
  31. .hide{
  32. position: absolute;
  33. top: 0;
  34. right: 0;
  35. bottom: 0;
  36. left: 0;
  37. }
  38. .hide{
  39. color:#fff;
  40. background-color:#000;
  41. text-align:center;
  42. line-height:180px;
  43. transform: translate3d(0,0,-1px);
  44. /* 3D空间内移动一个元素的位置 */
  45. }
  46. .in-top .hide,
  47. .out-top .hide
  48. {
  49. transform-origin: 0% 100%;
  50. transform: translate3d(0, -100%, 0) rotate3d(1,0,0,90deg);
  51. }
  52. .in-top .picBox{
  53. animation-name: in-top;
  54. animation-play-state: running;
  55. }
  56. .out-top .picBox{
  57. animation-name: out-top;
  58. animation-play-state: running;
  59. }
  60. @keyframes in-top {
  61. from {transform: rotate3d(0,0,0,0deg)}
  62. to {transform: rotate3d(-1,0,0,90deg)}
  63. }
  64. @keyframes out-top {
  65. from {transform: rotate3d(-1,0,0,90deg)}
  66. to {transform: rotate3d(0,0,0,0deg)}
  67. }
  68. .in-right .hide,
  69. .out-right .hide {
  70. transform-origin: 0% 0%;
  71. transform: translate3d(100%, 0, 0) rotate3d(0,1,0,90deg);
  72. }
  73. .in-right .picBox{
  74. animation-name: in-right;
  75. animation-play-state: running;
  76. }
  77. .out-right .picBox{
  78. animation-name: out-right;
  79. animation-play-state: running;
  80. }
  81. @keyframes in-right {
  82. from {transform: rotate3d(0,0,0,0deg)}
  83. to {transform: rotate3d(0,-1,0,90deg)}
  84. }
  85. @keyframes out-right {
  86. from {transform: rotate3d(0,-1,0,90deg)}
  87. to {transform: rotate3d(0,0,0,0deg)}
  88. }
  89. .in-bottom .hide,
  90. .out-bottom .hide {
  91. transform-origin: 0% 0%;
  92. transform: translate3d(0, 100%, 0) rotate3d(-1,0,0,90deg);
  93. }
  94. .in-bottom .picBox{
  95. animation-name: in-bottom;
  96. animation-play-state: running;
  97. }
  98. .out-bottom .picBox{
  99. animation-name: out-bottom;
  100. animation-play-state: running;
  101. }
  102. @keyframes in-bottom {
  103. from {transform: rotate3d(0,0,0,0deg)}
  104. to {transform: rotate3d(1,0,0,90deg)}
  105. }
  106. @keyframes out-bottom {
  107. from {transform: rotate3d(1,0,0,90deg)}
  108. to {transform: rotate3d(0,0,0,0deg)}
  109. }
  110. .in-left .hide,
  111. .out-left .hide {
  112. transform-origin: 100% 0;
  113. transform: translate3d(-100%,0,0) rotate3d(0,-1,0,90deg);
  114. }
  115. @keyframes in-left {
  116. from {transform: rotate3d(0,0,0,0deg)}
  117. to {transform: rotate3d(0,1,0,90deg)}
  118. }
  119. @keyframes out-left {
  120. from {transform: rotate3d(0,1,0,90deg)}
  121. to {transform: rotate3d(0,0,0,0deg)}
  122. }
  123. .in-left .picBox{
  124. animation-name: in-left;
  125. animation-play-state: running;
  126. }
  127. .out-left .picBox{
  128. animation-name: out-left;
  129. animation-play-state: running;
  130. }

在这里推荐下python的学习交流平台,欢迎大家一起进步

正在跳转​jq.qq.com
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/127418
推荐阅读
相关标签
  

闽ICP备14008679号