HotPot.ai Submit button move

Add variation to scroll submit and downlaod all buttons, move at the page scroll.

  1. // ==UserScript==
  2. // @name HotPot.ai Submit button move
  3. // @namespace Wizzergod
  4. // @version 1.0.8
  5. // @description Add variation to scroll submit and downlaod all buttons, move at the page scroll.
  6. // @icon https://www.google.com/s2/favicons?sz=64&domain=hotpot.ai
  7. // @license MIT
  8. // @author Wizzergod
  9. // @match *://hotpot.ai/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var styles = {
  17. submitBox: {
  18. fixed: {
  19. position: 'fixed',
  20. top: 'unset',
  21. left: '0',
  22. padding: '5px',
  23. right: 'auto',
  24. backgroundColor: 'transparent',
  25. display: 'flex',
  26. justifyContent: 'flex-start'
  27. },
  28. static: {
  29. position: 'static',
  30. zIndex: '9999',
  31. backgroundColor: 'transparent',
  32. display: 'block'
  33. }
  34. },
  35. downloadAllBox: {
  36. fixed: {
  37. position: 'fixed',
  38. top: '130px',
  39. left: '0',
  40. padding: '5px',
  41. right: 'auto',
  42. backgroundColor: 'transparent',
  43. display: 'flex',
  44. justifyContent: 'flex-start'
  45. },
  46. static: {
  47. position: 'static',
  48. zIndex: '9999',
  49. backgroundColor: 'transparent',
  50. display: 'block'
  51. }
  52. },
  53.  
  54. };
  55.  
  56. // Добавляем стили CSS для скрытия элементов по id
  57. var customStyles = document.createElement('style');
  58. customStyles.innerHTML = 'div[id^="bsa-zone_"] { display: none; }';
  59. document.head.appendChild(customStyles);
  60.  
  61. function moveElementAboveHeaderBox(element, headerBox) {
  62. if (element.length > 0 && headerBox.length > 0) {
  63. headerBox.before(element);
  64. }
  65. }
  66.  
  67. function fixElementOnScroll(element, fixAt, styles) {
  68. if (element.length > 0) {
  69. $(window).on('scroll', function() {
  70. var scrollTop = $(window).scrollTop();
  71. if (scrollTop > fixAt) {
  72. element.css(styles.fixed);
  73. $('.option.styleBox.imageInputBox .button.download , #submitButton').css({
  74. width: '60px',
  75. fontSize: '10px',
  76. border: '1px solid #e0e0e0',
  77. height: '200px'
  78. });
  79. } else {
  80. element.css(styles.static);
  81. $('.option.styleBox.imageInputBox .button.download , #submitButton').css({
  82. width: '520px',
  83. fontSize: '20px',
  84. border: '1px solid #e0e0e0',
  85. height: '60px'
  86. });
  87. }
  88. });
  89. }
  90. }
  91.  
  92. var submitBox = $('.submitBox');
  93. var downloadAllBox = $('#downloadAllBox');
  94. var headerBox = $('.headerBox');
  95.  
  96. $(document).ready(function() {
  97. moveElementAboveHeaderBox(submitBox, headerBox);
  98. fixElementOnScroll(submitBox, 100, styles.submitBox);
  99. moveElementAboveHeaderBox(downloadAllBox, headerBox);
  100. fixElementOnScroll(downloadAllBox, 200, styles.downloadAllBox);
  101. $('#downloadAllBox .option.styleBox.imageInputBox .button.download ').css(styles.downloadButton);
  102. $('#submitButton').on('click', function(event) {
  103. event.preventDefault();
  104. event.stopPropagation();
  105. });
  106. });
  107.  
  108. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址