diff --git a/client/build.js b/client/build.js index de06dd5a..c70eec4c 100644 --- a/client/build.js +++ b/client/build.js @@ -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(); diff --git a/client/css/posts.styl b/client/css/posts.styl index ee7eaedc..fbde8116 100644 --- a/client/css/posts.styl +++ b/client/css/posts.styl @@ -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 diff --git a/client/html/settings.tpl b/client/html/settings.tpl index 67c95a30..b3d828b8 100644 --- a/client/html/settings.tpl +++ b/client/html/settings.tpl @@ -15,6 +15,9 @@ <%= ctx.makeCheckbox({text: 'Enable keyboard shortcuts', id: 'keyboard-shortcuts', name: 'keyboard-shortcuts', checked: ctx.browsingSettings.keyboardShortcuts}) %> +
  • + <%= ctx.makeCheckbox({text: 'Enable transparency grid', id: 'transparency-grid', name: 'transparency-grid', checked: ctx.browsingSettings.transparencyGrid}) %> +
  • diff --git a/client/img/transparency_grid.png b/client/img/transparency_grid.png new file mode 100644 index 00000000..7ae81132 Binary files /dev/null and b/client/img/transparency_grid.png differ diff --git a/client/js/controls/post_content_control.js b/client/js/controls/post_content_control.js index db6cf2c8..1144425d 100644 --- a/client/js/controls/post_content_control.js +++ b/client/js/controls/post_content_control.js @@ -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( diff --git a/client/js/settings.js b/client/js/settings.js index 11d8b6da..433ff131 100644 --- a/client/js/settings.js +++ b/client/js/settings.js @@ -20,6 +20,7 @@ function getSettings(settings) { upscaleSmallPosts: false, endlessScroll: false, keyboardShortcuts: true, + transparencyGrid: true, }; let ret = {}; let userSettings = localStorage.getItem('settings'); diff --git a/client/js/views/settings_view.js b/client/js/views/settings_view.js index bdda3dd4..c4481663 100644 --- a/client/js/views/settings_view.js +++ b/client/js/views/settings_view.js @@ -24,6 +24,8 @@ class SettingsView { form.querySelector('#endless-scroll').checked, keyboardShortcuts: form.querySelector('#keyboard-shortcuts').checked, + transparencyGrid: + form.querySelector('#transparency-grid').checked, }); });