{"id":111,"date":"2024-04-15T22:02:11","date_gmt":"2024-04-15T14:02:11","guid":{"rendered":"http:\/\/www.shifengzhi.asia\/?p=111"},"modified":"2024-04-16T19:15:33","modified_gmt":"2024-04-16T11:15:33","slug":"css%e5%ae%9e%e7%8e%b0%e4%b8%8a%e5%8d%87%e6%b0%94%e6%b3%a1%e7%9a%84%e5%8a%a8%e7%94%bb%e6%95%88%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/boki.shifengzhi.top\/?p=111","title":{"rendered":"CSS\u5b9e\u73b0\u4e0a\u5347\u6c14\u6ce1\u7684\u52a8\u753b\u6548\u679c"},"content":{"rendered":"<h3>\u6548\u679c\u5c55\u793a<\/h3>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/tuchuang.shifengzhi.asia\/picture\/240415%20213956.gif'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/tuchuang.shifengzhi.asia\/picture\/240415%20213956.gif\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/p>\n<h3>\u4ee3\u7801\u5c55\u793a<\/h3>\n<p>\u8bdd\u4e0d\u591a\u8bf4\uff0c\u76f4\u63a5\u4e0a\u4ee3\u7801<\/p>\n<pre><code class=\"language-HTML\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n  &lt;meta charset=&quot;UTF-8&quot;&gt;\n  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n  &lt;title&gt;showe&lt;\/title&gt;\n  &lt;style&gt;\n    * {\n      margin: 0;\n      padding: 0;\n      box-sizing: border-box;\n    }\n    body {\n      min-height: 100vh;\n      background: #0c192c;\n    }\n    .container {\n      position: relative;\n      width: 100%;\n      height: 100vh;\n      overflow: hidden;\n    }\n    .bubbles {\n      display: flex;\n    }\n    .bubbles span {\n      width: 30px;\n      height: 30px;\n      background-color: #4fc3dc;\n      margin: 0 4px;\n      border-radius: 50%; \/* \u56db\u4e2a\u503c\u8bbe\u6210\u4e00\u6837\u7684\u4e00\u4e2a\u503c\uff0c\u98df\u5176\u4e3a\u5706\u5f62 *\/\n      \/* \u9634\u5f71\uff1a\u6c34\u5e73\u504f\u79fb \u5782\u76f4\u504f\u79fb \u6a21\u7cca\u534a\u5f84 \u6269\u5c55\u534a\u5f84 \u9634\u5f71\u989c\u8272*\/\n      box-shadow: 0 0 0 10px #4fc3dc44,\n                  0 0 50px #4fc3dc,\n                  0 0 100px #4fc3dc;\n      \/* animation: animate calc(100s \/ var(--i)) linear infinite;  \u548c\u4e0b\u9762JS\u4e2d\u7684\u6ce8\u91ca\u4ee3\u7801\u4e00\u8d77\u4f7f\u7528\uff0c\u53e6\u4e00\u79cd\u65b9\u6cd5\u5b9e\u73b0\u6563\u4e71\u6c14\u6ce1 *\/\n    }\n    .bubbles span:nth-child(even) {\n      background-color: #ff2d75;\n      box-shadow: 0 0 0 10px #ff2d7544,\n                  0 0 50px #ff2d75,\n                  0 0 100px #ff2d75;\n    }\n    @keyframes animate {\n      0% {\n        transform: translateY(99vh) scale(0);\n      }\n      100% {\n        transform: translateY(-6vh) scale(1);\n      }\n    }\n  &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;div class=&quot;container&quot;&gt;\n    &lt;div class=&quot;bubbles&quot;&gt;\n        \/* \u4f60\u4e5f\u53ef\u4ee5\u4e0d\u7528JS\uff0c\u5728\u8fd9\u91cc\u624b\u5199\u82e5\u5e72\u4e2aspan *\/\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n    &lt;script&gt;\n      const bubblesContainer = document.querySelector(&#039;.bubbles&#039;)\n      for (let i = 1; i &lt;= 41; i++) {\n        const bubble = document.createElement(&#039;span&#039;)\n        \/\/ bubble.style.setProperty(&#039;--i&#039;, i) \u6bcf\u4e00\u4e2a\u8bbe\u4e00\u4e2a\u4e0d\u540c\u7684\u53d8\u91cfi\u7528\u4e8e\u914d\u5408\u4e0a\u9762\u968f\u673a\u52a8\u753b\u65f6\u95f4\u5f62\u6210\u6563\u4e71\u6548\u679c\n        \/\/ \u751f\u6210\u968f\u673a\u52a8\u753b\u65f6\u95f4\uff0810 \u79d2\u5230 25 \u79d2\u4e4b\u95f4\uff09\n        const animationDuration = Math.random() * 15 + 10\n        \/\/ \u8bbe\u7f6e\u52a8\u753b\u5c5e\u6027\uff1a\u52a8\u753b\u540d\u79f0 \u65f6\u95f4 \u7f13\u548c \u65e0\u9650\u5faa\u73af\n        bubble.style.animation = `animate ${animationDuration}s ease-in-out infinite`\n        bubblesContainer.appendChild(bubble)\n      }\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<ul>\n<li>\n<h2>for\u5faa\u73af\u53ea\u5faa\u73af\u4e8641\u6b21\uff0c\u662f\u56e0\u4e3a\u6700\u591a\u53ea\u80fd\u670941\u4e2aspan\uff0c\u591a\u4e86\u5c31\u4f1a\u6324\u538b\u53d8\u5f62\uff0c\u5bfc\u81f4\u6700\u7ec8\u6548\u679c\u53d8\u6210\u692d\u5706\u5f62\u800c\u4e0d\u662f\u5706\u5f62<\/h2>\n<p>\u4e0a\u8ff0\u95ee\u9898\u53ef\u4ee5\u89e3\u51b3\uff0c\u4f46\u662f\u5176\u5b9e\u6ca1\u6709\u592a\u5927\u5fc5\u8981\uff0c\u8fd8\u662f\u5728\u8fd9\u91cc\u7b80\u5355\u8bf4\u4e00\u4e0b<br \/>\n\u53ea\u8981\u7ed9span\u6dfb\u52a0<code>flex-shrink<\/code>\u5c5e\u6027\uff0c\u8ba9\u5176\u5c5e\u6027\u503c\u7b49\u4e8e 0 \u5c31\u53ef\u4ee5\u5b9e\u73b0\u5b50\u5143\u7d20\u4e0d\u6324\u538b\uff0c\u5c31\u4e0d\u4f1a\u51fa\u73b0\u53d8\u5f62\u95ee\u9898\uff0cfor\u5faa\u73af100\u6b21200\u6b21\u90fd\u4f9d\u7136\u62a5\u6301\u5706\u5f62<br \/>\n<strong>\u4f46\u662f\uff0c<\/strong>\u6700\u7ec8\u6548\u679c\u6c14\u6ce1\u6570\u5176\u5b9e\u5e76\u6ca1\u6709\u53d8\u591a\uff0c\u51fa\u73b0\u5728\u9875\u9762\u4e2d\u7684span\u5143\u7d20\u4f9d\u65e7\u662f\u90a341\u4e2a\uff0c\u6240\u4ee5\u5176\u5b9e\u6539\u4e0d\u6539\u610f\u4e49\u4e0d\u5927\uff0c\u8fd8\u662f\u9644\u4e0a\u8fd9\u79cd\u65b9\u5f0f\u7684\u5b8c\u6574\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-HTML\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n&lt;meta charset=&quot;UTF-8&quot;&gt;\n&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n&lt;title&gt;showe&lt;\/title&gt;\n&lt;style&gt;\n* {\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n}\nbody {\n  min-height: 100vh;\n  background: #0c192c;\n}\n.container {\n  position: relative;\n  width: 100%;\n  height: 100vh;\n  overflow: hidden;\n}\n.bubbles {\n  display: flex;\n}\n.bubbles span {\n  width: 30px;\n  height: 30px;\n  background-color: #4fc3dc;\n  margin: 0 4px;\n  border-radius: 50%;\n  box-shadow: 0 0 0 10px #4fc3dc44,\n              0 0 50px #4fc3dc,\n              0 0 100px #4fc3dc;\n  \/* animation: animate calc(100s \/ var(--i)) linear infinite; *\/\n  flex-shrink: 0; \/* \u5b50\u5143\u7d20\u4e0d\u6324\u538b *\/\n}\n.bubbles span:nth-child(even) {\n  background-color: #ff2d75;\n  \/* \u9634\u5f71\uff1a\u6c34\u5e73\u504f\u79fb \u5782\u76f4\u504f\u79fb \u6a21\u7cca\u534a\u5f84 \u6269\u5c55\u534a\u5f84 \u9634\u5f71\u989c\u8272*\/\n  box-shadow: 0 0 0 10px #ff2d7544,\n              0 0 50px #ff2d75,\n              0 0 100px #ff2d75;\n}\n@keyframes animate {\n  0% {\n    transform: translateY(99vh) scale(0);\n  }\n  100% {\n    transform: translateY(-6vh) scale(1);\n  }\n}\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;div class=&quot;container&quot;&gt;\n&lt;div class=&quot;bubbles&quot;&gt;\n\n&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;script&gt;\n  const bubblesContainer = document.querySelector(&#039;.bubbles&#039;)\n  for (let i = 1; i &lt;= 241; i++) {\n    const bubble = document.createElement(&#039;span&#039;)\n    \/\/ bubble.style.setProperty(&#039;--i&#039;, i)\n    \/\/ bubble.style.setProperty(&#039;flex-shrink&#039;, 0) \u8fd9\u4e48\u8bbe\u7f6e\u4e5f\u53ef\u4ee5\n    \/\/ \u751f\u6210\u968f\u673a\u52a8\u753b\u65f6\u95f4\uff0810 \u79d2\u5230 25 \u79d2\u4e4b\u95f4\uff09\n    const animationDuration = Math.random() * 15 + 10\n    \/\/ \u8bbe\u7f6e\u52a8\u753b\u5c5e\u6027\uff1a \u7f13\u548c \u65e0\u9650\u5faa\u73af\n    bubble.style.animation = `animate ${animationDuration}s ease-in-out infinite`\n    bubblesContainer.appendChild(bubble)\n  }\n&lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6548\u679c\u5c55\u793a \u4ee3\u7801\u5c55\u793a \u8bdd\u4e0d\u591a\u8bf4\uff0c\u76f4\u63a5\u4e0a\u4ee3\u7801 &lt;!DOCTYPE html&gt; &lt;html lan [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[15],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-5","tag-css"],"_links":{"self":[{"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":1,"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":112,"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions\/112"}],"wp:attachment":[{"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boki.shifengzhi.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}