Skip to content

Commit

Permalink
fix(RightMenus): Reader Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
inkss authored Nov 16, 2022
1 parent ad8eaa8 commit 3207bbf
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions source/js/plugins/rightMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,17 @@ RightMenus.fun = (() => {
DOMController.removeList([
'.cus-article-bkg', '.iziToast-overlay', '.iziToast-wrapper', '.prev-next',
'footer', '#l_header', '#l_cover', '#l_side', '#comments', '#s-top', '#BKG',
'#rightmenu-wrapper', '.nav-tabs', '.parallax-mirror', '.new-meta-item.share', 'div.footer'
'#rightmenu-wrapper', '.nav-tabs', '.parallax-mirror', '.new-meta-item.share',
'.new-meta-box', 'button.btn-copy', 'iframe'
]);
DOMController.setStyleList([
['body', 'backgroundColor', 'unset'], ['#l_main', 'width', '100%'], ['#post', 'boxShadow', 'none'],
['#post', 'background', 'none'], ['#post', 'padding', '0'], ['h1', 'textAlign', 'center'],
['h1', 'fontWeight', '600'], ['h1', 'fontSize', '2rem'], ['h1', 'marginBottom', '20px'],
['.tab-pane', 'display', 'block'], ['.tab-content', 'borderTop', 'none'], ['.highlight>table pre', 'whiteSpace', 'pre-wrap'],
['.highlight>table pre', 'wordBreak', 'break-all'], ['.fancybox img', 'height', 'auto'], ['.fancybox img', 'weight', 'auto']
['body', 'backgroundColor', 'unset'], ['#l_main, .copyright.license', 'width', '100%'],
['#post', 'boxShadow', 'none'], ['#post', 'background', 'none'], ['#post', 'padding', '0'],
['h1', 'textAlign', 'center'], ['h1', 'fontWeight', '600'], ['h1', 'fontSize', '2rem'], ['h1', 'marginBottom', '20px'],
['.tab-pane', 'display', 'block'], ['.tab-content', 'borderTop', 'none'], ['.highlight>table pre', 'whiteSpace', 'pre-wrap'],
['.highlight>table pre', 'wordBreak', 'break-all'], ['.fancybox img', 'height', 'auto'], ['.fancybox img', 'weight', 'auto'],
['.copyright.license', 'margin', '0'], ['.copyright.license', 'padding', '1.25em 20px'],
['figure.highlight, .copyright.license', 'display', 'inline-block'],
]);
setTimeout(() => {
window.print();
Expand All @@ -563,11 +566,12 @@ RightMenus.fun = (() => {

fn.readMode = () => {
if (typeof ScrollReveal === 'function') ScrollReveal().clean('#comments');
DOMController.setStyle('#l_header', 'opacity', 0);
DOMController.fadeToggleList([
document.querySelector('#l_header'), document.querySelector('footer'),
document.querySelector('#l_cover'), document.querySelector('footer'),
document.querySelector('#s-top'), document.querySelector('.article-meta#bottom'),
document.querySelector('.prev-next'), document.querySelector('#l_side'),
document.querySelector('#comments')
document.querySelector('#comments'),
]);
DOMController.toggleClassList([
[document.querySelector('#l_main'), 'common_read'], [document.querySelector('#l_main'), 'common_read_main'],
Expand Down

0 comments on commit 3207bbf

Please sign in to comment.