Skip to content

LiaTemplates/Fullscreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Fullscreen - Template

By importing this README via:

import: https://raw.githubusercontent.com/LiaTemplates/Fullscreen/0.0.1/README.md

into your document header, as it is shown below, an event listener will be added automatically to your course, which will hide the main nav bar of your course when you get into fullscreen mode by hitting F11.

<!--
author:   ...

import: https://raw.githubusercontent.com/LiaTemplates/Fullscreen/0.0.1/README.md
-->

# Main Title

Implementation

@onload

window.onresize = function (event) {
    var maxHeight = window.screen.height,
        maxWidth = window.screen.width,
        curHeight = window.innerHeight,
        curWidth = window.innerWidth;

    if (maxWidth == curWidth && maxHeight == curHeight) {
        const head = document.getElementById("lia-toolbar-nav")
        
        head.style.display="none"
        head.nextSibling.style["margin-top"] = "0px"

        window.fullscreenMode = true
    } else if (window.fullscreenMode){
        const head = document.getElementById("lia-toolbar-nav")
        
        head.style.display=""
        head.nextSibling.style["margin-top"] = ""

        window.fullscreenMode = false
    }
}

@end