DevRant-MOD

Useful MODs for DevRant

  1. // ==UserScript==
  2. // @name DevRant-MOD
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Useful MODs for DevRant
  6. // @author Himalay
  7. // @match https://www.devrant.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. "use strict";
  13. document.querySelector("style").innerHTML += `* {
  14. user-select: text !important;
  15. -moz-user-select: text !important;
  16. -webkit-user-select: text !important;
  17. }
  18. .rant-lightbox {
  19. position: fixed;
  20. top: 0;
  21. left: 0;
  22. width: 100%;
  23. height: 100%;
  24. background: rgba(0, 0, 0, 0.8);
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. flex-direction: column;
  29. z-index: 9999;
  30. padding: 10px;
  31. }
  32. .rant-lightbox img {
  33. max-height: 90vh;
  34. }
  35. .rant-lightbox a {
  36. margin-top: 10px;
  37. font-size: 1.5em;
  38. }
  39. .body-col1 {
  40. display: none;
  41. }
  42. .body-col2, .rantlist-bg, .rantlist-content-col, .rantlist-title-text {
  43. width: 100%;
  44. }
  45. .rantlist-content-col {
  46. width: calc(100% - 50px);
  47. }
  48. .rant-image {
  49. overflow-y: auto;
  50. }
  51. .rant-image img {
  52. max-width: 100%;
  53. }
  54. .addrant-btn {
  55. margin-left: 0;
  56. }`;
  57. document.addEventListener("click", e => {
  58. if (e.target.parentElement.classList.contains("rant-image")) {
  59. document.body.innerHTML += `<div class="rant-lightbox" onclick="this.parentElement.removeChild(this);"><img src="${e
  60. .target.src}" /><a href="${e.target
  61. .src}" download="${e.target.src.split("/").pop()}">?</a></div>`;
  62. e.preventDefault();
  63. e.stopPropagation();
  64. }
  65. });
  66. })();