Updated random render script.

Added a new render category (miku). Choice is currently hard-coded.

Added 50 renders for miku category.

Bumped v1 & v4 version strings.
This commit is contained in:
Bobby Wibowo 2019-08-18 21:52:19 +07:00
parent 63e26462ea
commit 72f58e6eec
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
52 changed files with 68 additions and 50 deletions

View File

@ -1,46 +1,63 @@
/* global page, swal */
page.renderRoot = 'render/al/'
page.renderArray = [
'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'
]
page.renderType = 'miku'
page.renderConfig = {
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'
]
},
miku: {
name: 'miku ❤️~',
root: 'render/miku/',
array: []
}
}
// miku: Generate an array of file names from 001.png to 050.png
for (let i = 1; i <= 50; i++)
page.renderConfig.miku.array.push(`${('00' + i).slice(-3)}.png`)
page.config = null
page.render = null
page.doRenderSwal = function () {
@ -50,7 +67,7 @@ page.doRenderSwal = function () {
<div class="control">
<label class="checkbox">
<input id="swalRender" type="checkbox" ${localStorage.render === '0' ? '' : 'checked'}>
Enable random render of ship waifu~
Enable random render of ${page.config.name}
</label>
</div>
<p class="help">If disabled, you will still be able to see a small button on the bottom right corner of the screen to re-enable it.</p>
@ -67,7 +84,7 @@ page.doRenderSwal = function () {
const newValue = div.querySelector('#swalRender').checked ? undefined : '0'
if (newValue !== localStorage.render) {
newValue ? localStorage.render = newValue : localStorage.removeItem('render')
swal('Success!', `Render is now ${newValue ? 'disabled' : 'enabled'}.`, 'success')
swal('Success!', `Random render is now ${newValue ? 'disabled' : 'enabled'}.`, 'success')
const element = document.querySelector('body > .render')
element.remove()
page.doRender()
@ -83,21 +100,22 @@ page.getRenderVersion = function () {
}
page.doRender = function () {
if (!page.renderRoot || !page.renderArray || !page.renderArray.length) return
page.config = page.renderConfig[page.renderType]
if (!page.config || !page.config.array.length) return
let element
if (localStorage.render === '0') {
element = document.createElement('a')
element.className = 'button is-breeze is-hidden-mobile'
element.title = 'ship waifu~'
element.title = page.config.name
element.innerHTML = '<i class="icon-picture-1"></i>'
} else {
// Let us just allow people to get new render when toggling the option
page.render = page.renderArray[Math.floor(Math.random() * page.renderArray.length)]
page.render = page.config.array[Math.floor(Math.random() * page.config.array.length)]
element = document.createElement('img')
element.alt = element.title = 'ship waifu~'
element.alt = element.title = page.config.name
element.className = 'is-hidden-mobile'
element.src = `${page.renderRoot}${page.render}${page.getRenderVersion()}`
element.src = `${page.config.root}${page.render}${page.getRenderVersion()}`
}
element.classList.add('render')

BIN
public/render/miku/001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
public/render/miku/002.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
public/render/miku/003.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
public/render/miku/004.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
public/render/miku/005.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
public/render/miku/006.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
public/render/miku/007.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
public/render/miku/008.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
public/render/miku/009.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
public/render/miku/010.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
public/render/miku/011.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
public/render/miku/012.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
public/render/miku/013.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
public/render/miku/014.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
public/render/miku/015.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

BIN
public/render/miku/016.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

BIN
public/render/miku/017.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
public/render/miku/018.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
public/render/miku/019.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
public/render/miku/020.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
public/render/miku/021.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
public/render/miku/022.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

BIN
public/render/miku/023.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
public/render/miku/024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
public/render/miku/025.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
public/render/miku/026.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
public/render/miku/027.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
public/render/miku/028.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

BIN
public/render/miku/029.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
public/render/miku/030.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
public/render/miku/031.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
public/render/miku/032.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
public/render/miku/033.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
public/render/miku/034.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
public/render/miku/035.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

BIN
public/render/miku/036.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
public/render/miku/037.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
public/render/miku/038.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
public/render/miku/039.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
public/render/miku/040.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
public/render/miku/041.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

BIN
public/render/miku/042.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
public/render/miku/043.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

BIN
public/render/miku/044.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
public/render/miku/045.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
public/render/miku/046.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
public/render/miku/047.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
public/render/miku/048.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

BIN
public/render/miku/049.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
public/render/miku/050.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -16,10 +16,10 @@
v3: CSS and JS files (libs such as bulma, lazyload, etc).
v4: Renders in /public/render/* directories (to be used by render.js).
#}
{% set v1 = "eM2nmzS5jf" %}
{% set v1 = "S3TAWpPeFS" %}
{% set v2 = "hiboQUzAzp" %}
{% set v3 = "RpD2narcvz" %}
{% set v4 = "43gxmxi7v8" %}
{% set v4 = "S3TAWpPeFS" %}
{#
These will be the links in the homepage and the No-JS uploader.