feat: removed default home renders

This commit is contained in:
Bobby Wibowo 2022-06-22 16:52:14 +07:00
parent 8242119c99
commit 8a9f0b412f
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
92 changed files with 20 additions and 47 deletions

0
public/render/.gitkeep Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

View File

@ -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')

View File

@ -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,

View File

@ -32,9 +32,13 @@
<script src="libs/cookieconsent/cookieconsent.min.js{{ versions[3] }}"></script>
{%- endif %}
<!-- Scripts -->
{% if globals.enable_home_renders -%}
{# We assign an ID for this so that the script can find out version string for render images #}
<script id="renderScript" data-version="{{ versions[4] }}" src="js/misc/render.js{{ versions[1] }}" async></script>
<script id="renderScript" data-config="{{ globals.enable_home_renders_config }}" data-version="{{ versions[4] }}" src="js/misc/render.js{{ versions[1] }}" async></script>
{%- endif %}
{% if globals.enable_home_newsfeed -%}
<script src="js/misc/newsfeed.js{{ versions[1] }}" async></script>
{%- endif %}
{# We assign an ID for this so that the script can find out its own version #}
<script id="mainScript" src="js/home.js{{ versions[1] }}"></script>
<script src="js/misc/utils.js{{ versions[1] }}"></script>