tweak button styles, fix resource gathering
This commit is contained in:
parent
6720aa156a
commit
fe60674d7e
47
template.md
47
template.md
|
@ -1,11 +1,11 @@
|
|||
---
|
||||
# Here should be a mod template generator. Resources for this are in resources/template/.
|
||||
title: Mod Template Generator
|
||||
sidebar: false
|
||||
prev: false
|
||||
next: false
|
||||
editLink: false
|
||||
lastUpdated: false
|
||||
outline: false
|
||||
---
|
||||
|
||||
<!-- This is a mess! Someone improve this please. -->
|
||||
|
@ -13,6 +13,7 @@ lastUpdated: false
|
|||
import JSZip from 'jszip'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { saveAs } from 'file-saver'
|
||||
const assetBaseUrl = "https://git.frogmc.dev/frogmc/frogmc.dev/raw/branch/mistress/resources/"
|
||||
const gameVersion = ref('loading')
|
||||
const showSnapshots = ref()
|
||||
const versionSelector = ref()
|
||||
|
@ -86,47 +87,47 @@ lastUpdated: false
|
|||
let promises = []
|
||||
|
||||
promises.push(
|
||||
readAsset("/resources/template/gradle/libs.versions.toml").then((data) => {
|
||||
readAsset("/template/gradle/libs.versions.toml").then((data) => {
|
||||
gradle.file("libs.versions.toml", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAssetBinary("/resources/template/gradle/wrapper/gradle-wrapper.properties").then((data) => {
|
||||
readAssetBinary("/template/gradle/wrapper/gradle-wrapper.properties").then((data) => {
|
||||
wrapper.file("gradle-wrapper.properties", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAssetBinary("/resources/template/gradle/wrapper/gradle-wrapper.jar").then((data) => {
|
||||
readAssetBinary("/template/gradle/wrapper/gradle-wrapper.jar").then((data) => {
|
||||
wrapper.file("gradle-wrapper.jar", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAsset("/resources/template/.gitignore").then((data) => {
|
||||
readAsset("/template/.gitignore").then((data) => {
|
||||
zip.file(".gitignore", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAsset("/resources/template/build.gradle.kts").then((data) => {
|
||||
readAsset("/template/build.gradle.kts").then((data) => {
|
||||
zip.file("build.gradle.kts", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAssetBinary("/resources/template/gradlew.sh").then((data) => {
|
||||
readAssetBinary("/template/gradlew.sh").then((data) => {
|
||||
zip.file("gradlew", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAssetBinary("/resources/template/gradlew.bat").then((data) => {
|
||||
readAssetBinary("/template/gradlew.bat").then((data) => {
|
||||
zip.file("gradlew.bat", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAsset("/resources/template/build.gradle.kts").then((data) => {
|
||||
readAsset("/template/build.gradle.kts").then((data) => {
|
||||
zip.file("build.gradle.kts", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAsset("/resources/template/settings.gradle.kts").then((data) => {
|
||||
readAsset("/template/settings.gradle.kts").then((data) => {
|
||||
zip.file("settings.gradle.kts", data)
|
||||
})
|
||||
)
|
||||
|
@ -135,12 +136,12 @@ lastUpdated: false
|
|||
let java = main.folder("java")
|
||||
let resources = main.folder("resources")
|
||||
promises.push(
|
||||
readAsset("/resources/template/src/main/resources/frog.mod.toml").then((data) => {
|
||||
readAsset("/template/src/main/resources/frog.mod.toml").then((data) => {
|
||||
resources.file("frog.mod.toml", data)
|
||||
})
|
||||
)
|
||||
promises.push(
|
||||
readAsset("/resources/template/src/main/resources/example_mod.mixins.json").then((data) => {
|
||||
readAsset("/template/src/main/resources/example_mod.mixins.json").then((data) => {
|
||||
resources.file(modIdRef.value+".mixins.json", data)
|
||||
})
|
||||
)
|
||||
|
@ -155,12 +156,12 @@ lastUpdated: false
|
|||
}
|
||||
|
||||
async function readAssetBinary(path) {
|
||||
const response = await fetch(path)
|
||||
const response = await fetch(assetBaseUrl+path)
|
||||
return await response.blob()
|
||||
}
|
||||
|
||||
async function readAsset(path){
|
||||
const response = await fetch(path)
|
||||
const response = await fetch(assetBaseUrl+path)
|
||||
return await response.text().then((data) => {
|
||||
data = data.replace(/\\$mod_id/g, modIdRef.value)
|
||||
data = data.replace(/\\$mod_name/g, modNameRef.value)
|
||||
|
@ -186,14 +187,20 @@ lastUpdated: false
|
|||
input {
|
||||
border: 4px solid var(--vp-c-brand-soft);
|
||||
}
|
||||
button {
|
||||
background-color: var(--vp-button-brand-bg);
|
||||
color: var(--vp-button-brand-text);
|
||||
border-color: var(--vp-button-brand-border);
|
||||
}
|
||||
button:hover {
|
||||
background-color: var(--vp-button-brand-hover-bg);
|
||||
color: var(--vp-button-brand-hover-text);
|
||||
border-color: var(--vp-button-brand-hover-border);
|
||||
}
|
||||
.generate {
|
||||
padding: 4px;
|
||||
border: 4px solid var(--vp-c-brand-soft);
|
||||
//border-color: var(--vp-c-brand-3);
|
||||
border-radius: 18px;
|
||||
}
|
||||
.generate:hover {
|
||||
border-color: var(--vp-c-brand-2);
|
||||
//border: 4px solid var(--vp-c-brand-soft);
|
||||
border-radius: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in a new issue