sc0ttj / mdsh

A simple static site generator, using Markdown and Bash
https://sc0ttj.github.io/mdsh/
10 stars 0 forks source link

App.js features #7

Open sc0ttj opened 5 years ago

sc0ttj commented 5 years ago

Something like:

Advanced:

PWA-esque thing:

sc0ttj commented 5 years ago

About lazy loading, see this: https://addyosmani.com/blog/lazy-loading/

TLDR: Chrome will support it natively, so any lazy loading implementation could use that ....

Or just use lazySizes, from https://github.com/aFarkas/lazysizes

sc0ttj commented 4 years ago

better touchscreen detection:

        touch: function () {
            if (
                ('ontouchstart' in window) ||
                (window.DocumentTouch && document instanceof DocumentTouch) ||
                (window.hasOwnProperty &&
                    (
                        window.hasOwnProperty('ontouchstart') ||
                        (window.DocumentTouch && document instanceof DocumentTouch) ||
                        navigator.msMaxTouchPoints
                        )
                    )
                ) {
                return true;
            }
            // Fallback for certain samsung devices that fail above but pass below... :/
            if ('ontouchstart' in window) {
                return true;
            }
            return false;
        },
sc0ttj commented 4 years ago

For handling data on the page, passing it around between different javascripts, while not polluting global vars ... (all data must be accessed using window.DataManager.getData('name-of-dataset'))

<script>
window.DataManager && !window.DataManager.setData && (
    window.DataManager._internal={
        data:{}
    }, 
    window.DataManager.setData=function(a,t){
        return window.DataManager._internal.data[a]=t,t
    },
    window.DataManager.getData=function(a){
        return window.DataManager._internal.data[a]
    }
)
</script>
sc0ttj commented 4 years ago

Also needs a simple shopping cart built-in .. See https://github.com/sc0ttj/mdsh/issues/88