fuzetsu / manga-loader

standardize manga reading experience across the web
132 stars 61 forks source link

Double page + Infinite scroll #44

Closed panhartstuff closed 5 years ago

panhartstuff commented 5 years ago

Is there a way to have two pages side-by-side + infinite scroll? No reader have this feature for some reason. Can you please add it? Or can this be done in CSS?

fuzetsu commented 5 years ago

It can be done with css:

.ml-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.ml-images img:nth-of-type(odd) {
  justify-self: right;
}
.ml-counter { display: none; }

Might not be perfect for every scenario but should work.

EDIT: I guess it's kind of backwards for manga that read right to left.. hmm

fuzetsu commented 5 years ago

Improved version(s):

Right to left (like manga):

.ml-images {
  direction: rtl;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
}
.ml-images img {
  margin: 0;
  margin-bottom: 10px;
}
.ml-images img:nth-of-type(odd) {
  justify-self: left;
}
.ml-counter { display: none; }

Left to right

.ml-images {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
}
.ml-images img {
  margin: 0;
  margin-bottom: 10px;
}
.ml-images img:nth-of-type(odd) {
  justify-self: right;
}
.ml-counter { display: none; }

I'll probably include this in the default install as a css profile now that I've made it.

panhartstuff commented 5 years ago

Thanks a lot man, works perfectly!!

fuzetsu commented 5 years ago

No problem, you can also add max-height: 100vh; to .ml-images img if you want to limit the height of the image to the height of the window (so that you don't have to scroll as much when the images are large).

Enduser-only commented 2 years ago

Is there a way to offset pages, for example, having the first page appear alone or the last page appear alone while having the rest of the pages appear side by side? Also is there a way to have landscape pages appear on their own as well when using a double page set up?