Advertisement
ZEkA10000

SoFurry mobile helper

May 20th, 2024
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 5.89 KB | Source Code | 0 0
  1. // ==UserScript==
  2. // @name         SoFurry Mobile Chat Helper
  3. // @namespace    http://tampermonkey.net/
  4. // @version      2024-05-20
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://www.sofurry.com/chat
  8. // @icon         href="https://www.sofurryfiles.com/static/icons/touch-icon-iphone4.png"
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.     setTimeout(()=>{
  15.         var _is_mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent);
  16.  
  17.         if (_is_mobile) {
  18.             let _meta = document.createElement("meta")
  19.             _meta.setAttribute("name", "viewport")
  20.             _meta.setAttribute("content", "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")
  21.             document.head.appendChild(_meta)
  22.  
  23.             _meta = document.createElement("script")
  24.             _meta.setAttribute("src", "https://kit.fontawesome.com/47e7557a3b.js")
  25.             _meta.setAttribute("crossorigin", "anonymous")
  26.             document.head.appendChild(_meta)
  27.  
  28.             document.querySelector(".topbar-nav .logo").nextSibling.remove()
  29.  
  30.             let update_nav_button = function(_selector, _class, _index = 0) {
  31.                 document.querySelectorAll(_selector)[_index].innerText = ""
  32.                 document.querySelectorAll(_selector)[_index].setAttribute("class", _class)
  33.                 document.querySelectorAll(_selector)[_index].setAttribute("style", "padding: 8px 4px; font-size: 24px !important")
  34.             }
  35.             update_nav_button(".topbar-nav a[href=\"/browse/all\"]", "fas fa-search")
  36.             update_nav_button(".topbar-nav a[href=\"/market\"]", "fas fa-store")
  37.             update_nav_button(".topbar-nav a[href=\"/groups\"]", "fas fa-users")
  38.             update_nav_button(".topbar-nav a[href=\"/chat\"]", "fas fa-comments")
  39.             update_nav_button(".topbar-nav a[href=\"/forum\"]", "fas fa-newspaper")
  40.  
  41.             document.querySelectorAll(".sfbutton .button")[0].innerHTML = "+"
  42.             document.querySelectorAll(".sfbutton .button")[0].setAttribute("style", "padding: 8px 4px; font-size: 24px !important")
  43.             document.querySelectorAll(".sfbutton .button")[1].innerHTML = "-"
  44.             document.querySelectorAll(".sfbutton .button")[1].setAttribute("style", "padding: 8px 4px; font-size: 24px !important")
  45.             document.querySelectorAll(".sfbutton .button")[2].innerHTML = "<span class=\"fa-solid fa-list\"></span>"
  46.             document.querySelectorAll(".sfbutton .button")[2].setAttribute("style", "padding: 4px 6px !important; font-size: 19px !important;")
  47.             document.querySelectorAll(".sfbutton .button")[3].innerHTML = "<span class=\"fa-solid fa-eraser\"></span>"
  48.             document.querySelectorAll(".sfbutton .button")[3].setAttribute("style", "padding: 4px 6px !important; font-size: 19px !important;")
  49.             document.querySelectorAll(".sfbutton .button")[4].innerHTML = "RP character..."
  50.             document.querySelectorAll(".sfbutton .button")[5].innerHTML = "<span class=\"fa-solid fa-palette\"></span>"
  51.             document.querySelectorAll(".sfbutton .button")[5].setAttribute("style", "padding: 4px 6px !important; font-size: 19px !important;")
  52.             document.querySelectorAll(".sfbutton .button")[5].parentNode.parentNode.parentNode.style.float ="none"
  53.             document.querySelector("#sf-chat-messages-cont").style.width = "px"
  54.  
  55.  
  56.             _meta = document.createElement("div")
  57.             _meta.setAttribute("class", "sfbutton")
  58.             _meta.innerHTML = `<span id="toggle_users"></span>`
  59.             document.querySelector(".sf-align-left").appendChild(_meta)
  60.  
  61.             _meta = document.createElement("a")
  62.             _meta.setAttribute("class", "button buttonsmall")
  63.             _meta.href = "#"
  64.             _meta.setAttribute("style", "padding: 4px 6px !important; font-size: 19px !important;")
  65.             _meta.innerHTML = `<span class="fa-solid fa-user" aria-hidden="true"></span>`
  66.             _meta.onclick = function() { document.querySelector("#sf-userlist-cont").style.left = document.querySelector("#sf-userlist-cont").style.left == "0px" ? "100vw" : "0px"}
  67.             document.querySelector("#toggle_users").appendChild(_meta)
  68.  
  69.             _meta = document.createElement("style")
  70.             _meta.innerHTML = `
  71.             .fa, .far, .fas, .sfbutton .button span{
  72.                 font-family: "Font Awesome 5 Free" !important;
  73.             }
  74.             #sf-chat-roomcontrols div {
  75.                 display: flex;  margin-right: 4px;
  76.             }
  77.             #sf-chat-right {
  78.                 width: 100px;
  79.             }
  80.             #sf-userlist-cont {
  81.                 width: 100%;
  82.                 background-color: #000e;
  83.                 z-index: 9699;
  84.                 position: fixed;
  85.             }
  86.             #sf-chat-messages td {
  87.                 max-width: none;
  88.             }
  89.             body, div.sf-main {
  90.                 min-width:auto;
  91.             }
  92.             .topbar-nav input[type="text"][value=""] {
  93.                 width: 4em
  94.             }
  95.             #sf-chat-messages-cont {
  96.                 width: 94vw;
  97.             }
  98.             .sf-chat-timestamp {
  99.                 font-size: 8px !important;
  100.             }
  101.             #sf-chat-input {
  102.                 width: 80% !important;
  103.                 max-width: 80% !important;
  104.                 min-width: 80% !important;
  105.             }
  106.             #sf-chat-submit {
  107.                 float: unset;
  108.                 height: 52px;
  109.                 text-align: center;
  110.                 padding: 0;
  111.                 width: 48px;
  112.                 margin-top: -2px;
  113.             }
  114.             #sf-chat-center {
  115.                 padding-left: 0;
  116.             }
  117.             `
  118.  
  119.             document.head.appendChild(_meta)
  120.  
  121.        }
  122.     }, 3000)
  123.     // Your code here...
  124. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement