MovieChat.org - Mobile Companion

A more compact view for MovieChat.org on mobile.

  1. // ==UserScript==
  2. // @name MovieChat.org - Mobile Companion
  3. // @version 1.21
  4. // @description A more compact view for MovieChat.org on mobile.
  5. // @author RandomUsername404
  6. // @match https://moviechat.org/*
  7. // @require https://code.jquery.com/jquery-3.3.1.min.js
  8. // @run-at document-start
  9. // @grant none
  10. // @icon http://moviechat.org/favicons/favicon.ico
  11.  
  12. // @namespace https://greatest.deepsurf.us/users/105361
  13. // ==/UserScript==
  14.  
  15. $(document).ready(function() {
  16. var width = $(window).width();
  17.  
  18. // If current width <= 770px :
  19. if(width <= 770)
  20. {
  21. // Enlarge view and hide scrollbars
  22. $('.container').css( {'padding-right':'0px','padding-left':'0px','margin-right':'0','margin-left':'0','width':'100%'} );
  23. $('html').css('overflow', 'hidden');
  24.  
  25. // Move the logo slightly on the right
  26. $('#logo').css('margin-left', '1em');
  27.  
  28. // Slightly move the navbar
  29. $('.navbar-right').css('margin-right', '0px');
  30.  
  31. // Reduce the top-bar size
  32. $('.col-md-12').css('height', '4.8em');
  33. $('.navbar').css('height', '4.8em');
  34. $('.container').css('margin-top', '-0.7em');
  35.  
  36. // Hide the description and add a button to display it when requested
  37. $(".movie-overview").hide();
  38. var descriptionButton = $('<a class="btn btn-yellow btn-block" id="despBtn" href="#">Overview</a>');
  39. descriptionButton.insertBefore($("#discover"));
  40. $("#despBtn").css("margin-top","5px");
  41.  
  42. $("#despBtn").click(function(event){
  43. event.preventDefault();
  44. $(".movie-overview").toggle();
  45. });
  46.  
  47. // Make the author's name visible when possible
  48. if(width >= 450)
  49. {
  50. var authorDiv = $(".col-xs-3:last-child");
  51. (authorDiv).removeClass('hidden-xs');
  52. $('.col-xs-3').css('width', '16%');
  53. $(authorDiv).css( {'width':'18%','text-align':'left','overflow':'hidden','text-overflow':'ellipsis'} );
  54. }
  55.  
  56. // Remove the huge ads at the bottom of the screen
  57. //$("#rcjsload_358172").hide();
  58.  
  59. // Remove footer
  60. $(".footer").hide();
  61. $('body').css('background', 'white');
  62. }
  63.  
  64. });