NodeSeek+

load post detail information is automatically loaded when the button is clicked

  1. // ==UserScript==
  2. // @name NodeSeek+
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4.2
  5. // @description load post detail information is automatically loaded when the button is clicked
  6. // @author tsd
  7. // @match https://www.nodeseek.com/*
  8. // @match https://www.nodeseek.com/*
  9. // @icon https://www.nodeseek.com/static/image/favicon/android-chrome-192x192.png
  10. // @license GPLv3
  11. // @grant GM_addStyle
  12. // @grant GM_xmlhttpRequest
  13. // @grant unsafeWindow
  14. // @grant GM_setValue
  15. // @grant GM_getValue
  16. // @grant GM_deleteValue
  17. // @grant GM_removeValueChangeListener
  18. // @grant GM_addValueChangeListener
  19. // @grant GM_registerMenuCommand
  20. // @grant GM_unregisterMenuCommand
  21.  
  22. // ==/UserScript==
  23.  
  24. (function () {
  25. "use strict";
  26. console.log("script");
  27.  
  28. //GM_setValue
  29. //allCollectionData 收藏的post的id列表
  30. //checkInTime 签到的时间
  31. //isRandom 是否摸奖签到
  32. //isAuto 是否自动签到
  33. //contentTime 记录点击展开回复内容div的时间
  34. //replyNum 当前回复数
  35. //blockWords 屏蔽的关键词
  36.  
  37. //默认抽奖
  38. if (GM_getValue("isRandom") === undefined) {
  39. GM_setValue("isRandom", true);
  40. }
  41. //默认手动
  42. if (GM_getValue("isAuto") === undefined) {
  43. GM_setValue("isAuto", false);
  44. }
  45.  
  46. //注册菜单
  47. let switchCheckType;
  48. let switchAutoType;
  49. let listenerswitchCheckType;
  50. let listenerswitchAutoType;
  51. function createMenu() {
  52. switchCheckType = GM_registerMenuCommand(
  53. GM_getValue("isRandom") === true
  54. ? "切换签到模式,当前为随机"
  55. : "切换签到模式,当前为固定",
  56. menuRandomClick
  57. );
  58. switchAutoType = GM_registerMenuCommand(
  59. GM_getValue("isAuto") === true
  60. ? "切换自动模式,当前为自动"
  61. : "切换自动模式,当前为手动",
  62. menuAutoClick
  63. );
  64. //是否有变动
  65. listenerswitchCheckType = GM_addValueChangeListener(
  66. "isRandom",
  67. function (name, old_value, new_value, remote) {
  68. if (old_value !== new_value) {
  69. mscAlert(new_value === true ? "已切换为随机" : "已切换为固定");
  70. }
  71. }
  72. );
  73. listenerswitchAutoType = GM_addValueChangeListener(
  74. "isAuto",
  75. function (name, old_value, new_value, remote) {
  76. if (old_value !== new_value) {
  77. mscAlert(new_value === true ? "已切换为自动" : "已切换为手动");
  78. }
  79. }
  80. );
  81. }
  82. //菜单点击刷新签到信息
  83. function menuRandomClick() {
  84. GM_unregisterMenuCommand(switchCheckType);
  85. GM_getValue("isRandom") === true
  86. ? GM_setValue("isRandom", false)
  87. : GM_setValue("isRandom", true);
  88. //重新注册
  89. GM_removeValueChangeListener(listenerswitchCheckType);
  90. GM_removeValueChangeListener(listenerswitchAutoType);
  91. createMenu();
  92. checkIn();
  93. }
  94. //菜单点击刷新自动信息
  95. function menuAutoClick() {
  96. GM_unregisterMenuCommand(switchAutoType);
  97. GM_getValue("isAuto") === true
  98. ? GM_setValue("isAuto", false)
  99. : GM_setValue("isAuto", true);
  100. //重新注册
  101. GM_removeValueChangeListener(listenerswitchCheckType);
  102. GM_removeValueChangeListener(listenerswitchAutoType);
  103. createMenu();
  104. checkIn();
  105. }
  106.  
  107. // 检查是否登陆
  108. let loginStatus = false;
  109. // 查看手机情况
  110. let mobileStatus = false;
  111. if (document.querySelector(".user-head")) {
  112. loginStatus = true;
  113. }
  114. // 检查屏蔽关键词
  115. blockPost();
  116.  
  117. if(!document.querySelector("#nsk-right-panel-container>.user-card")){
  118. mobileStatus = true;
  119. }
  120.  
  121. if (loginStatus) {
  122. //注册油猴菜单
  123. createMenu();
  124. //处理登录;
  125. checkIn();
  126. //维护一个全部的收藏id列表
  127. if (GM_getValue("allCollectionData") === undefined) {
  128. loadUntilEmpty();
  129. }
  130. } else {
  131. //清除收藏的post的id列表
  132. //GM_deleteValue("allCollectionData");
  133. //清除签到的时间
  134. //GM_deleteValue("checkInTime");
  135. //清除签到方式
  136. //GM_deleteValue("isRandom");
  137. //清除自动方式
  138. //GM_deleteValue("isAuto");
  139. }
  140.  
  141. //签到判断
  142. function checkIn() {
  143. let timeNow =
  144. new Date().getFullYear() +
  145. "/" +
  146. (new Date().getMonth() + 1) +
  147. "/" +
  148. new Date().getDate();
  149. let oldTime = GM_getValue("checkInTime");
  150. if (!oldTime || oldTime !== timeNow) {
  151. //允许执行签到
  152. if (GM_getValue("isAuto") === true) {
  153. //执行自动签到
  154. getChicken(GM_getValue("isRandom")).then((responseData) => {
  155. if (responseData.success === true) {
  156. //签到成功之后存下时间
  157. GM_setValue("checkInTime", timeNow);
  158. console.log(`[NodeSeek] 签到:`, responseData.message);
  159. } else if (responseData.message === "今天已完成签到,请勿重复操作") {
  160. //存下时间
  161. GM_setValue("checkInTime", timeNow);
  162. console.log(`[NodeSeek] 签到:`, responseData.message);
  163. } else {
  164. console.error("Error in checkIn:", error);
  165. }
  166. });
  167. } else {
  168. //执行手动签到
  169. //处理按钮
  170. let right_panel = document.querySelector("#nsk-right-panel-container");
  171. let new_check = document.createElement("div");
  172. let publish_btn = document.querySelector(".btn.new-discussion");
  173. let publish_btn_parent = publish_btn.parentNode;
  174. new_check.innerHTML = '<a class="btn new-discussion">签到</a>';
  175. //展示签到按钮
  176. right_panel.insertBefore(new_check, publish_btn_parent);
  177. setupCursorStyle(new_check);
  178. new_check.onclick = function () {
  179. getChicken(GM_getValue("isRandom")).then((responseData) => {
  180. console.log(responseData.message);
  181. if (responseData.success === true) {
  182. //签到成功之后存下时间
  183. GM_setValue("checkInTime", timeNow);
  184. //弹窗示意多少鸡腿
  185. mscAlert(responseData.message);
  186. //隐藏
  187. new_check.style.display = "none";
  188. } else if (
  189. responseData.message === "今天已完成签到,请勿重复操作"
  190. ) {
  191. //存下时间
  192. GM_setValue("checkInTime", timeNow);
  193. mscAlert(responseData.message);
  194. //隐藏
  195. new_check.style.display = "none";
  196. } else {
  197. console.error("Error in checkIn:", error);
  198. }
  199. });
  200. };
  201. }
  202. } else {
  203. //返回已经签到按钮或隐藏
  204. }
  205. }
  206. // 签到
  207. async function getChicken(random) {
  208. const url = `https://www.nodeseek.com/api/attendance?random=${random}`;
  209. const data = {
  210. random: random,
  211. };
  212. try {
  213. const responseData = await postData(url, data);
  214. return responseData;
  215. } catch (error) {
  216. console.error("Error in getChicken:", error);
  217. return null;
  218. }
  219. }
  220. //自定义屏蔽词窗口
  221. let modal = document.createElement('div');
  222. let modalContent = document.createElement('div');
  223. let closeBtn = document.createElement('span');
  224. let promptText = document.createElement('p');
  225. let inputField = document.createElement('input');
  226. let submitBtn = document.createElement('button');
  227.  
  228. // 设置元素属性和内容
  229. modal.id = 'myModal';
  230. modal.className = 'modal';
  231. modalContent.className = 'modal-content';
  232. closeBtn.className = 'close';
  233. closeBtn.textContent = '×';
  234. promptText.textContent = '请输入要屏蔽的关键词,多个关键词用逗号隔开(注意:严格区分,最好是复制过来)';
  235. inputField.id = 'block-input';
  236. inputField.type = 'text';
  237. submitBtn.id = 'submit-button';
  238. submitBtn.textContent = '确定';
  239.  
  240. // 将所有元素添加到屏蔽词窗口中
  241. modalContent.appendChild(closeBtn);
  242. modalContent.appendChild(promptText);
  243. modalContent.appendChild(inputField);
  244. modalContent.appendChild(submitBtn);
  245. modal.appendChild(modalContent);
  246.  
  247. function createBlockWordsModal() {
  248. document.body.appendChild(modal);
  249. modal.style.display = "block";
  250. }
  251. // 自定义屏蔽词
  252. let blockDiv = document.querySelector(".sorter");
  253. let btnBlock = document.createElement("button");
  254. btnBlock.style.cursor = 'pointer';
  255. btnBlock.innerText = "关键词屏蔽";
  256. btnBlock.classList.add("btnBlock-post");
  257. if(blockDiv !== null){
  258. blockDiv.parentNode.insertBefore(btnBlock, blockDiv.nextSibling);
  259. }
  260.  
  261.  
  262. // 弹窗输入屏蔽词
  263. function getOldBlockWords() {
  264. let oldBlockWords = GM_getValue("blockWords");
  265. inputField.value = oldBlockWords ? oldBlockWords : '';
  266. modal.style.display = 'block';
  267. }
  268.  
  269. // 当用户点击 "确定" 按钮,获取输入值
  270. submitBtn.onclick = function() {
  271. let blockWords = inputField.value.trim();
  272. GM_setValue("blockWords", blockWords);
  273. modal.style.display = 'none';
  274. if (!blockWords) {
  275. window.location.reload();
  276. } else {
  277. blockPost();
  278. }
  279. }
  280.  
  281. // 当用户点击屏蔽词窗口外的任何地方或 "x" 图标,关闭屏蔽词窗口
  282. closeBtn.onclick = window.onclick = function(event) {
  283. if (event.target == modal || event.target == closeBtn) {
  284. modal.style.display = 'none';
  285. }
  286. }
  287.  
  288. // 点击按钮时,显示屏蔽词窗口
  289. btnBlock.onclick = function () {
  290. createBlockWordsModal();
  291. getOldBlockWords();
  292. };
  293.  
  294. //屏蔽帖子
  295. function blockPost() {
  296. //获取自定义的屏蔽词
  297. let blockWords = GM_getValue("blockWords");
  298. blockWords = blockWords === undefined ? '':blockWords.trim();
  299. if (blockWords) {
  300. let blockWordsArr = blockWords.split(",");
  301. let lists = document.querySelectorAll(".post-list");
  302. lists.forEach((list) => {
  303. let items = list.childNodes;
  304. items.forEach((element) => {
  305. let post_item = element.querySelector(".post-title>a");
  306. let post_title = post_item.innerText;
  307. blockWordsArr.forEach((word) => {
  308. if (post_title.includes(word)) {
  309. element.classList.add('blocked-post');
  310. }
  311. });
  312. });
  313. });
  314. }
  315. }
  316.  
  317. // 查看内容时的标签顺序样式修改
  318. let footTag = document.querySelectorAll(".floor-link");
  319. footTag.forEach((item) =>{
  320. item.className = "foot-tag";
  321. let itemChild = item.firstChild.textContent;
  322. item.firstChild.textContent = itemChild.replace(/^#/, "")
  323. })
  324.  
  325.  
  326.  
  327.  
  328. //查看帖子中的回复消息
  329. initializePage();
  330.  
  331. // 定义一个函数来发送GET请求
  332. async function loadData(page) {
  333. const url = `https://www.nodeseek.com/api/statistics/list-collection?page=${page}`;
  334. try {
  335. const response = await fetch(url);
  336. if (!response.ok) {
  337. throw new Error(`HTTP error! status: ${response.status}`);
  338. }
  339. const data = await response.json();
  340. return data;
  341. } catch (error) {
  342. console.error("Error:", error);
  343. return null;
  344. }
  345. }
  346. //POST请求
  347. async function postData(url = "", data = {}) {
  348. try {
  349. const response = await fetch(url, {
  350. method: "POST",
  351. headers: {
  352. "Content-Type": "application/json",
  353. },
  354. body: JSON.stringify(data),
  355. });
  356. const responseData = await response.json();
  357. return responseData;
  358. } catch (error) {
  359. console.error("Error in postData:", error);
  360. }
  361. }
  362. async function loadUntilEmpty(page = 1) {
  363. //收藏列表数组
  364. let allCollectionData = [];
  365. while (true) {
  366. const data = await loadData(page);
  367. data.collections.forEach((item) => {
  368. // 将获取到的数据加到数组中
  369. allCollectionData.push(item.post_id);
  370. });
  371. // 如果没有获取到数据或获取到的数据为空,停止加载
  372. if (!data || data.collections.length === 0) {
  373. //丢进去方便存取
  374. GM_setValue("allCollectionData", allCollectionData);
  375. break;
  376. }
  377. page++;
  378. }
  379. }
  380.  
  381. function initializePage() {
  382. let lists = document.querySelectorAll(".post-list");
  383. lists.forEach((list) => {
  384. let items = list.childNodes;
  385. items.forEach((element) => {
  386. setupPostItem(element);
  387. });
  388. });
  389. }
  390.  
  391. function setupPostItem(element) {
  392. let post_item = element.querySelector(".post-title>a");
  393. let new_div = document.createElement("span");
  394. if(mobileStatus){
  395. new_div.className = "info-triganle-mobile";
  396. }else{
  397. new_div.className = "info-triganle";
  398. }
  399. new_div.innerHTML = '<span class="triangle">▼</span>';
  400. element.querySelector(".post-info").append(new_div);
  401. setupCursorStyle(new_div);
  402. new_div.onclick = function () {
  403. if(GM_getValue("contentTime") + 1000 >= Date.now()){
  404. console.warn("请勿重复点击");
  405. }else{
  406. GM_setValue("contentTime",Date.now());
  407. GM_setValue("replyNum",element.querySelector(".info-item.info-comments-count > span").innerText);
  408. togglePostContent(post_item, element, new_div);
  409. }
  410. };
  411. }
  412.  
  413. function togglePostContent(post_item, element, new_div) {
  414. let id = post_item.href.replace("https://www.nodeseek.com", "");
  415. let content = document.getElementById(id);
  416. if (content) {
  417. toggleDisplay(content, new_div);
  418. } else {
  419. new_div.firstElementChild.innerText = "○";
  420. document.body.style.cursor = "wait";
  421. new_div.firstElementChild.className = "content-loaded";
  422. fetchContent(post_item.href, element, (contents, targetEle) => {
  423. insertContentAfter(contents, targetEle);
  424. loadNextPage(contents, targetEle, 1);
  425. new_div.firstElementChild.innerText = "▲";
  426. document.body.style.cursor = "auto";
  427. });
  428. }
  429. }
  430. //显隐箭头
  431. function toggleDisplay(content, new_div) {
  432. if (content.style.display === "none") {
  433. content.style.display = "block";
  434. new_div.firstElementChild.innerText = "▲";
  435. } else {
  436. content.style.display = "none";
  437. new_div.firstElementChild.innerText = "▼";
  438. }
  439. }
  440.  
  441. //获取div框中的内容
  442. function fetchContent(url, targetEle, callback) {
  443. const xhr = new XMLHttpRequest();
  444. xhr.open("GET", url, true);
  445. xhr.onload = function () {
  446. if (xhr.status !== 200) return;
  447.  
  448. const tempContainer = document.createElement("div");
  449. tempContainer.innerHTML = xhr.responseText;
  450. const contents = createContentDiv(url);
  451. const post_contents = tempContainer.querySelectorAll(".post-content");
  452. const colloct = appendPostContentBox(contents);
  453.  
  454. post_contents.forEach((e) => {
  455. modifyFootTagDivStyle(e);
  456. contents.firstChild.appendChild(e.parentElement);
  457. });
  458.  
  459. if (callback && typeof callback === "function") {
  460. callback(contents, targetEle);
  461. }
  462. };
  463. xhr.send();
  464. }
  465.  
  466. function createContentDiv(url) {
  467. const contents = document.createElement("div");
  468. contents.id = url.replace("https://www.nodeseek.com", "");
  469. contents.className = "content-div";
  470. return contents;
  471. }
  472.  
  473. function appendPostContentBox(contents) {
  474. contents.innerHTML += '<div class="post-content-box"></div>';
  475.  
  476. const colloct = contents.firstChild;
  477. colloct.innerHTML +=
  478. '<div data-v-372de460="" class="comment-menu">' +
  479. '<div data-v-372de460="" title="收藏" class="menu-item"><svg data-v-372de460="" class="iconpark-icon"><use data-v-372de460="" href="#star-6negdgdk"></use></svg></div>' +
  480. "</div>";
  481.  
  482. const icon = colloct.firstElementChild.querySelector(".menu-item");
  483.  
  484. const postId = getPostId(contents.id);
  485. const is_collected = GM_getValue("allCollectionData").some(
  486. (item) => item === postId
  487. );
  488. if (is_collected) {
  489. icon.style.color = "red";
  490. }
  491.  
  492. setupCursorStyle(icon);
  493. icon.onclick = function () {
  494. colloctContent(postId, colloct);
  495. };
  496. return colloct;
  497. }
  498.  
  499. function getPostId(id) {
  500. const regex = /\/post-(\d+)-1/;
  501. const match = id.match(regex);
  502. if (match != null) {
  503. return parseInt(match[1]);
  504. }
  505. return null;
  506. }
  507.  
  508. function modifyFootTagDivStyle(e) {
  509. const footTagDiv = e.parentElement.querySelector(".floor-link");
  510. footTagDiv.className = "foot-tag-div";
  511. const itemChild = footTagDiv.textContent;
  512. footTagDiv.textContent = itemChild.replace(/^#/, "")
  513. }
  514.  
  515. //帖子的收藏处理
  516. function colloctContent(post_id, colloct) {
  517. let icon = colloct.firstElementChild.querySelector(".menu-item");
  518. if (icon.style.color === "red") {
  519. //取消收藏处理
  520. let result = confirm("您确定要取消收藏吗?");
  521. if (result) {
  522. collection_del("remove", post_id).then((success) => {
  523. if (success === true) {
  524. icon.style.color = "";
  525. //维护一个全部的收藏id列表
  526. loadUntilEmpty();
  527. }
  528. });
  529. }
  530. } else {
  531. //收藏帖子
  532. collection_add("add", post_id).then((success) => {
  533. if (success === true) {
  534. icon.style.color = "red";
  535. //维护一个全部的收藏id列表
  536. loadUntilEmpty();
  537. }
  538. });
  539. }
  540. }
  541. //收藏方法
  542. async function collection_add(action_type, post_id) {
  543. const url = "https://www.nodeseek.com/api/statistics/collection";
  544. const data = {
  545. action: action_type,
  546. postId: post_id,
  547. };
  548. try {
  549. const responseData = await postData(url, data);
  550. if (responseData && responseData.success === true) {
  551. mscAlert("收藏成功!");
  552. }
  553. // else if (responseData && responseData.success === false) {
  554. // alert("你已经收藏过了!");
  555. // }
  556. return responseData ? responseData.success : null;
  557. } catch (error) {
  558. console.error("Error in collection_add:", error);
  559. return null;
  560. }
  561. }
  562.  
  563. //取消收藏方法
  564. async function collection_del(action_type, post_id) {
  565. const url = "https://www.nodeseek.com/api/statistics/collection";
  566. const data = {
  567. action: action_type,
  568. postId: post_id,
  569. };
  570. try {
  571. const responseData = await postData(url, data);
  572. if (responseData && responseData.success === true) {
  573. mscAlert("取消收藏成功!");
  574. }
  575. return responseData ? responseData.success : null;
  576. } catch (error) {
  577. console.error("Error in collection_del:", error);
  578. return null;
  579. }
  580. }
  581.  
  582. function insertContentAfter(content, targetEle) {
  583. let ul = targetEle.parentNode;
  584. ul.insertBefore(content, targetEle.nextSibling);
  585. }
  586.  
  587. function loadNextPage(contentDiv, targetEle, currentPage) {
  588. if(GM_getValue("replyNum") / 10 <= currentPage){
  589. return;
  590. }
  591. let nextPage = currentPage + 1;
  592. let nextPageUrl = targetEle
  593. .querySelector(".post-title>a")
  594. .href.replace(/(\d+)$/, nextPage);
  595. fetchContent(nextPageUrl, targetEle, (nextContents, targetEle) => {
  596. let postContentBox = contentDiv.querySelector(".post-content-box");
  597. if (nextContents.querySelector(".post-content")) {
  598. let nextPostContents = nextContents.querySelectorAll(".post-content");
  599. nextPostContents.forEach((e) => {
  600. postContentBox.appendChild(e.parentElement);
  601. });
  602. // 递归调用以加载后续页面,延迟1秒
  603. setTimeout(() => {
  604. loadNextPage(contentDiv, targetEle, nextPage);
  605. }, 1000);
  606. }
  607. });
  608. }
  609.  
  610. function setupCursorStyle(element) {
  611. element.addEventListener("mouseover", function () {
  612. document.body.style.cursor = "pointer";
  613. });
  614. element.addEventListener("mouseout", function () {
  615. document.body.style.cursor = "auto";
  616. });
  617. }
  618.  
  619. let css = `
  620. .content-div {
  621. height: 600px;
  622. padding: 20px;
  623. margin: 10px auto;
  624. border: 1px solid gray;
  625. border-radius: 10px;
  626. overflow: scroll;
  627. }
  628.  
  629. .post-content-box {
  630. border-bottom: 2px dashed gray;
  631. padding-bottom: 10px;
  632. margin-bottom: 10px;
  633. }
  634.  
  635. .triangle {
  636. font-size: medium;
  637. color: gray;
  638. }
  639. .info-triganle{
  640. position: absolute;
  641. right: 54px;
  642. }
  643. .info-triganle-mobile{
  644. position: absolute;
  645. }
  646. .content-loaded {
  647. font-size: medium;
  648. color: red;
  649. }
  650. ::-webkit-scrollbar {
  651. width: 6px;
  652. height: 6px;
  653. }
  654. ::-webkit-scrollbar-track {
  655. border-radius: 3px;
  656. background: rgba(0,0,0,0.06);
  657. -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.08);
  658. }
  659. ::-webkit-scrollbar-thumb {
  660. border-radius: 3px;
  661. background: rgba(0,0,0,0.12);
  662. -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
  663. }
  664. .foot-tag{
  665. margin-left: 1rem;
  666. line-height: 0.5rem;
  667. border-radius: 0.5rem;
  668. display: inline-block;
  669. background-color: #f0f0f0;
  670. color: #bdbdbd;
  671. padding: 3px 9px;
  672. cursor: default;
  673. }
  674. .foot-tag-div{
  675. margin-left: 1rem;
  676. line-height: 0.5rem;
  677. border-radius: 0.5rem;
  678. display: inline-block;
  679. background-color: #f0f0f0;
  680. color: #bdbdbd;
  681. padding: 3px 9px;
  682. cursor: default;
  683. }
  684. .preview {
  685. margin: 1rem 0;
  686. border: 1px solid transparent;
  687. border-radius: 8px;;
  688. cursor: pointer;
  689. }
  690.  
  691. .preview:hover {
  692. border: 1px solid #c8c8c8;
  693. }
  694.  
  695. .preview > .post-content {
  696. height: 200px !important;
  697. margin-top: 0.5rem !important;
  698. }
  699.  
  700. .preview > .post-content.show-all {
  701. max-height: 200px;
  702. -webkit-mask-image:none;
  703. }
  704.  
  705. .preview .topic-link:link {
  706. color: black !important;
  707. }
  708. .btnBlock-post{
  709. background-color: #888;
  710. border: 1px solid #737373;
  711. border-radius: 3px;
  712. display: inline-flex;
  713. margin: 0 8px;
  714. position: absolute;
  715. color: var(--bg-main-color);
  716. left: 15%;
  717. }
  718. /* 屏蔽框 */
  719. .modal {
  720. display: none;
  721. position: fixed;
  722. z-index: 1;
  723. padding-top: 100px;
  724. left: 0;
  725. top: 0;
  726. width: 100%;
  727. height: 100%;
  728. overflow: auto;
  729. background-color: rgba(0,0,0,0.4);
  730. }
  731. .modal-content {
  732. height: 15%;
  733. background-color: #fefefe;
  734. margin: auto;
  735. padding: 20px;
  736. border: 1px solid #888;
  737. width: 60%;
  738. border-radius: 15px;
  739. box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
  740. }
  741. .close {
  742. color: #aaaaaa;
  743. float: right;
  744. font-size: 28px;
  745. font-weight: bold;
  746. }
  747. .close:hover,
  748. .close:focus {
  749. color: #000;
  750. text-decoration: none;
  751. cursor: pointer;
  752. }
  753. .modal p {
  754. font-size: 18px;
  755. font-weight: bold;
  756. }
  757. #block-input {
  758. width: 100%;
  759. padding: 12px 20px;
  760. margin: 8px 0;
  761. box-sizing: border-box;
  762. border: 2px solid #ccc;
  763. border-radius: 4px;
  764. background-color: #f8f8f8;
  765. resize: none;
  766. }
  767. #submit-button {
  768. background-color: #4CAF50;
  769. color: white;
  770. padding: 10px 33px;
  771. text-align: center;
  772. text-decoration: none;
  773. display: block;
  774. font-size: 16px;
  775. margin: 8px 2px;
  776. cursor: pointer;
  777. border: none;
  778. border-radius: 4px;
  779. width: auto;
  780. float: right;
  781. }
  782.  
  783. @media screen and (max-width: 600px) {
  784. .modal-content {
  785. width: 90%;
  786. height: 16%;
  787. }
  788. .btnBlock-post{
  789. background-color: #888;
  790. border: 1px solid #737373;
  791. border-radius: 3px;
  792. display: inline-flex;
  793. margin: 0 8px;
  794. position: absolute;
  795. color: var(--bg-main-color);
  796. left: 30%;
  797. }
  798. }
  799. `;
  800. GM_addStyle(css);
  801. })();