naver / egjs-infinitegrid Goto Github PK
View Code? Open in Web Editor NEWA module used to arrange card elements including content infinitely on a grid layout.
Home Page: https://naver.github.io/egjs-infinitegrid/
License: MIT License
A module used to arrange card elements including content infinitely on a grid layout.
Home Page: https://naver.github.io/egjs-infinitegrid/
License: MIT License
In case of using getStatus method, the infinitegrid doesn't save the position of scroll.
To keep a sight of user, we should restore the position of scroll.
propose use infiniteGrid in div/span/... (overflow:scroll)
When the width of item is 20%, column size return 4.
we expect column size is 5.
Make default demo for test case
<InfiniteGrid/>
<ul id="grid">
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
move to some item position.
when isOverflowScroll options is 'true', infiniteGrid create dom element.
this is div
element.
but, user want to use other tags like 'ul' , 'ol', ...
@sculove commented on Fri Apr 22 2016
I think IntersectionObserver spec can use at infiniteGrid and visible.
Therefore, check this spec.
https://developers.google.com/web/updates/2016/04/intersectionobserver
@kishu commented on Fri Nov 18 2016
Intersection Observer API is good, but it is an experimental technology and not supported by most browsers. I want you to keep looking over time.
The implementation code for polyfill of this API(https://github.com/WICG/IntersectionObserver/tree/gh-pages/polyfill) is interesting. I will refer to it in the egjs conversion work.
dependency issue #3
the infiniteGrid just supports vertical scroll.
@sculove commented on Fri Apr 22 2016
Checks the detail-view module without moving pages
Most of the google services show a detail-view without moving pages.
and using many effects
@sculove commented on Fri Apr 22 2016
Alos, I'd like to support the common detail-view module in an infiniteGrid
@sculove commented on Fri Dec 09 2016
When prepending, infiniteGrid is relayout
support ts definition.
@sculove commented on Thu Aug 24 2017
eg-infinitegrid is not support 'sourceMap'
take a look webpack config files.
The infiniteGrid uses children as items.
I would like to support items selector options.
ref #1
provide layout interface
layout(groups: Group[], outline: number[]);
append(group: Group, outline: number[]): Group;
prepend(group: Group, outline: number[]): Group;
setViewport(width: number, height: number);
If you use infinitegrid in AMD, you should use 'infiniteGrid' as named.
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("@egjs/component"));
else if(typeof define === 'function' && define.amd)
define("InfiniteGrid", ["@egjs/component"], factory);
else if(typeof exports === 'object')
exports["InfiniteGrid"] = factory(require("@egjs/component"));
else
root["eg"] = root["eg"] || {}, root["eg"]["InfiniteGrid"] = factory(root["eg"]["Component"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_5__) {
If you remove umdNamedDefine
property, you can use something name.
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("@egjs/component"));
else if(typeof define === 'function' && define.amd)
define(["@egjs/component"], factory);
else if(typeof exports === 'object')
exports["InfiniteGrid"] = factory(require("@egjs/component"));
else
root["eg"] = root["eg"] || {}, root["eg"]["InfiniteGrid"] = factory(root["eg"]["Component"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_5__) {
consider infinitegrid component for react/angular/vue
To improve usability, we consider data structure.
@sculove commented on Tue Dec 06 2016
if firefox devtools runs, it's ok.
but, if you don't use devtools, infiniteGrid does not append.
Support parallax scrolling.
If item has parallax class name and image is longer than the area surronding this, apply parallax scrolling.
Use only option parallax.
Parallax's options have selector, strength, ...
selector option indicates the image to parallax scroll.
strength option indicates parallax scroll speed.
If item has not the image indicated selector, this item does not apply parallax scrolling.
var ig = new eg.InfiniteGrid(container, {
parallax: true,
/*
default
{
selector: "img",
strength: 1,
*/
});
// or
var ig = new eg.InfiniteGrid(container, {
parallax: {
selector: ".thumbnail",
strength: 1, // default 1
},
});
Image is longer than the area(item)
.item {
height: 400px;
overflow:hidden;
}
img {
height: 600px;
}
Surrounding area is images's parent node.
<div class="item">
<img src="...." class="thumbnail">
</div>
Parallax scrolling use transform level 1.
This is supported from IE9 or later, but use with a prefix.
Using polyfill you can't attach event in window.
so, you should check attachEvent
first.
and then you should check addEventListener.
https://github.com/naver/egjs-infinitegrid/blob/master/src/utils.js#L65-L78
new eg.InfiniteGrid("#grid", {
itemSelector: ".item"
}).on({
"imageError": function(e) {
// e.target: image element. - replace image element or src
// e.item: item element. - If the item was previously deleted, this value is undefined.
},
});
infiniteGrid can use with @egjs/persist
for usability add demo!
@netil commented on Fri Aug 05 2016
For some components, can be useuful improving rendering cost with CSS containment property.
https://developers.google.com/web/updates/2016/06/css-containment
Try to find if it's applicable.
@netil commented on Wed Nov 16 2016
There're many behavioural causing side effects.
When panels are fixed size is worth to apply, but there's no guarantee of external(ex. intentional trigger) layout transformation.
Try research and look for more practical use cases of that spec. keeping this issue for later.
we want that the infinite feature is used independently.
infiniteGrid 3.0 omits isTrusted property on append/prepend/change events
fix start page for v3.0.0
@sculove commented on Tue Apr 26 2016
The infiniteGrid use the scroll event.
If may scroll events are fired, infiniteGrid could be facing a problem.
we need to throttle scroll event.
research how to show loading UI with flexible
research following layout styles.
ref http://blog.vjeux.com/2012/image/image-layout-algorithm-google-plus.html
If the server provides the width and height of the card, you must place the card based on its width and heigth value.
Remember items' column when prepended on SquareLayout
appended items and prepended items are different.
because of columnCount, sometimes it looks different than expected
@sculove commented on Thu Sep 14 2017
provide isTrusted property on events.
When the event is fired using API method, isTrusted is false
When the event is fired using User action, isTrusted is true
if trigger resize event, items' length is doubled.
previous items are the same as the next items.
previous items are not show. next items are show after previous items.
@sculove commented on Wed Dec 16 2015
When card is append and prepend, card position isn't restored like this picture.
infiniteGrid needs to manage card position.
When user force scrolllbar on the top on PC, infiniteGrid prpend is weird.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.