MCPcopy
hub / github.com/ollm/OpenComic / showNextComic

Function showNextComic

scripts/reading.js:1826–1921  ·  view source on GitHub ↗
(mode, animation = true, invert = false)

Source from the content-addressed store, hash-verified

1824
1825//Begins to show the next comic
1826function showNextComic(mode, animation = true, invert = false)
1827{
1828 var content = template.contentRight().children('div');
1829 var contentWidth = content.width();
1830 var contentHeight = content.height();
1831
1832 clearTimeout(showComicSkip);
1833
1834 if(mode == 1)
1835 {
1836 var transition = _config.readingViewSpeed < _config.readingDelayComicSkip ? _config.readingViewSpeed : _config.readingDelayComicSkip;
1837
1838 if(_config.readingDelayComicSkip != 0)
1839 {
1840 if(readingViewIs('scroll'))
1841 {
1842 var skip = template.contentRight('.reading-skip-bottom');
1843
1844 skip.css({
1845 'transition': transition+'s, background-color 0.2s, box-shadow 0.2s',
1846 'transform': 'translate(0px, -116px)',
1847 'opacity': 1,
1848 });
1849
1850 var scale = ((contentHeight - 132) / contentHeight);
1851
1852 template.contentRight('.reading-body').css({
1853 'transform-origin': 'center '+(template.contentRight('.reading-body').height() - contentHeight)+'px',
1854 'transition': 'transform '+((animation) ? transition : 0)+'s, background-color 0.2s, box-shadow 0.2s',
1855 'transition-property': 'transform',
1856 'transform': 'scale('+scale+')',
1857 });
1858 }
1859 else
1860 {
1861 var skip = template.contentRight('.reading-skip-right');
1862
1863 skip.css({
1864 'transition': transition+'s, background-color 0.2s, box-shadow 0.2s',
1865 'transform': 'translate(-116px, 0px)',
1866 'opacity': 1,
1867 });
1868
1869 var scale = ((contentWidth - 132) / contentWidth);
1870
1871 template.contentRight('.reading-body > div').css({
1872 'transform-origin': '0px center',
1873 'transition': 'transform '+((animation) ? transition : 0)+'s, background-color 0.2s, box-shadow 0.2s',
1874 'transition-property': 'transform',
1875 'transform': 'scale('+scale+') translate(-'+(contentWidth * (readingViewIs('slide') ? (indexNum - 1) : 0))+'px, 0px)',
1876 });
1877 }
1878
1879 skip.find('circle').css('animation-duration', _config.readingDelayComicSkip+'s').removeClass('a').delay(10).queue(function(next){$(this).addClass('a');next();});
1880 }
1881
1882 if(invert)
1883 showComicSkip = setTimeout('reading.progress.save(); reading.setFromSkip(); dom.openComic(true, "'+escapeQuotes(escapeBackSlash(dom.previousComic()), 'doubles')+'", "'+escapeQuotes(escapeBackSlash(dom.history.mainPath), 'doubles')+'", true, false, true);', _config.readingDelayComicSkip * 1000);

Callers 3

stayInLineFunction · 0.85
goNextFunction · 0.85
goPreviousFunction · 0.85

Calls 3

readingViewIsFunction · 0.85
escapeQuotesFunction · 0.85
escapeBackSlashFunction · 0.85

Tested by

no test coverage detected