diff --git a/public/render/.gitkeep b/public/render/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/render/al/admiral_graf_spee_1.png b/public/render/al/admiral_graf_spee_1.png deleted file mode 100644 index 3738d3b..0000000 Binary files a/public/render/al/admiral_graf_spee_1.png and /dev/null differ diff --git a/public/render/al/admiral_hipper_1.png b/public/render/al/admiral_hipper_1.png deleted file mode 100644 index 3e0e11a..0000000 Binary files a/public/render/al/admiral_hipper_1.png and /dev/null differ diff --git a/public/render/al/akagi_1.png b/public/render/al/akagi_1.png deleted file mode 100644 index 7950bff..0000000 Binary files a/public/render/al/akagi_1.png and /dev/null differ diff --git a/public/render/al/akashi_1.png b/public/render/al/akashi_1.png deleted file mode 100644 index 97e1ab2..0000000 Binary files a/public/render/al/akashi_1.png and /dev/null differ diff --git a/public/render/al/akashi_2.png b/public/render/al/akashi_2.png deleted file mode 100644 index 920e516..0000000 Binary files a/public/render/al/akashi_2.png and /dev/null differ diff --git a/public/render/al/atago_1.png b/public/render/al/atago_1.png deleted file mode 100644 index b8ed9c4..0000000 Binary files a/public/render/al/atago_1.png and /dev/null differ diff --git a/public/render/al/atago_3.png b/public/render/al/atago_3.png deleted file mode 100644 index c891e45..0000000 Binary files a/public/render/al/atago_3.png and /dev/null differ diff --git a/public/render/al/atago_4.png b/public/render/al/atago_4.png deleted file mode 100644 index b48a0fb..0000000 Binary files a/public/render/al/atago_4.png and /dev/null differ diff --git a/public/render/al/atago_5.png b/public/render/al/atago_5.png deleted file mode 100644 index e5c49b9..0000000 Binary files a/public/render/al/atago_5.png and /dev/null differ diff --git a/public/render/al/belfast_2.png b/public/render/al/belfast_2.png deleted file mode 100644 index d172472..0000000 Binary files a/public/render/al/belfast_2.png and /dev/null differ diff --git a/public/render/al/choukai_1.png b/public/render/al/choukai_1.png deleted file mode 100644 index a26432b..0000000 Binary files a/public/render/al/choukai_1.png and /dev/null differ diff --git a/public/render/al/deutschland_1.png b/public/render/al/deutschland_1.png deleted file mode 100644 index 8007102..0000000 Binary files a/public/render/al/deutschland_1.png and /dev/null differ diff --git a/public/render/al/enterprise_1.png b/public/render/al/enterprise_1.png deleted file mode 100644 index 8e0f53e..0000000 Binary files a/public/render/al/enterprise_1.png and /dev/null differ diff --git a/public/render/al/glorious_1.png b/public/render/al/glorious_1.png deleted file mode 100644 index 49ed6b2..0000000 Binary files a/public/render/al/glorious_1.png and /dev/null differ diff --git a/public/render/al/hammann_1.png b/public/render/al/hammann_1.png deleted file mode 100644 index 7b7785d..0000000 Binary files a/public/render/al/hammann_1.png and /dev/null differ diff --git a/public/render/al/hammann_2.png b/public/render/al/hammann_2.png deleted file mode 100644 index 9695133..0000000 Binary files a/public/render/al/hammann_2.png and /dev/null differ diff --git a/public/render/al/hammann_3.png b/public/render/al/hammann_3.png deleted file mode 100644 index a979ab1..0000000 Binary files a/public/render/al/hammann_3.png and /dev/null differ diff --git a/public/render/al/hatsuharu_1.png b/public/render/al/hatsuharu_1.png deleted file mode 100644 index a1a96e2..0000000 Binary files a/public/render/al/hatsuharu_1.png and /dev/null differ diff --git a/public/render/al/kaga_1.png b/public/render/al/kaga_1.png deleted file mode 100644 index 3e2fcf6..0000000 Binary files a/public/render/al/kaga_1.png and /dev/null differ diff --git a/public/render/al/kaga_2.png b/public/render/al/kaga_2.png deleted file mode 100644 index 9a1d9b5..0000000 Binary files a/public/render/al/kaga_2.png and /dev/null differ diff --git a/public/render/al/kaga_3.png b/public/render/al/kaga_3.png deleted file mode 100644 index 222b237..0000000 Binary files a/public/render/al/kaga_3.png and /dev/null differ diff --git a/public/render/al/laffey_1.png b/public/render/al/laffey_1.png deleted file mode 100644 index 43d06df..0000000 Binary files a/public/render/al/laffey_1.png and /dev/null differ diff --git a/public/render/al/laffey_2.png b/public/render/al/laffey_2.png deleted file mode 100644 index 85df1c5..0000000 Binary files a/public/render/al/laffey_2.png and /dev/null differ diff --git a/public/render/al/laffey_3.png b/public/render/al/laffey_3.png deleted file mode 100644 index 737ecf1..0000000 Binary files a/public/render/al/laffey_3.png and /dev/null differ diff --git a/public/render/al/prinz_eugen_3.png b/public/render/al/prinz_eugen_3.png deleted file mode 100644 index d0229cc..0000000 Binary files a/public/render/al/prinz_eugen_3.png and /dev/null differ diff --git a/public/render/al/san_diego_1.png b/public/render/al/san_diego_1.png deleted file mode 100644 index 02ef20f..0000000 Binary files a/public/render/al/san_diego_1.png and /dev/null differ diff --git a/public/render/al/takao_3.png b/public/render/al/takao_3.png deleted file mode 100644 index 59761fc..0000000 Binary files a/public/render/al/takao_3.png and /dev/null differ diff --git a/public/render/al/unicorn_1.png b/public/render/al/unicorn_1.png deleted file mode 100644 index 3760532..0000000 Binary files a/public/render/al/unicorn_1.png and /dev/null differ diff --git a/public/render/al/unicorn_2.png b/public/render/al/unicorn_2.png deleted file mode 100644 index f9def61..0000000 Binary files a/public/render/al/unicorn_2.png and /dev/null differ diff --git a/public/render/al/unicorn_3.png b/public/render/al/unicorn_3.png deleted file mode 100644 index 72650c0..0000000 Binary files a/public/render/al/unicorn_3.png and /dev/null differ diff --git a/public/render/al/unicorn_4.png b/public/render/al/unicorn_4.png deleted file mode 100644 index 152cfa1..0000000 Binary files a/public/render/al/unicorn_4.png and /dev/null differ diff --git a/public/render/al/unicorn_6.png b/public/render/al/unicorn_6.png deleted file mode 100644 index 9f01dee..0000000 Binary files a/public/render/al/unicorn_6.png and /dev/null differ diff --git a/public/render/al/unicorn_7.png b/public/render/al/unicorn_7.png deleted file mode 100644 index 7c8b146..0000000 Binary files a/public/render/al/unicorn_7.png and /dev/null differ diff --git a/public/render/al/unicorn_8.png b/public/render/al/unicorn_8.png deleted file mode 100644 index 82c9cc7..0000000 Binary files a/public/render/al/unicorn_8.png and /dev/null differ diff --git a/public/render/al/yamashiro_1.png b/public/render/al/yamashiro_1.png deleted file mode 100644 index c80ff60..0000000 Binary files a/public/render/al/yamashiro_1.png and /dev/null differ diff --git a/public/render/al/yamashiro_2.png b/public/render/al/yamashiro_2.png deleted file mode 100644 index 88a43e5..0000000 Binary files a/public/render/al/yamashiro_2.png and /dev/null differ diff --git a/public/render/al/yamashiro_3.png b/public/render/al/yamashiro_3.png deleted file mode 100644 index 29b02d9..0000000 Binary files a/public/render/al/yamashiro_3.png and /dev/null differ diff --git a/public/render/al/yukikaze_1.png b/public/render/al/yukikaze_1.png deleted file mode 100644 index ac04fee..0000000 Binary files a/public/render/al/yukikaze_1.png and /dev/null differ diff --git a/public/render/miku/001.png b/public/render/miku/001.png deleted file mode 100644 index 60b0d50..0000000 Binary files a/public/render/miku/001.png and /dev/null differ diff --git a/public/render/miku/002.png b/public/render/miku/002.png deleted file mode 100644 index 67b4736..0000000 Binary files a/public/render/miku/002.png and /dev/null differ diff --git a/public/render/miku/003.png b/public/render/miku/003.png deleted file mode 100644 index 835c75d..0000000 Binary files a/public/render/miku/003.png and /dev/null differ diff --git a/public/render/miku/004.png b/public/render/miku/004.png deleted file mode 100644 index d5051fb..0000000 Binary files a/public/render/miku/004.png and /dev/null differ diff --git a/public/render/miku/005.png b/public/render/miku/005.png deleted file mode 100644 index 7a61a62..0000000 Binary files a/public/render/miku/005.png and /dev/null differ diff --git a/public/render/miku/006.png b/public/render/miku/006.png deleted file mode 100644 index 4a9c946..0000000 Binary files a/public/render/miku/006.png and /dev/null differ diff --git a/public/render/miku/007.png b/public/render/miku/007.png deleted file mode 100644 index 04ecf64..0000000 Binary files a/public/render/miku/007.png and /dev/null differ diff --git a/public/render/miku/008.png b/public/render/miku/008.png deleted file mode 100644 index e8ac684..0000000 Binary files a/public/render/miku/008.png and /dev/null differ diff --git a/public/render/miku/009.png b/public/render/miku/009.png deleted file mode 100644 index 088c36c..0000000 Binary files a/public/render/miku/009.png and /dev/null differ diff --git a/public/render/miku/010.png b/public/render/miku/010.png deleted file mode 100644 index 8142885..0000000 Binary files a/public/render/miku/010.png and /dev/null differ diff --git a/public/render/miku/011.png b/public/render/miku/011.png deleted file mode 100644 index ffe20a7..0000000 Binary files a/public/render/miku/011.png and /dev/null differ diff --git a/public/render/miku/012.png b/public/render/miku/012.png deleted file mode 100644 index b18079e..0000000 Binary files a/public/render/miku/012.png and /dev/null differ diff --git a/public/render/miku/013.png b/public/render/miku/013.png deleted file mode 100644 index feae298..0000000 Binary files a/public/render/miku/013.png and /dev/null differ diff --git a/public/render/miku/014.png b/public/render/miku/014.png deleted file mode 100644 index 0f4f4eb..0000000 Binary files a/public/render/miku/014.png and /dev/null differ diff --git a/public/render/miku/015.png b/public/render/miku/015.png deleted file mode 100644 index 8906b3a..0000000 Binary files a/public/render/miku/015.png and /dev/null differ diff --git a/public/render/miku/016.png b/public/render/miku/016.png deleted file mode 100644 index 9e18506..0000000 Binary files a/public/render/miku/016.png and /dev/null differ diff --git a/public/render/miku/017.png b/public/render/miku/017.png deleted file mode 100644 index 713ffca..0000000 Binary files a/public/render/miku/017.png and /dev/null differ diff --git a/public/render/miku/018.png b/public/render/miku/018.png deleted file mode 100644 index c47ace1..0000000 Binary files a/public/render/miku/018.png and /dev/null differ diff --git a/public/render/miku/019.png b/public/render/miku/019.png deleted file mode 100644 index 02372d0..0000000 Binary files a/public/render/miku/019.png and /dev/null differ diff --git a/public/render/miku/020.png b/public/render/miku/020.png deleted file mode 100644 index b991fa5..0000000 Binary files a/public/render/miku/020.png and /dev/null differ diff --git a/public/render/miku/021.png b/public/render/miku/021.png deleted file mode 100644 index ad4e7b4..0000000 Binary files a/public/render/miku/021.png and /dev/null differ diff --git a/public/render/miku/022.png b/public/render/miku/022.png deleted file mode 100644 index af25b28..0000000 Binary files a/public/render/miku/022.png and /dev/null differ diff --git a/public/render/miku/023.png b/public/render/miku/023.png deleted file mode 100644 index 516f247..0000000 Binary files a/public/render/miku/023.png and /dev/null differ diff --git a/public/render/miku/024.png b/public/render/miku/024.png deleted file mode 100644 index 0e41f17..0000000 Binary files a/public/render/miku/024.png and /dev/null differ diff --git a/public/render/miku/025.png b/public/render/miku/025.png deleted file mode 100644 index e90bfb2..0000000 Binary files a/public/render/miku/025.png and /dev/null differ diff --git a/public/render/miku/026.png b/public/render/miku/026.png deleted file mode 100644 index fb8f44e..0000000 Binary files a/public/render/miku/026.png and /dev/null differ diff --git a/public/render/miku/027.png b/public/render/miku/027.png deleted file mode 100644 index 2b03678..0000000 Binary files a/public/render/miku/027.png and /dev/null differ diff --git a/public/render/miku/028.png b/public/render/miku/028.png deleted file mode 100644 index 6404ae2..0000000 Binary files a/public/render/miku/028.png and /dev/null differ diff --git a/public/render/miku/029.png b/public/render/miku/029.png deleted file mode 100644 index 749f7a8..0000000 Binary files a/public/render/miku/029.png and /dev/null differ diff --git a/public/render/miku/030.png b/public/render/miku/030.png deleted file mode 100644 index fc10326..0000000 Binary files a/public/render/miku/030.png and /dev/null differ diff --git a/public/render/miku/031.png b/public/render/miku/031.png deleted file mode 100644 index ed3f62f..0000000 Binary files a/public/render/miku/031.png and /dev/null differ diff --git a/public/render/miku/032.png b/public/render/miku/032.png deleted file mode 100644 index d1a151a..0000000 Binary files a/public/render/miku/032.png and /dev/null differ diff --git a/public/render/miku/033.png b/public/render/miku/033.png deleted file mode 100644 index 0023f2b..0000000 Binary files a/public/render/miku/033.png and /dev/null differ diff --git a/public/render/miku/034.png b/public/render/miku/034.png deleted file mode 100644 index 09f36d1..0000000 Binary files a/public/render/miku/034.png and /dev/null differ diff --git a/public/render/miku/035.png b/public/render/miku/035.png deleted file mode 100644 index c9cca1c..0000000 Binary files a/public/render/miku/035.png and /dev/null differ diff --git a/public/render/miku/036.png b/public/render/miku/036.png deleted file mode 100644 index 6568c42..0000000 Binary files a/public/render/miku/036.png and /dev/null differ diff --git a/public/render/miku/037.png b/public/render/miku/037.png deleted file mode 100644 index 0025bde..0000000 Binary files a/public/render/miku/037.png and /dev/null differ diff --git a/public/render/miku/038.png b/public/render/miku/038.png deleted file mode 100644 index 94e7576..0000000 Binary files a/public/render/miku/038.png and /dev/null differ diff --git a/public/render/miku/039.png b/public/render/miku/039.png deleted file mode 100644 index e99dd16..0000000 Binary files a/public/render/miku/039.png and /dev/null differ diff --git a/public/render/miku/040.png b/public/render/miku/040.png deleted file mode 100644 index 1ebb1ef..0000000 Binary files a/public/render/miku/040.png and /dev/null differ diff --git a/public/render/miku/041.png b/public/render/miku/041.png deleted file mode 100644 index 492387b..0000000 Binary files a/public/render/miku/041.png and /dev/null differ diff --git a/public/render/miku/042.png b/public/render/miku/042.png deleted file mode 100644 index a74768e..0000000 Binary files a/public/render/miku/042.png and /dev/null differ diff --git a/public/render/miku/043.png b/public/render/miku/043.png deleted file mode 100644 index 56a7d70..0000000 Binary files a/public/render/miku/043.png and /dev/null differ diff --git a/public/render/miku/044.png b/public/render/miku/044.png deleted file mode 100644 index 4ff1ef3..0000000 Binary files a/public/render/miku/044.png and /dev/null differ diff --git a/public/render/miku/045.png b/public/render/miku/045.png deleted file mode 100644 index 8902334..0000000 Binary files a/public/render/miku/045.png and /dev/null differ diff --git a/public/render/miku/046.png b/public/render/miku/046.png deleted file mode 100644 index 8ac43ec..0000000 Binary files a/public/render/miku/046.png and /dev/null differ diff --git a/public/render/miku/047.png b/public/render/miku/047.png deleted file mode 100644 index a462a8f..0000000 Binary files a/public/render/miku/047.png and /dev/null differ diff --git a/public/render/miku/048.png b/public/render/miku/048.png deleted file mode 100644 index 098b5d6..0000000 Binary files a/public/render/miku/048.png and /dev/null differ diff --git a/public/render/miku/049.png b/public/render/miku/049.png deleted file mode 100644 index e299415..0000000 Binary files a/public/render/miku/049.png and /dev/null differ diff --git a/public/render/miku/050.png b/public/render/miku/050.png deleted file mode 100644 index 7a846f8..0000000 Binary files a/public/render/miku/050.png and /dev/null differ diff --git a/src/js/misc/render.js b/src/js/misc/render.js index 900d0e7..50245cc 100644 --- a/src/js/misc/render.js +++ b/src/js/misc/render.js @@ -2,56 +2,18 @@ const render = { lsKey: 'render', - type: 'miku', // This is intended to be hard-coded configs: { al: { name: 'ship waifu~', root: 'render/al/', - array: [ - 'admiral_graf_spee_1.png', - 'admiral_hipper_1.png', - 'akagi_1.png', - 'akashi_1.png', - 'akashi_2.png', - 'atago_1.png', - 'atago_3.png', - 'atago_4.png', - 'atago_5.png', - 'belfast_2.png', - 'choukai_1.png', - 'deutschland_1.png', - 'enterprise_1.png', - 'glorious_1.png', - 'hammann_1.png', - 'hammann_2.png', - 'hammann_3.png', - 'hatsuharu_1.png', - 'kaga_1.png', - 'kaga_2.png', - 'kaga_3.png', - 'laffey_1.png', - 'laffey_2.png', - 'laffey_3.png', - 'prinz_eugen_3.png', - 'san_diego_1.png', - 'takao_3.png', - 'unicorn_1.png', - 'unicorn_2.png', - 'unicorn_3.png', - 'unicorn_4.png', - 'unicorn_6.png', - 'unicorn_7.png', - 'unicorn_8.png', - 'yamashiro_1.png', - 'yamashiro_2.png', - 'yamashiro_3.png', - 'yukikaze_1.png' - ] + // 001.png ~ 038.png + array: Array.apply(null, { length: 50 }).map((_, i) => `${('00' + (i + 1)).slice(-3)}.png`) }, miku: { name: 'miku ❤️~', root: 'render/miku/', - array: [] + // 001.png ~ 050.png + array: Array.apply(null, { length: 50 }).map((_, i) => `${('00' + (i + 1)).slice(-3)}.png`) } }, config: null, @@ -59,9 +21,6 @@ const render = { done: false } -// miku: Generate an array of file names from 001.png to 050.png -for (let i = 1; i <= 50; i++) render.configs.miku.array.push(`${('00' + i).slice(-3)}.png`) - render.showTogglePrompt = () => { const renderEnabled = !(localStorage[render.lsKey] === '0') const div = document.createElement('div') @@ -107,6 +66,11 @@ render.showTogglePrompt = () => { }) } +render.parseSelectedConfig = () => { + const renderScript = document.querySelector('#renderScript') + if (renderScript && renderScript.dataset.config) return renderScript.dataset.config +} + render.parseVersion = () => { const renderScript = document.querySelector('#renderScript') if (renderScript && renderScript.dataset.version) return `?v=${renderScript.dataset.version}` @@ -116,7 +80,7 @@ render.parseVersion = () => { render.do = reload => { if (!render.done) render.done = true - render.config = render.configs[render.type] + render.config = render.configs[render.parseSelectedConfig()] if (!render.config || !render.config.array.length) return const previousElement = document.querySelector('body > .render') diff --git a/views/_globals.sample.njk b/views/_globals.sample.njk index 0f680b0..84d766d 100644 --- a/views/_globals.sample.njk +++ b/views/_globals.sample.njk @@ -28,6 +28,11 @@ {# Enabling the option below will hide FAQ categories which are irrelevant for personal installation #} {% set is_for_personal_use = true %} +{# Requires configuring your own renders in public/libs/render. Consult src/js/misc/render.js. #} +{% set enable_home_renders = false %} +{% set enable_home_renders_config = "miku" %} +{% set enable_home_newsfeed = false %} + {# These are the footer links in the homepage and the No-JS uploader (home.njk & nojs.njk respectively). In the homepage uploader, they will be displayed as icons, diff --git a/views/home.njk b/views/home.njk index 9c41198..34b837f 100644 --- a/views/home.njk +++ b/views/home.njk @@ -32,9 +32,13 @@ {%- endif %} +{% if globals.enable_home_renders -%} {# We assign an ID for this so that the script can find out version string for render images #} - + +{%- endif %} +{% if globals.enable_home_newsfeed -%} +{%- endif %} {# We assign an ID for this so that the script can find out its own version #}