diff --git a/site/.vuepress/components/CodeInfo.vue b/site/.vuepress/components/CodeInfo.vue index 9a031eb..ab51b7b 100644 --- a/site/.vuepress/components/CodeInfo.vue +++ b/site/.vuepress/components/CodeInfo.vue @@ -11,7 +11,8 @@ {{ getLabel('codeinfo.author') }} {{ translatedCode.author }}

- + @@ -24,6 +25,7 @@ export default { anchor: { type: Boolean }, code: { type: Object }, version: { type: String }, + codeConfigs: { type: Object }, }, computed: { translatedCode: function () { diff --git a/site/.vuepress/components/Generator.vue b/site/.vuepress/components/Generator.vue index 9e6487c..af283c6 100644 --- a/site/.vuepress/components/Generator.vue +++ b/site/.vuepress/components/Generator.vue @@ -42,7 +42,8 @@

{{ getLabel('headers.help') }}

- +

{{ getLabel('headers.stageloader') }}

@@ -109,6 +110,9 @@ import gameVersions from '../data/gameVersions.json'; // Util import { translate } from '../i18n/localeHelper'; +// Code Configs +import {getConfig as qftGetConfig} from './codes/qft/codegen'; + export default { data() { return { @@ -122,6 +126,12 @@ export default { stageLoaderCodes: [], showStageLoaderHelp: false, generation: 0, + codeConfigs: {}, + }; + }, + created() { + this.codeConfigs = { + qft: qftGetConfig(), }; }, methods: { @@ -192,6 +202,10 @@ export default { this.showStageLoaderHelp = false; this.inspectingCode = code; }, + + onCodeConfigChanged(e) { + this.codeConfigs = {...this.codeConfigs, ...e}; + }, }, }; diff --git a/site/.vuepress/components/Preview.vue b/site/.vuepress/components/Preview.vue new file mode 100644 index 0000000..1f90874 --- /dev/null +++ b/site/.vuepress/components/Preview.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/site/.vuepress/components/PreviewString.vue b/site/.vuepress/components/PreviewString.vue new file mode 100644 index 0000000..ba07369 --- /dev/null +++ b/site/.vuepress/components/PreviewString.vue @@ -0,0 +1,97 @@ + + + + + diff --git a/site/.vuepress/components/codes/qft/codegen.js b/site/.vuepress/components/codes/qft/codegen.js index 62c35d6..fd8e01d 100644 --- a/site/.vuepress/components/codes/qft/codegen.js +++ b/site/.vuepress/components/codes/qft/codegen.js @@ -26,7 +26,8 @@ export const defaultConfig = { }; export function getConfig() { - const config = parseJSON(localStorage.getItem(lskey)) ?? {}; + const config = + (typeof localStorage !== 'undefined' && parseJSON(localStorage.getItem(lskey))) || {}; return { ...defaultConfig, ...config, diff --git a/site/.vuepress/components/codes/qft/config.vue b/site/.vuepress/components/codes/qft/config.vue index 5d0549f..88577a0 100644 --- a/site/.vuepress/components/codes/qft/config.vue +++ b/site/.vuepress/components/codes/qft/config.vue @@ -22,21 +22,7 @@ {{l.alpha}}/255={{(bgA/2.55).toFixed(1)}}%

{{l.preview}}

- - - - - - - - - - 0:00.000 - +
{{l.previewNote}}
@@ -58,23 +44,25 @@