Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App.js features #7

Open
6 of 14 tasks
sc0ttj opened this issue Feb 18, 2019 · 4 comments
Open
6 of 14 tasks

App.js features #7

sc0ttj opened this issue Feb 18, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@sc0ttj
Copy link
Owner

sc0ttj commented Feb 18, 2019

Something like:

  • feature detection (add various classes to <body>, see issue 54)
  • remove a 'no-js' class from body
  • dynamic page/site search (uses Jets)
  • query string parser
  • a jQuery .load() alternative for loading pages or page fragments
  • simple redirect thing (can be used in 404.html to have custom URLs)
  • a simple 'trigger animate on scroll into view' thing
  • loadCSS, loadJS (from filament group)
  • lazy load images
  • data setter/getter (like dataPres.setData() and dataPres.getData())
  • load Disqus below post footer
  • detect slow network speeds, show more lightweight content (fallbacks, imgs, vids, etc)
  • generic table filter/sorter thing: look for .sortable-items class, make their contents filterable/sortable.. add a little form above the table/content
  • a shopping cart

Advanced:

PWA-esque thing:

  • download various assets to localStorage
    • css
    • svg icons
    • google fonts css
  • download site content to localStorage
    • ?
  • show/hide "You are Offline" popup
  • when offline:
    • use JS to handle links
    • gets content of link
    • updates page with new content
    • updates url to chosen link
@sc0ttj sc0ttj added the enhancement New feature or request label Feb 20, 2019
@sc0ttj
Copy link
Owner Author

sc0ttj commented Apr 9, 2019

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

  • decent cross browser support
  • loads all kinds of stuff (not just images)
  • supports <picture> and srcset
  • other stuff

@sc0ttj
Copy link
Owner Author

sc0ttj commented Sep 19, 2019

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
Copy link
Owner Author

sc0ttj commented Sep 20, 2019

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
Copy link
Owner Author

sc0ttj commented Sep 21, 2019

Also needs a simple shopping cart built-in .. See #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant