Reader-Friendly React Native Docs

Save screen space on React Native Document for better reading experiences, as it should be.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Reader-Friendly React Native Docs
// @namespace    af-rndoc-cleanify
// @version      0.1
// @description  Save screen space on React Native Document for better reading experiences, as it should be.
// @author       Paranoid_AF
// @match        https://reactnative.dev/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // Remove announcement.
    document.querySelector(".announcement").style.display = "none";
    document.querySelector(".headerWrapper.wrapper").style.paddingTop = "0";
    document.querySelector(".navPusher").style.paddingTop = "60px";
    document.querySelector(".docsNavContainer").style.top = "0";
    document.querySelector(".docsNavContainer").style.height = "100vh";
    // Add animations to nav bar
    document.querySelector(".fixedHeaderContainer").style.top = "0";
    document.querySelector(".fixedHeaderContainer").style.transition = "top .3s";
    // Hide nav bar when scroll down.
    var lastScroll = 0;
    window.addEventListener("DOMContentLoaded", function(e){
        lastScroll = window.scrollY;
    })
    document.addEventListener("scroll", function(e){
        if(lastScroll < window.scrollY){
           document.querySelector(".fixedHeaderContainer").style.top = "-60px";
        }else{
           document.querySelector(".fixedHeaderContainer").style.top = "0";
        }
        lastScroll = window.scrollY;
    });
})();