标小智logo生成AI自动滚动加载更多

用于logosc自动翻页

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         标小智logo生成AI自动滚动加载更多
// @namespace    http://tampermonkey.net/
// @version      2023-12-21
// @description  用于logosc自动翻页
// @author       Ozymandias
// @match        https://www.logosc.cn/make
// @icon         https://www.google.com/s2/favicons?sz=64&domain=logosc.cn
// @grant        none
// @license       MIT
// ==/UserScript==
var shouldScrollToBottom = true; // 控制是否自动滚动到底部
(function() {
    'use strict';

    // Your code here...
    function scrollToBottom() {
  window.scrollTo(0, document.body.scrollHeight);
}


function checkAndScroll() {
  var loadMoreInterval = setInterval(function() {
      var loadMoreButton = document.querySelector('.load-more-logos-btn');
      if (loadMoreButton) {
          console.log("点击加载更多")
          loadMoreButton.click();
      }
      if (shouldScrollToBottom) {
        scrollToBottom();
      }
  }, 1000); // 每隔1秒检测一次
}
console.log("自动检测开始")
checkAndScroll();


window.addEventListener('scroll', function() {
  var scrollPosition = window.innerHeight + window.scrollY;
  var documentHeight = document.documentElement.scrollHeight;
  // 判断是否滚动到页面底部
  if (scrollPosition >= documentHeight) {
    shouldScrollToBottom = true;
  } else {
    shouldScrollToBottom = false;
  }
});
})();