diff --git a/.gitignore b/.gitignore index 4be7a50..69880d3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build/ out/ tmp/ +/mcscankt-results diff --git a/build.gradle.kts b/build.gradle.kts index 41eb390..b7d2113 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { allprojects { group = "fr.fabienhebuterne" - version = "1.0.0" + version = "1.0.1" repositories { mavenCentral() diff --git a/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/Item.kt b/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/Item.kt index 4cdd34f..3e0563f 100644 --- a/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/Item.kt +++ b/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/Item.kt @@ -76,7 +76,7 @@ abstract class ItemBase { return getColoredText(it, div) } ?: run { if (firstColor != null) { - getColoredText(firstColor, div) + return getColoredText(firstColor, div) } return div.span { diff --git a/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/output/OutputHtmlService.kt b/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/output/OutputHtmlService.kt index 855bd2e..307b058 100644 --- a/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/output/OutputHtmlService.kt +++ b/domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/output/OutputHtmlService.kt @@ -12,10 +12,17 @@ class OutputHtmlService(private val countItemService: CountItemService) : Output override fun showResults() { logger.info { "start parsing item into html" } - val inputStream: InputStream = javaClass.classLoader?.getResource("template.html")?.openStream() + File("./mcscankt-results").mkdir() + + val htmlDefaultTemplate: InputStream = javaClass.classLoader?.getResource("template.html")?.openStream() ?: throw IllegalAccessException("template html not found") - val template = File("./template.html") - template.writeBytes(inputStream.readAllBytes()) + val template = File("./mcscankt-results/template.html") + template.writeBytes(htmlDefaultTemplate.readAllBytes()) + + val fontDefaultTemplate: InputStream = javaClass.classLoader?.getResource("minecraftia-regular.ttf")?.openStream() + ?: throw IllegalAccessException("custom font not found") + val fontTemplate = File("./mcscankt-results/minecraftia-regular.ttf") + fontTemplate.writeBytes(fontDefaultTemplate.readAllBytes()) // TODO : Split into pages when have too many item in one page countItemService.getCounter() diff --git a/domain/src/main/resources/template.html b/domain/src/main/resources/template.html index 6f6adfd..41f1eb2 100644 --- a/domain/src/main/resources/template.html +++ b/domain/src/main/resources/template.html @@ -11,6 +11,7 @@ justify-content: flex-start; align-content: center; align-items: flex-start; + background: linear-gradient(to left, #636FA4, #E8CBC0); } .item { @@ -43,6 +44,7 @@ .item-count-center { align-self: center; text-align: center; + color: white; } .id {