Show HN: LayerJS – A simple UI composition and navigation library
layerjs.org
layerjs.org
https://github.com/layerJS/layerJS/blob/master/LICENSE
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software, including the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
> 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
> 2. The Software must not be used in the code base of HTML editors or web builders. A HTML editor is a software (or hosted web application) that can be used by a third party (the user of the HTML editor) to create HTML documents that can be exported and used elsewhere. A web builder is a software (or hosted web application) that can be used by a third party (the user of the web builder) to create HTML documents that are hosted or dynamically generated under a top level domain chosen by the third party. The code base is the source code of the HTML editor or web builder, including the source code of publicly available plugins. No calls to layerJS can be made from the code base, but third party users can use layerJS in their websites that are built with these HTML editors or web builders.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> This license is derived from the MIT license (https://opensource.org/licenses/MIT)
I view it more as a myth stemming from survivor bias.
Glad to hear that :)
You're piling on massive amounts of attributes, making your app almost impossible to read and figure out the transitions. Anything complex is going to become a tangled pile of nodes and code. It would take anyone but the original designer a long time to puzzle out what exactly is going on and figure out the workflow, unless there's also a ton of HTML comments in there too.
You have attributes that should just be classes with CSS (overflow: hidden prevents scrolling, not sure why you need lj-no-scrolling), you have html elements that actually need to have attributes to define their neighbours, and you're just overloading your HTML with a bunch of extra baggage that doesn't need to be there.
Look at your parallax example. A 30KB library, a bunch of superfluous divs, and a ton of extra attributes you need to try to figure out have successfully replaced "background-attachment: fixed". The sliding divs could be done so much more clearly with just a bit of javascript that tracks "current frame" and hides them all then shows the next one when you click the button. The ZoomUI is admittedly pretty, but I feel like you could do it much easier with just a click event that expands the frame via changing the classes on it, rather than all the extra baggage and divs and wrappers you need to make that work. The animations are pretty, but not worth the extra baggage it takes to use them.
It's a neat toy, but I can really only see it being usable by people who are inherently terrified of javascript and will do anything to avoid it. And even then they'd only need the simplest of use-cases, and they'd need to make sure it wouldn't be on something that would need updates, because I wouldn't want to have to come back to a project with this in 6 months.
However, the idea behind this project is pretty interesting. If you haven't already, do check out their presentation in the section "How LayerJS works".
This is just a get-off-my-lawn nitpick/feature request - because I think it looks really interesting, great work!
If you're looking for this in a standard form, follow the work being done on HTML modules and Declarative Custom Elements:
https://github.com/w3c/webcomponents/blob/gh-pages/proposals...
Together those will mean UI components without any JavaScript, that can depend on and load other UI components, etc.
It also just enhances your valid forms and markup, which means, if you don't do something weird, your page keeps working without JS as well.
The video didn't work on my machine. It goes as far as "How does it work?" and then it's just random dots all over the page.
And the last straw was the pop-up asking me if I want more information when I'd only been on the page for five seconds. How do I know if I want more information if I haven't had a chance to look at the page yet?
Usually I lump these into "yet another JS library to throw on the fire." But this one seems a little different. We'll see.
The video (actually an animation) had some trouble on safari where the container background was on top of the 3d elements. I hope its that one. This is hot-fixed right now
The chat window should actally open only after a minute. I know it can be a bit nasty but we need feedback (:
And is one minute really a good length of time for someone to grok what's on your page? How long is the video?
I also found a bug (latest Chrome on macOS):
- open https://layerjs.org in a new tab
- navigate to https://layerjs.org/examples.html
- close tab
- reopen tab with cmd+shift+t
- pressing back will change the URL back to https://layerjs.org but the page will not change
I'd like to ask you how did you manage to support all those JavaScript frameworks in one go? It's still very possible for me to revert to vanilla js instead of getting locked into Vue.js
Of course, I realize that implementing this would be a lot of effort and would require change in your release flow.
But just in case, there's more demand for what I suggest, here's an inspiration from FontAwesome: https://fontawesome.com/get-started/svg-with-js. Note how they provide a fontawesome-all.js having all the icons. But they also provide separate fa-*.js for different icon families for the people who don't care about downloading the whole thing.
I’m a lazy person when it comes to updating the OS and apps, but let me update both and get back to you.
> head of you document
When I disabled JavaScript to get rid of the annoying navigation bar, the rest of the site stopped working.