// ==UserScript== // @name 小红书六月份女装航海手册 // @namespace http://tampermonkey.net/ // @version 2024-10-21 // @description 小红书六月份女装航海手册问答,只适用于小红书女装相关知识 // @author michael // @match https://scys.com/view/docx/M2aAdT96KovioxxeBShcCCLDntN // @icon https://www.google.com/s2/favicons?sz=64&domain=scys.com // @grant none // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/513416/%E5%B0%8F%E7%BA%A2%E4%B9%A6%E5%85%AD%E6%9C%88%E4%BB%BD%E5%A5%B3%E8%A3%85%E8%88%AA%E6%B5%B7%E6%89%8B%E5%86%8C.user.js // @updateURL https://update.greasyfork.icu/scripts/513416/%E5%B0%8F%E7%BA%A2%E4%B9%A6%E5%85%AD%E6%9C%88%E4%BB%BD%E5%A5%B3%E8%A3%85%E8%88%AA%E6%B5%B7%E6%89%8B%E5%86%8C.meta.js // ==/UserScript== (function() { 'use strict'; // 创建iframe和聊天按钮 function createChatElements() { // 创建iframe const iframe = document.createElement('iframe'); iframe.src = "https://udify.app/chatbot/zBISlcDi4Pm4Grnt"; iframe.style.cssText = ` position: fixed; bottom: 80px; right: 20px; width: 400px; height: 600px; border: none; z-index: 2147483646; box-shadow: 0 4px 8px rgba(0,0,0,0.1); border-radius: 10px; display: none; `; iframe.allow = "microphone"; document.body.appendChild(iframe); // 创建聊天按钮容器 const buttonContainer = document.createElement('div'); buttonContainer.id = 'dify-chatbot-bubble-button'; buttonContainer.style.cssText = ` position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; border-radius: 50%; background-color: #038978; cursor: pointer; z-index: 2147483647; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); `; // 创建聊天图标 SVG const chatSvgIcon = ` `; // 创建关闭图标 SVG const closeSvgIcon = ` `; buttonContainer.innerHTML = chatSvgIcon; document.body.appendChild(buttonContainer); // 切换iframe可见性和按钮图标的函数 buttonContainer.onclick = function() { if (iframe.style.display === 'none') { iframe.style.display = 'block'; buttonContainer.innerHTML = closeSvgIcon; } else { iframe.style.display = 'none'; buttonContainer.innerHTML = chatSvgIcon; } }; } // 在页面加载完成后创建聊天元素 window.addEventListener('load', createChatElements); })();