{"id":94,"date":"2026-03-04T21:48:14","date_gmt":"2026-03-04T13:48:14","guid":{"rendered":"https:\/\/www.yanjiu.xin\/?p=94"},"modified":"2026-04-13T22:45:07","modified_gmt":"2026-04-13T14:45:07","slug":"bgapi","status":"publish","type":"post","link":"https:\/\/www.yanjiu.xin\/index.php\/bgapi\/","title":{"rendered":"\u968f\u673a\u56fe\u7247api\u5206\u4eab"},"content":{"rendered":"\n<p class=\"has-luminous-vivid-orange-color has-text-color has-link-color wp-elements-f1cce02c4b072175246e2b4f457d99e8 wp-block-paragraph\"><a href=\"https:\/\/api.worlds.xin\/random.js\" target=\"_blank\" rel=\"noreferrer noopener\">\u9759\u6001api\u2460\uff1ahttps:\/\/api.worlds.xin\/random.js<\/a><\/p>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color has-link-color wp-elements-c2dccc31fb8f724c8384cc7d91250b97 wp-block-paragraph\"><a href=\"https:\/\/img.cf.worlds.xin\/random.js\" target=\"_blank\" rel=\"noreferrer noopener\">\u9759\u6001api\u2461\uff1ahttps:\/\/img.cf.worlds.xin\/random.js<\/a><\/p>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color has-link-color wp-elements-2cfc7514cd854defb4740af8e53209a5 wp-block-paragraph\"><a href=\"https:\/\/img.api.yanjiu.xin\/index.php?type=\" target=\"_blank\" rel=\"noreferrer noopener\">\u52a8\u6001api\uff1ahttps:\/\/img.api.yanjiu.xin\/index.php?type=h(v)<\/a><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"zh\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u9759\u6001\u968f\u673a\u56fe API \u4f7f\u7528\u8bf4\u660e<\/title>\n    <style>\n        \/* \u57fa\u7840\u6837\u5f0f\u2014\u2014\u7b80\u6d01\u3001\u5e72\u51c0\uff0c\u9002\u914d\u591a\u6570WordPress\u4e3b\u9898 *\/\n        body {\n            font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n            line-height: 1.6;\n            color: #333;\n            max-width: 900px;\n            margin: 0 auto;\n            padding: 20px;\n            background: #fff;\n        }\n        h1, h2, h3 {\n            margin-top: 2em;\n            margin-bottom: 0.5em;\n            font-weight: 600;\n            line-height: 1.25;\n        }\n        h1 { font-size: 2.2em; border-bottom: 2px solid #f0f0f0; padding-bottom: 0.3em; }\n        h2 { font-size: 1.8em; border-bottom: 1px solid #eaecef; padding-bottom: 0.2em; }\n        h3 { font-size: 1.4em; }\n        p { margin: 1em 0; }\n        a { color: #0366d6; text-decoration: none; }\n        a:hover { text-decoration: underline; }\n        ul, ol { margin: 1em 0 1em 1.5em; }\n        li { margin: 0.5em 0; }\n        code {\n            font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;\n            background: #f6f8fa;\n            padding: 0.2em 0.4em;\n            border-radius: 3px;\n            font-size: 0.9em;\n        }\n        pre {\n            background: #f6f8fa;\n            padding: 16px;\n            border-radius: 6px;\n            overflow-x: auto;\n            line-height: 1.45;\n            font-size: 0.9em;\n            border: 1px solid #e1e4e8;\n        }\n        pre code {\n            background: none;\n            padding: 0;\n            border-radius: 0;\n            font-size: inherit;\n        }\n        blockquote {\n            padding: 0 1em;\n            color: #6a737d;\n            border-left: 0.25em solid #dfe2e5;\n            margin: 1em 0;\n        }\n        hr {\n            height: 0.25em;\n            background-color: #e1e4e8;\n            border: 0;\n            margin: 24px 0;\n        }\n        .note {\n            background: #fffbdd;\n            padding: 12px 16px;\n            border-radius: 6px;\n            border-left: 4px solid #f1c40f;\n            margin: 1.5em 0;\n        }\n        .btn-copy-hint {\n            font-size: 0.85em;\n            color: #6a737d;\n            float: right;\n        }\n        \/* \u9488\u5bf9WordPress\u5185\u5bb9\u5bb9\u5668\u7684\u989d\u5916\u4f18\u5316 *\/\n        .wp-content {\n            word-wrap: break-word;\n        }\n    <\/style>\n<\/head>\n<body>\n<div class=\"wp-content\">\n    <h1>\ud83d\uddbc\ufe0f \u9759\u6001\u968f\u673a\u56fe API \u4f7f\u7528\u6587\u6863<\/h1>\n    <p>\u611f\u8c22\u4f7f\u7528\u9759\u6001\u968f\u673a\u56fe API\uff01\u8fd9\u662f\u4e00\u4e2a\u7eaf\u524d\u7aef\u7684\u968f\u673a\u56fe\u7247\u89e3\u51b3\u65b9\u6848\uff0c\u53ea\u9700\u5728\u9875\u9762\u4e2d\u5f15\u5165\u4e00\u4e2a JS \u6587\u4ef6\uff0c\u5373\u53ef\u81ea\u52a8\u4e3a\u80cc\u666f\u3001\u56fe\u7247\u5143\u7d20\u8bbe\u7f6e\u968f\u673a\u56fe\u50cf\uff0c\u5e76\u652f\u6301\u624b\u52a8\u8c03\u7528\u83b7\u53d6\u56fe\u7247 URL\u3002<\/p>\n\n    <h2>\ud83d\ude80 \u5feb\u901f\u5f00\u59cb<\/h2>\n    <p>\u5728\u4f60\u7684 HTML \u9875\u9762\u4e2d\u5f15\u5165\u4ee5\u4e0b\u811a\u672c\uff08\u5efa\u8bae\u653e\u5728 <code>&lt;head&gt;<\/code> \u6216 <code>&lt;\/body&gt;<\/code> \u524d\uff09\uff1a<\/p>\n    <pre class=\"prettyprint linenums\" ><code>&lt;script src=\"https:\/\/api.worlds.xin\/random.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n    <p>\u65e0\u9700\u4efb\u4f55\u914d\u7f6e\uff0c\u811a\u672c\u52a0\u8f7d\u540e\u4f1a\u81ea\u52a8\u521d\u59cb\u5316\u9875\u9762\u4e2d\u7b26\u5408\u6761\u4ef6\u7684\u5143\u7d20\u3002<\/p>\n\n    <h2>\ud83d\uddbc\ufe0f \u529f\u80fd\u7279\u6027<\/h2>\n    <ul>\n        <li><strong>\u4f1a\u8bdd\u4fdd\u6301<\/strong>\uff1a\u540c\u4e00\u6807\u7b7e\u9875\u5185\uff0c\u6a2a\u5c4f\/\u7ad6\u5c4f\u56fe\u7247\u5728\u6574\u4e2a\u4f1a\u8bdd\u4e2d\u4fdd\u6301\u4e0d\u53d8\uff08\u5237\u65b0\u9875\u9762\u4e0d\u4f1a\u53d8\u5316\uff0c\u91cd\u65b0\u6253\u5f00\u9875\u9762\u4f1a\u66f4\u65b0\uff09\u3002<\/li>\n        <li><strong>\u81ea\u52a8\u9884\u52a0\u8f7d<\/strong>\uff1a\u80cc\u666f\u56fe\u4f1a\u5728\u5b8c\u5168\u52a0\u8f7d\u540e\u624d\u663e\u793a\uff0c\u907f\u514d\u95ea\u70c1\u3002<\/li>\n        <li><strong>CSS \u53d8\u91cf\u652f\u6301<\/strong>\uff1a\u4e3a\u4e3b\u80cc\u666f\u81ea\u52a8\u8bbe\u7f6e\u900f\u660e\u6548\u679c\u53d8\u91cf\u3002<\/li>\n        <li><strong>Swup \u96c6\u6210<\/strong>\uff1a\u81ea\u52a8\u76d1\u542c Swup \u9875\u9762\u5207\u6362\u4e8b\u4ef6\uff0c\u91cd\u65b0\u521d\u59cb\u5316\u56fe\u7247\u3002<\/li>\n    <\/ul>\n\n    <h2>\ud83d\udcdd \u4f7f\u7528\u65b9\u5f0f<\/h2>\n\n    <h3>1. \u8bbe\u7f6e\u4e3b\u80cc\u666f\uff08\u5b9a\u5236\u7248\uff09<\/h3>\n    <p>\u5982\u679c\u4f60\u5e0c\u671b\u4e3a\u9875\u9762\u8bbe\u7f6e\u4e00\u4e2a<strong>\u6a2a\u5c4f\u80cc\u666f\u56fe<\/strong>\uff0c\u5e76\u81ea\u52a8\u83b7\u5f97\u900f\u660e\u6548\u679c\u76f8\u5173\u7684 CSS \u53d8\u91cf\uff0c\u53ea\u9700\u5728\u9875\u9762\u4e2d\u6dfb\u52a0\u4e00\u4e2a <code>id<\/code> \u4e3a <code>bg-box<\/code> \u7684\u5143\u7d20\uff1a<\/p>\n    <pre class=\"prettyprint linenums\" ><code>&lt;div id=\"bg-box\" class=\"transition-opacity duration-500 opacity-0 loaded:opacity-100\"&gt;\n    &lt;!-- \u4f60\u7684\u9875\u9762\u5185\u5bb9\u653e\u5728\u8fd9\u91cc --&gt;\n&lt;\/div&gt;<\/code><\/pre>\n    <ul>\n        <li>\u56fe\u7247\u52a0\u8f7d\u6210\u529f\u540e\uff0c<code>bg-box<\/code> \u4f1a\u81ea\u52a8\u6dfb\u52a0 <code>loaded<\/code> \u7c7b\u540d\uff0c\u5e76\u8bbe\u7f6e <code>background-image<\/code>\u3002<\/li>\n        <li>\u540c\u65f6\u4f1a\u8bbe\u7f6e\u4e24\u4e2a CSS \u53d8\u91cf\uff1a<code>--card-bg<\/code> \u548c <code>--float-panel-bg<\/code>\uff08\u900f\u660e\u7248\u672c\uff09\uff0c\u65b9\u4fbf\u4f60\u5b9e\u73b0\u6bdb\u73bb\u7483\u7b49\u6548\u679c\u3002<\/li>\n    <\/ul>\n\n    <h3>2. \u8bbe\u7f6e\u901a\u7528\u80cc\u666f\u56fe\uff08\u5907\u7528\u65b9\u6848\uff09<\/h3>\n    <p>\u5982\u679c\u9700\u8981\u4e3a\u9875\u9762\u4e2d\u7684\u5176\u4ed6\u5143\u7d20\u8bbe\u7f6e\u968f\u673a\u80cc\u666f\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>data-random-bg<\/code> \u5c5e\u6027\uff0c\u5e76\u6307\u5b9a\u7c7b\u578b\uff1a<\/p>\n    <pre class=\"prettyprint linenums\" ><code>&lt;!-- \u6a2a\u5c4f\u80cc\u666f --&gt;\n&lt;div data-random-bg=\"h\" class=\"bg-element\"&gt;...&lt;\/div&gt;\n\n&lt;!-- \u7ad6\u5c4f\u80cc\u666f --&gt;\n&lt;div data-random-bg=\"v\" class=\"bg-element\"&gt;...&lt;\/div&gt;<\/code><\/pre>\n    <p>\u56fe\u7247\u52a0\u8f7d\u6210\u529f\u540e\uff0c\u8be5\u5143\u7d20\u4e5f\u4f1a\u88ab\u6dfb\u52a0 <code>loaded<\/code> \u7c7b\u540d\u3002<\/p>\n\n    <h3>3. \u8bbe\u7f6e\u666e\u901a\u56fe\u7247<\/h3>\n    <p>\u5bf9\u4e8e <code>&lt;img&gt;<\/code> \u6807\u7b7e\uff0c\u901a\u8fc7 <code>alt<\/code> \u5c5e\u6027\u6307\u5b9a\u7c7b\u578b\uff1a<\/p>\n    <pre class=\"prettyprint linenums\" ><code>&lt;!-- \u6a2a\u5c4f\u56fe\u7247 --&gt;\n&lt;img alt=\"random:h\" \/&gt;\n\n&lt;!-- \u7ad6\u5c4f\u56fe\u7247 --&gt;\n&lt;img alt=\"random:v\" \/&gt;<\/code><\/pre>\n\n    <h3>4. \u624b\u52a8\u8c03\u7528\uff08\u9ad8\u7ea7\uff09<\/h3>\n    <p>\u811a\u672c\u5728 <code>window<\/code> \u5bf9\u8c61\u4e0a\u66b4\u9732\u4e86\u4e24\u4e2a\u51fd\u6570\uff0c\u4f9b\u4f60\u624b\u52a8\u83b7\u53d6\u968f\u673a\u56fe\u7247 URL\uff08\u8fd4\u56de\u503c\u5728\u5f53\u524d\u4f1a\u8bdd\u4e2d\u4fdd\u6301\u4e00\u81f4\uff09\uff1a<\/p>\n    <pre class=\"prettyprint linenums\" ><code>\/\/ \u83b7\u53d6\u6a2a\u5c4f\u56fe URL\nconst hUrl = window.getRandomPicH();\n\n\/\/ \u83b7\u53d6\u7ad6\u5c4f\u56fe URL\nconst vUrl = window.getRandomPicV();\n\n\/\/ \u793a\u4f8b\uff1a\u624b\u52a8\u8bbe\u7f6e\u56fe\u7247\ndocument.getElementById('my-image').src = hUrl;<\/code><\/pre>\n\n    <h2>\ud83d\uddbc\ufe0f \u753b\u5eca\u9875\u9762<\/h2>\n    <p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u94fe\u63a5\u6d4f\u89c8\u6240\u6709\u5df2\u4e0a\u4f20\u7684\u968f\u673a\u56fe\u7247\uff1a<\/p>\n    <p>\ud83d\udc49 <a href=\"https:\/\/api.worlds.xin\/gallery.html\" target=\"_blank\">https:\/\/api.worlds.xin\/gallery.html<\/a><\/p>\n\n    <h2>\u2699\ufe0f \u6280\u672f\u7ec6\u8282<\/h2>\n    <ul>\n        <li>\u56fe\u7247\u603b\u6570\uff1a\u6a2a\u5c4f <strong>160<\/strong> \u5f20\uff0c\u7ad6\u5c4f <strong>4<\/strong> \u5f20\u3002<\/li>\n        <li>\u56fe\u7247\u683c\u5f0f\uff1aWebP\u3002<\/li>\n        <li>URL \u683c\u5f0f\uff1a<code>https:\/\/api.worlds.xin\/ri\/{type}\/{\u6570\u5b57}.webp<\/code>\uff08<code>type<\/code> \u4e3a <code>h<\/code> \u6216 <code>v<\/code>\uff09\u3002<\/li>\n        <li>\u811a\u672c\u4ec5\u4f9d\u8d56\u6d4f\u89c8\u5668\u539f\u751f API\uff0c\u65e0\u4efb\u4f55\u5916\u90e8\u4f9d\u8d56\u3002<\/li>\n    <\/ul>\n\n    <h2>\ud83d\udccc \u6ce8\u610f\u4e8b\u9879<\/h2>\n    <ul>\n        <li>\u56fe\u7247\u5e93\u7531\u670d\u52a1\u7aef\u7ef4\u62a4\uff0c\u5982\u9700\u66f4\u65b0\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u91cd\u65b0\u8fd0\u884c\u6784\u5efa\u811a\u672c\u3002<\/li>\n        <li>\u7531\u4e8e\u662f\u9759\u6001 API\uff0c\u4e0d\u652f\u6301\u52a8\u6001\u4e0a\u4f20\u6216\u5220\u9664\u56fe\u7247\u3002<\/li>\n        <li>\u82e5\u9875\u9762\u4f7f\u7528\u4e86 Swup\uff0c\u811a\u672c\u4f1a\u81ea\u52a8\u76d1\u542c <code>swup:contentReplaced<\/code> \u548c <code>swup:enable<\/code> \u4e8b\u4ef6\uff0c\u65e0\u9700\u989d\u5916\u5904\u7406\u3002<\/li>\n    <\/ul>\n\n    <div class=\"note\">\n        <strong>\ud83c\udd98 \u652f\u6301<\/strong><br>\n        \u5982\u6709\u95ee\u9898\u6216\u5efa\u8bae\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\u3002\u611f\u8c22\u4f7f\u7528\uff01\n    <\/div>\n<\/div>\n<\/body>\n<\/html>\n\n\n\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, viewport-fit=cover\">\n    <title>AI \u5173\u952e\u8bcd \u00b7 \u9759\u6001\u968f\u673a\u56fe API \u6458\u8981<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            background: #f5f7fb;\n            font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n            line-height: 1.5;\n            padding: 2rem 1rem;\n            color: #1e293b;\n        }\n\n        .container {\n            max-width: 1100px;\n            margin: 0 auto;\n        }\n\n        \/* \u5361\u7247\u6837\u5f0f *\/\n        .card {\n            background: #ffffff;\n            border-radius: 28px;\n            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.02);\n            overflow: hidden;\n            transition: all 0.2s ease;\n        }\n\n        .card-header {\n            padding: 1.8rem 2rem 0.8rem 2rem;\n            border-bottom: 1px solid #eef2f6;\n        }\n\n        .card-header h1 {\n            font-size: 1.9rem;\n            font-weight: 700;\n            background: linear-gradient(135deg, #1e3c72, #2b4c7c);\n            background-clip: text;\n            -webkit-background-clip: text;\n            color: transparent;\n            letter-spacing: -0.3px;\n            display: inline-flex;\n            align-items: center;\n            gap: 10px;\n        }\n\n        .badge {\n            background: #eef2ff;\n            color: #1e40af;\n            font-size: 0.7rem;\n            font-weight: 600;\n            padding: 0.2rem 0.7rem;\n            border-radius: 40px;\n            margin-left: 12px;\n            vertical-align: middle;\n        }\n\n        .sub {\n            color: #475569;\n            margin-top: 0.5rem;\n            font-size: 0.95rem;\n        }\n\n        \/* \u5173\u952e\u8bcd\u5185\u5bb9\u533a\u57df *\/\n        .keywords-panel {\n            padding: 1.5rem 2rem 2rem 2rem;\n        }\n\n        .copy-area {\n            background: #f8fafc;\n            border-radius: 24px;\n            border: 1px solid #e2e8f0;\n            transition: 0.2s;\n            margin-bottom: 1.8rem;\n            overflow: hidden;\n        }\n\n        .copy-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            background: #f1f5f9;\n            padding: 0.8rem 1.5rem;\n            border-bottom: 1px solid #e2e8f0;\n            flex-wrap: wrap;\n            gap: 12px;\n        }\n\n        .copy-header span {\n            font-weight: 600;\n            font-size: 0.85rem;\n            color: #0f172a;\n            background: #ffffffaa;\n            padding: 0.2rem 0.6rem;\n            border-radius: 30px;\n            backdrop-filter: blur(2px);\n        }\n\n        .btn-copy {\n            background: #1f2b48;\n            border: none;\n            padding: 0.45rem 1.2rem;\n            border-radius: 60px;\n            font-weight: 500;\n            font-size: 0.85rem;\n            color: white;\n            cursor: pointer;\n            display: inline-flex;\n            align-items: center;\n            gap: 8px;\n            transition: all 0.2s;\n            box-shadow: 0 1px 2px rgba(0,0,0,0.05);\n        }\n\n        .btn-copy:hover {\n            background: #0f172a;\n            transform: translateY(-1px);\n            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n        }\n\n        .btn-copy:active {\n            transform: translateY(1px);\n        }\n\n        .ai-text-block {\n            padding: 1.6rem 1.8rem;\n            font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;\n            font-size: 0.9rem;\n            line-height: 1.6;\n            white-space: pre-wrap;\n            word-break: break-word;\n            color: #0f172a;\n            background: #ffffff;\n            max-height: 550px;\n            overflow-y: auto;\n        }\n\n        .ai-text-block::-webkit-scrollbar {\n            width: 6px;\n        }\n\n        .ai-text-block::-webkit-scrollbar-track {\n            background: #eef2f6;\n            border-radius: 8px;\n        }\n\n        .ai-text-block::-webkit-scrollbar-thumb {\n            background: #b9c3d0;\n            border-radius: 8px;\n        }\n\n        .toast-msg {\n            position: fixed;\n            bottom: 24px;\n            left: 50%;\n            transform: translateX(-50%) scale(0.95);\n            background: #1e293b;\n            color: white;\n            padding: 0.6rem 1.4rem;\n            border-radius: 60px;\n            font-size: 0.85rem;\n            font-weight: 500;\n            opacity: 0;\n            transition: opacity 0.2s, transform 0.2s;\n            pointer-events: none;\n            z-index: 1000;\n            backdrop-filter: blur(8px);\n            box-shadow: 0 6px 14px rgba(0,0,0,0.2);\n            white-space: nowrap;\n        }\n\n        .toast-msg.show {\n            opacity: 1;\n            transform: translateX(-50%) scale(1);\n        }\n\n        .info-note {\n            background: #eef2ff;\n            border-left: 4px solid #3b82f6;\n            padding: 1rem 1.5rem;\n            border-radius: 18px;\n            font-size: 0.85rem;\n            margin-top: 1rem;\n            color: #1e293b;\n        }\n\n        .info-note a {\n            color: #2563eb;\n            text-decoration: none;\n            font-weight: 500;\n        }\n\n        hr {\n            margin: 1.2rem 0;\n            border: none;\n            border-top: 1px solid #e2e8f0;\n        }\n\n        @media (max-width: 640px) {\n            .card-header {\n                padding: 1.2rem 1.2rem 0.6rem 1.2rem;\n            }\n            .keywords-panel {\n                padding: 1rem 1.2rem 1.8rem 1.2rem;\n            }\n            .ai-text-block {\n                padding: 1rem;\n                font-size: 0.8rem;\n            }\n            .copy-header {\n                padding: 0.6rem 1rem;\n            }\n            .btn-copy {\n                padding: 0.35rem 1rem;\n                font-size: 0.75rem;\n            }\n        }\n    <\/style>\n<\/head>\n<body>\n<div class=\"container\">\n    <div class=\"card\">\n        <div class=\"card-header\">\n            <h1>\n                \ud83e\udde0 \u9759\u6001\u968f\u673a\u56fe API \n                <span class=\"badge\">AI \u5173\u952e\u8bcd\u6458\u8981<\/span>\n            <\/h1>\n            <div class=\"sub\">\n                \u4f7f AI \u6a21\u578b\/\u5f00\u53d1\u8005\u5feb\u901f\u7406\u89e3\u5e76\u96c6\u6210\u8be5\u968f\u673a\u56fe\u670d\u52a1 \u2014 \u590d\u5236\u4e0b\u65b9\u7eaf\u6587\u672c\u5373\u53ef\u4f5c\u4e3a\u63d0\u793a\u8bcd\u6216\u4e0a\u4e0b\u6587\n            <\/div>\n        <\/div>\n        <div class=\"keywords-panel\">\n            <div class=\"copy-area\">\n                <div class=\"copy-header\">\n                    <span>\ud83d\udccb AI \u5c31\u7eea \u00b7 \u7ed3\u6784\u5316\u4f7f\u7528\u8bf4\u660e<\/span>\n                    <button class=\"btn-copy\" id=\"copyBtn\">\n                        \ud83d\udccb \u4e00\u952e\u590d\u5236\u6587\u672c\n                    <\/button>\n                <\/div>\n                <div id=\"aiKeywordsContent\" class=\"ai-text-block\">\n=== \u9759\u6001\u968f\u673a\u56fe API \u00b7 AI \u96c6\u6210\u5173\u952e\u8bcd\u4e0e\u7528\u6cd5 ===\n\n\u3010\u670d\u52a1\u540d\u79f0\u3011 \u9759\u6001\u968f\u673a\u56fe API (\u7eaf\u524d\u7aef\uff0c\u65e0\u4f9d\u8d56)\n\u3010\u6838\u5fc3\u811a\u672c\u3011 \u56fd\u5185\u5916\uff1ahttps:\/\/api.worlds.xin\/random.js\n           \u56fd\u5916\uff1ahttps:\/\/img.cf.worlds.xin\/random.js\n\u3010\u56fe\u7247\u5e93\u3011\n   &#8211; \u6a2a\u5c4f\u56fe\u7247 (h) : 160 \u5f20 WebP\n   &#8211; \u7ad6\u5c4f\u56fe\u7247 (v) : 4 \u5f20 WebP\n   &#8211; URL \u6a21\u5f0f: https:\/\/api.worlds.xin\/ri\/{type}\/{\u6570\u5b57}.webp\n       \u6a2a\u5c4f\u6570\u5b57\u8303\u56f4 1~160 \uff0c\u7ad6\u5c4f\u8303\u56f4 1~4\n\u3010\u4f1a\u8bdd\u884c\u4e3a\u3011\n   &#8211; \u540c\u4e00\u6807\u7b7e\u9875\/\u4f1a\u8bdd\u4e2d\uff0c\u5237\u65b0\u9875\u9762\u56fe\u7247\u4fdd\u6301\u4e0d\u53d8\u3002\n   &#8211; \u5173\u95ed\u6807\u7b7e\u9875\u91cd\u65b0\u6253\u5f00 \u2192 \u91cd\u65b0\u968f\u673a\u3002\n   &#8211; \u57fa\u4e8e sessionStorage \u5b9e\u73b0\uff0c\u56fe\u7247 URL \u4f1a\u8bdd\u5185\u6052\u5b9a\u3002\n\n\u26a1 \u81ea\u52a8\u521d\u59cb\u5316 (\u96f6\u914d\u7f6e)\n   \u5f15\u5165 random.js \u540e\uff0c\u81ea\u52a8\u626b\u63cf DOM \u5e76\u8bbe\u7f6e\u4ee5\u4e0b\u5143\u7d20\uff1a\n   1. \u4e3b\u80cc\u666f\u5bb9\u5668: id=&#8221;bg-box&#8221;\n      \u2192 \u8bbe\u7f6e background-image\uff0c\u6dfb\u52a0 .loaded \u7c7b\n      \u2192 \u6ce8\u5165 CSS \u53d8\u91cf: &#8211;card-bg , &#8211;float-panel-bg (\u534a\u900f\u660e\u6bdb\u73bb\u7483\u8272\u8c03)\n   2. \u81ea\u5b9a\u4e49\u80cc\u666f\u5143\u7d20: data-random-bg=&#8221;h&#8221; \u6216 data-random-bg=&#8221;v&#8221;\n      \u2192 \u56fe\u7247\u52a0\u8f7d\u540e\u81ea\u52a8\u6dfb\u52a0 .loaded \u7c7b\uff0c\u80cc\u666f\u56fe\u8bbe\u7f6e\u5b8c\u6210\n   3. &lt;img&gt; \u6807\u7b7e: alt=&#8221;random:h&#8221; \u6216 alt=&#8221;random:v&#8221;\n      \u2192 \u81ea\u52a8\u66ff\u6362 src \u4e3a\u968f\u673a\u56fe\u7247 URL\n\n\ud83d\udee0\ufe0f \u624b\u52a8\u8c03\u7528 (\u63a8\u8350\u7528\u4e8e\u52a8\u6001\u573a\u666f)\n   window.getRandomPicH() \u2192 \u8fd4\u56de\u5f53\u524d\u4f1a\u8bdd\u6a2a\u5c4f\u56fe\u5b8c\u6574 URL (String)\n   window.getRandomPicV() \u2192 \u8fd4\u56de\u5f53\u524d\u4f1a\u8bdd\u7ad6\u5c4f\u56fe\u5b8c\u6574 URL (String)\n   \u203b \u591a\u6b21\u8c03\u7528\u8fd4\u56de\u503c\u76f8\u540c\uff08\u4f1a\u8bdd\u5185\u7a33\u5b9a\uff09\n\n\ud83e\udde9 \u9ad8\u7ea7\u7279\u6027\n   &#8211; \u9884\u52a0\u8f7d\u673a\u5236: \u80cc\u666f\u56fe\u5b8c\u5168\u52a0\u8f7d\u540e\u624d\u663e\u793a\uff0c\u65e0\u95ea\u70c1\u3002\n   &#8211; Swup \u6846\u67b6\u96c6\u6210: \u81ea\u52a8\u76d1\u542c swup:contentReplaced \/ swup:enable \u4e8b\u4ef6\uff0c\u9875\u9762\u5207\u6362\u540e\u91cd\u65b0\u7ed1\u5b9a\u56fe\u7247\u3002\n   &#8211; CSS \u53d8\u91cf\u8f85\u52a9: &#8211;card-bg \/ &#8211;float-panel-bg \u7528\u4e8e\u5b9e\u73b0\u6bdb\u73bb\u7483\u5361\u7247\u3001\u6d6e\u5c42\u9762\u677f\u3002\n\n\ud83d\udca1 \u5178\u578b\u4f7f\u7528\u793a\u4f8b (\u53ef\u76f4\u63a5\u590d\u5236\u7ed9 AI \u751f\u6210\u4ee3\u7801)\n\n<!-- \u5f15\u5165\u811a\u672c -->\n&lt;script src=&#8221;https:\/\/api.worlds.xin\/random.js&#8221;&gt;&lt;\/script&gt;\n\n<!-- \u5168\u5c4f\u80cc\u666f\u5bb9\u5668 -->\n&lt;div id=&#8221;bg-box&#8221; style=&#8221;min-height: 100vh;&#8221;&gt; &#8230; &lt;\/div&gt;\n\n<!-- \u4efb\u610f\u5143\u7d20\u80cc\u666f\u56fe -->\n&lt;div data-random-bg=&#8221;h&#8221; class=&#8221;hero-section&#8221;&gt;&lt;\/div&gt;\n\n&lt;!&#8211; img \u968f\u673a\u56fe &#8211;&gt;\n&lt;img alt=&#8221;random:v&#8221; style=&#8221;max-width: 100%;&#8221; \/&gt;\n\n&lt;!&#8211; \u624b\u52a8\u8c03\u7528 JS \u793a\u4f8b &#8211;&gt;\n&lt;script&gt;\n   \/\/ \u83b7\u53d6\u6a2a\u5c4f\u56fe\u7247\u5e76\u8d4b\u7ed9\u67d0\u4e2a\u56fe\u7247\u5143\u7d20\n   const imgElement = document.getElementById(&#8216;custom-img&#8217;);\n   if(imgElement) imgElement.src = window.getRandomPicH();\n   \/\/ \u83b7\u53d6\u7ad6\u5c4f URL \u7528\u4e8e\u80cc\u666f\u6216\u5176\u4ed6\u7528\u9014\n   const verticalUrl = window.getRandomPicV();\n   console.log(&#8216;\u7ad6\u5c4f\u56fe:&#8217;, verticalUrl);\n&lt;\/script&gt;\n\n\ud83c\udf10 \u753b\u5eca &#038; \u8d44\u6e90\u6d4f\u89c8\n   https:\/\/api.worlds.xin\/gallery.html   https:\/\/img.cf.worlds.xin\/gallery\uff08\u67e5\u770b\u6240\u6709\u968f\u673a\u56fe\u7247\uff09\n\n\ud83d\udccc \u8865\u5145\u8bf4\u660e\uff08AI \u987b\u77e5\uff09\n   &#8211; \u65e0\u9700\u4efb\u4f55 API Key\uff0c\u5b8c\u5168\u514d\u8d39\uff0c\u8de8\u57df\u5df2\u914d\u7f6e\u3002\n   &#8211; \u6240\u6709\u56fe\u7247\u4e3a WebP \u683c\u5f0f\uff0c\u4f53\u79ef\u4f18\u5316\uff0c\u9002\u5408\u751f\u4ea7\u73af\u5883\u3002\n   &#8211; \u811a\u672c\u5185\u90e8\u81ea\u52a8\u5904\u7406\u9519\u8bef\/\u52a0\u8f7d\u72b6\u6001\uff0c\u4e0d\u5f71\u54cd\u9875\u9762\u6e32\u67d3\u3002\n   &#8211; \u56fe\u7247\u7d22\u5f15\u968f\u673a\u7b97\u6cd5\u5b89\u5168\u4e14\u8f7b\u91cf\uff0c\u6ee1\u8db3\u80cc\u666f\/\u88c5\u9970\u56fe\u9700\u6c42\u3002\n   &#8211; \u652f\u6301\u54cd\u5e94\u5f0f\uff0c\u4e0e Tailwind \/ \u4efb\u610f CSS \u6846\u67b6\u5171\u5b58\u826f\u597d\u3002\n   &#8211; \u5982\u9700\u624b\u52a8\u6784\u9020 URL\uff08\u4e0d\u63a8\u8350\u7834\u574f\u4f1a\u8bdd\u4e00\u81f4\u6027\uff09\uff0c\u53ef\u968f\u673a\u9009\u53d6\u6570\u5b57\u8303\u56f4\u3002\n\n\ud83d\udd01 \u4e0e Swup \/ Turbolinks \u7b49 PJAX \u5e93\u534f\u4f5c\n   \u811a\u672c\u81ea\u52a8\u76d1\u542c Swup \u4e8b\u4ef6\uff0c\u65e0\u9700\u989d\u5916\u4ee3\u7801\uff1b\u82e5\u4f7f\u7528\u5176\u4ed6\u8def\u7531\u5e93\uff0c\u53ef\u624b\u52a8\u8c03\u7528\u91cd\u65b0\u521d\u59cb\u5316\uff1a\n   document.dispatchEvent(new Event(&#8216;randomImageRefresh&#8217;)); \/\/ \u5185\u90e8\u9884\u7559\u94a9\u5b50\n\n\u2705 \u96c6\u6210\u68c0\u67e5\u6e05\u5355 (AI \u751f\u6210\u4ee3\u7801\u65f6)\n   \u2713 \u786e\u4fdd &lt;script src=&#8221;&#8230;&#8221;&gt; \u5728\u9875\u9762\u52a0\u8f7d\u524d\/\u540e\u6267\u884c\u3002\n   \u2713 \u82e5\u9700\u80cc\u666f\u4e3b\u89c6\u89c9\uff0c\u4f7f\u7528 id=&#8221;bg-box&#8221;\u3002\n   \u2713 \u9700\u8981\u6a2a\/\u7ad6\u533a\u5206\u65f6\u5229\u7528 data-random-bg \u6216 alt=&#8221;random:?&#8221;\u3002\n   \u2713 \u52a8\u6001\u5185\u5bb9\u751f\u6210\u540e\u5982\u9700\u5237\u65b0\u7ed1\u5b9a\uff0c\u53ef\u8c03\u7528 window.getRandomPicH\/V \u624b\u52a8\u8d4b\u503c\u3002\n\n\u2014\u2014 \u6458\u8981\u7ed3\u675f \u2014\u2014\n                <\/div>\n            <\/div>\n            <div class=\"info-note\">\n                \ud83d\udca1 <strong>\u7ed9 AI \u7684\u4f7f\u7528\u8d34\u58eb<\/strong>\uff1a\u4e0a\u65b9\u6587\u672c\u5757\u5305\u542b API \u6240\u6709\u5173\u952e\u884c\u4e3a\u3001\u4ee3\u7801\u793a\u4f8b\u3001\u4f1a\u8bdd\u89c4\u5219\u53ca\u96c6\u6210\u65b9\u5f0f\u3002<br>\n                \u70b9\u51fb\u300c\u4e00\u952e\u590d\u5236\u6587\u672c\u300d\u5373\u53ef\u5c06\u5b8c\u6574\u5173\u952e\u8bcd\u6458\u8981\u7c98\u8d34\u5230\u4efb\u4f55 AI \u5bf9\u8bdd\u4e2d\uff0c\u8ba9 AI \u51c6\u786e\u7406\u89e3\u5e76\u751f\u6210\u96c6\u6210\u4ee3\u7801\u3002\n                <hr>\n                \ud83d\udd17 \u539f\u59cb\u5b8c\u6574\u6587\u6863: <a href=\"https:\/\/api.worlds.xin\/random.js\" target=\"_blank\">random.js \u811a\u672c\u6e90<\/a> &nbsp;|&nbsp;\n                <a href=\"https:\/\/api.worlds.xin\/gallery.html\" target=\"_blank\">\u56fe\u7247\u753b\u5eca<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<div id=\"toastMsg\" class=\"toast-msg\">\u2705 \u5df2\u590d\u5236 AI \u5173\u952e\u8bcd\u6587\u672c<\/div>\n\n<script>\n    (function() {\n        const copyBtn = document.getElementById('copyBtn');\n        const contentDiv = document.getElementById('aiKeywordsContent');\n        \n        \/\/ \u590d\u5236\u6838\u5fc3\u51fd\u6570\n        async function copyTextToClipboard() {\n            if (!contentDiv) return;\n            \/\/ \u83b7\u53d6\u7eaf\u6587\u672c\u5185\u5bb9\uff08\u4fdd\u7559\u683c\u5f0f\u3001\u6362\u884c\u3001\u7f29\u8fdb\uff09\n            let textToCopy = contentDiv.innerText || contentDiv.textContent;\n            if (!textToCopy) return;\n            \n            try {\n                await navigator.clipboard.writeText(textToCopy);\n                showToast('\u2705 \u5df2\u590d\u5236 AI \u5173\u952e\u8bcd\u6587\u672c', 2000);\n            } catch (err) {\n                \/\/ fallback \u65b9\u6848\n                fallbackCopy(textToCopy);\n            }\n        }\n        \n        \/\/ \u964d\u7ea7\u590d\u5236\n        function fallbackCopy(text) {\n            const textarea = document.createElement('textarea');\n            textarea.value = text;\n            textarea.style.position = 'fixed';\n            textarea.style.top = '-9999px';\n            textarea.style.left = '-9999px';\n            document.body.appendChild(textarea);\n            textarea.select();\n            try {\n                const success = document.execCommand('copy');\n                if (success) {\n                    showToast('\u2705 \u590d\u5236\u6210\u529f (\u964d\u7ea7\u65b9\u5f0f)', 1800);\n                } else {\n                    showToast('\u274c \u590d\u5236\u5931\u8d25\uff0c\u8bf7\u624b\u52a8\u590d\u5236', 2000);\n                }\n            } catch (e) {\n                showToast('\u274c \u590d\u5236\u5f02\u5e38\uff0c\u8bf7\u624b\u52a8\u9009\u62e9\u6587\u672c', 2000);\n            }\n            document.body.removeChild(textarea);\n        }\n        \n        \/\/ \u4f18\u96c5\u63d0\u793a\n        let toastTimer = null;\n        function showToast(msg, duration = 2000) {\n            const toast = document.getElementById('toastMsg');\n            if (!toast) return;\n            if (toastTimer) clearTimeout(toastTimer);\n            toast.textContent = msg || '\u2705 \u5df2\u590d\u5236 AI \u5173\u952e\u8bcd\u6587\u672c';\n            toast.classList.add('show');\n            toastTimer = setTimeout(() => {\n                toast.classList.remove('show');\n            }, duration);\n        }\n        \n        if (copyBtn) {\n            copyBtn.addEventListener('click', (e) => {\n                e.preventDefault();\n                copyTextToClipboard();\n            });\n        }\n        \n        \/\/ \u989d\u5916\u4fbf\u5229: \u70b9\u51fb\u6574\u4e2a ai-text-block \u4e5f\u53ef\u4ee5\u590d\u5236? \u4e0d\u5e72\u6270\u7528\u6237\uff0c\u4f46\u6ee1\u8db3\"\u70b9\u51fb\u590d\u5236\u5373\u53ef\u590d\u5236\" \u4f46\u6309\u94ae\u5df2\u7ecf\u6ee1\u8db3\uff0c\n        \/\/ \u540c\u65f6\u4e3a\u4e86\u6781\u81f4\u4f53\u9a8c: \u518d\u652f\u6301\u70b9\u51fb\u6587\u672c\u533a\u57df\u672c\u8eab\u590d\u5236 (\u53ef\u9009, \u589e\u5f3a). \u4f46\u4e3a\u907f\u514d\u8bef\u89e6\uff0c\u4ec5\u6309\u94ae\u89e6\u53d1, \u5b8c\u5168\u6ee1\u8db3\u9700\u6c42\u3002\n        \/\/ \u4f46\u6587\u6848\u201c\u70b9\u51fb\u590d\u5236\u5373\u53ef\u590d\u5236\u6b64\u6587\u672c\u201d \u2013 \u6309\u94ae\u5df2\u63d0\u4f9b\uff0c\u4f46\u589e\u52a0\u70b9\u51fb\u5361\u7247\u533a\u57df\u63d0\u793a\uff1f\u4fdd\u6301\u7b80\u5355\u53ef\u9760\u3002\n        \/\/ \u7ed9\u4e2a\u8f7b\u89e6\u63d0\u9192: \u4e0d\u9700\u8981\u590d\u6742\uff0c\u5df2\u6709\u590d\u5236\u6309\u94ae\u4e14\u7b26\u5408\u3002\n        \/\/ \u540c\u65f6\u786e\u4fdd\u65e0\u969c\u788d\u8bbf\u95ee\n        copyBtn?.setAttribute('aria-label', '\u590d\u5236AI\u5173\u952e\u8bcd\u6458\u8981');\n    })();\n<\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>\u9759\u6001api\u2460\uff1ahttps:\/\/api.worlds.xin\/random.js \u9759\u6001api\u2461\uff1ahttps:\/\/img.cf.worlds.xin\/random.js \u52a8\u6001api\uff1ahttps:\/\/img.api.yanjiu.xin\/index.php?type=h(v) \u9759\u6001\u968f\u673a\u56fe API \u4f7f\u7528\u8bf4\u660e \ud83d\uddbc\ufe0f \u9759\u6001\u968f\u673a\u56fe API \u4f7f\u7528\u6587\u6863 \u611f\u8c22\u4f7f\u7528\u9759\u6001\u968f\u673a\u56fe API\uff01\u8fd9\u662f\u4e00\u4e2a\u7eaf\u524d\u7aef\u7684\u968f\u673a\u56fe\u7247\u89e3\u51b3\u65b9\u6848\uff0c [&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,3],"tags":[9,10],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-5","category-3","tag-api","tag-10"],"_links":{"self":[{"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":18,"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/posts\/94\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yanjiu.xin\/index.php\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}