client/posts: add transparency grid

Can be turned off in browsing settings.
This commit is contained in:
rr- 2016-06-11 21:50:21 +02:00
parent 07603be35e
commit 56432e6089
7 changed files with 17 additions and 2 deletions

View file

@ -192,8 +192,11 @@ function bundleConfig(config) {
}
function bundleBinaryAssets() {
copyFile('./img/favicon.png', './public/img/favicon.png');
copyFile('./img/404.png', './public/img/404.png');
glob('./img/*.png', {}, (er, files) => {
for (let file of files) {
copyFile(file, path.join('./public/img/', path.basename(file)));
}
});
}
const config = getConfig();

View file

@ -199,6 +199,9 @@ $safety-unsafe = #F3985F
background-color: alpha(@background-color, 0.15)
.post-container
.post-content.transparency-grid img
background: url('/img/transparency_grid.png');
text-align: center
.post-content
text-align: left

View file

@ -15,6 +15,9 @@
<%= ctx.makeCheckbox({text: 'Enable keyboard shortcuts', id: 'keyboard-shortcuts', name: 'keyboard-shortcuts', checked: ctx.browsingSettings.keyboardShortcuts}) %>
<a class='append icon' href='/help/keyboard'><i class='fa fa-question-circle-o'></i></a>
</li>
<li>
<%= ctx.makeCheckbox({text: 'Enable transparency grid', id: 'transparency-grid', name: 'transparency-grid', checked: ctx.browsingSettings.transparencyGrid}) %>
</li>
</ul>
</div>
<div class='messages'></div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

View file

@ -86,6 +86,9 @@ class PostContentControl {
const postContentNode = this._template({
post: this._post,
});
if (settings.getSettings().transparencyGrid) {
postContentNode.classList.add('transparency-grid');
}
this._containerNode.appendChild(postContentNode);
optimizedResize.add(() => this._refreshSize());
views.monitorNodeRemoval(

View file

@ -20,6 +20,7 @@ function getSettings(settings) {
upscaleSmallPosts: false,
endlessScroll: false,
keyboardShortcuts: true,
transparencyGrid: true,
};
let ret = {};
let userSettings = localStorage.getItem('settings');

View file

@ -24,6 +24,8 @@ class SettingsView {
form.querySelector('#endless-scroll').checked,
keyboardShortcuts:
form.querySelector('#keyboard-shortcuts').checked,
transparencyGrid:
form.querySelector('#transparency-grid').checked,
});
});