Dynamic Google Book Pages

I was wondering if it is possible to do something like this with Javascript. I think itโ€™s very difficult to implement (just try resizing the window) and I donโ€™t know if there is anything on the Internet (I did not find anything).

+6
source share
1 answer

It is simple if you can transfer the text of an entire book to a page.

Simple To Do List (MVC)

  • PHP: get a book from db and pass its contents view
  • Create Four DIVs
    • first previous page action
    • second to left page
    • third to right page
    • fourth to next page action

these DIVs are the browser window height at 100% and their width:

  • 30px
  • (page.width-60) / 2
  • (page.width-60) / 2
  • 30px

and through Javascript, you simply divide the text of the book into as many pages using word count (for example, one page == 200 words )

and if the page is not so tall as to take all the text, scroll vertically, as in this example

more functions that they implement:

  • search (see javascript string.search ())
  • change font size (see javascript css methods or read font size to change javascript )
  • chapter-by-chapter walking book (depends on your implementation * 1)
  • bottom slider (again, it depends on your implementation, but the jquery slider is quite applicable for this)

* 1

  • you can simply transfer the text of your book as an array in chapters
  • you can only transfer chapters and receive chapter text with an AJAX call
  • or whatever you think about ...

About ready-made implementations you can see:

+4
source

Source: https://habr.com/ru/post/894459/


All Articles