feat: removed default home renders
0
public/render/.gitkeep
Normal file
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 169 KiB |
Before Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 175 KiB |
Before Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 145 KiB |
@ -2,56 +2,18 @@
|
|||||||
|
|
||||||
const render = {
|
const render = {
|
||||||
lsKey: 'render',
|
lsKey: 'render',
|
||||||
type: 'miku', // This is intended to be hard-coded
|
|
||||||
configs: {
|
configs: {
|
||||||
al: {
|
al: {
|
||||||
name: 'ship waifu~',
|
name: 'ship waifu~',
|
||||||
root: 'render/al/',
|
root: 'render/al/',
|
||||||
array: [
|
// 001.png ~ 038.png
|
||||||
'admiral_graf_spee_1.png',
|
array: Array.apply(null, { length: 50 }).map((_, i) => `${('00' + (i + 1)).slice(-3)}.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'
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
miku: {
|
miku: {
|
||||||
name: 'miku ❤️~',
|
name: 'miku ❤️~',
|
||||||
root: 'render/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,
|
config: null,
|
||||||
@ -59,9 +21,6 @@ const render = {
|
|||||||
done: false
|
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 = () => {
|
render.showTogglePrompt = () => {
|
||||||
const renderEnabled = !(localStorage[render.lsKey] === '0')
|
const renderEnabled = !(localStorage[render.lsKey] === '0')
|
||||||
const div = document.createElement('div')
|
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 = () => {
|
render.parseVersion = () => {
|
||||||
const renderScript = document.querySelector('#renderScript')
|
const renderScript = document.querySelector('#renderScript')
|
||||||
if (renderScript && renderScript.dataset.version) return `?v=${renderScript.dataset.version}`
|
if (renderScript && renderScript.dataset.version) return `?v=${renderScript.dataset.version}`
|
||||||
@ -116,7 +80,7 @@ render.parseVersion = () => {
|
|||||||
render.do = reload => {
|
render.do = reload => {
|
||||||
if (!render.done) render.done = true
|
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
|
if (!render.config || !render.config.array.length) return
|
||||||
|
|
||||||
const previousElement = document.querySelector('body > .render')
|
const previousElement = document.querySelector('body > .render')
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
{# Enabling the option below will hide FAQ categories which are irrelevant for personal installation #}
|
{# Enabling the option below will hide FAQ categories which are irrelevant for personal installation #}
|
||||||
{% set is_for_personal_use = true %}
|
{% 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).
|
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,
|
In the homepage uploader, they will be displayed as icons,
|
||||||
|
@ -32,9 +32,13 @@
|
|||||||
<script src="libs/cookieconsent/cookieconsent.min.js{{ versions[3] }}"></script>
|
<script src="libs/cookieconsent/cookieconsent.min.js{{ versions[3] }}"></script>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
|
{% if globals.enable_home_renders -%}
|
||||||
{# We assign an ID for this so that the script can find out version string for render images #}
|
{# 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>
|
<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 #}
|
{# 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 id="mainScript" src="js/home.js{{ versions[1] }}"></script>
|
||||||
<script src="js/misc/utils.js{{ versions[1] }}"></script>
|
<script src="js/misc/utils.js{{ versions[1] }}"></script>
|
||||||
|