Skip to content

Commit 26528a1

Browse files
committed
chore : improve output html template readability
1 parent 889dfd1 commit 26528a1

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
build/
44
out/
55
tmp/
6+
/mcscankt-results

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010

1111
allprojects {
1212
group = "fr.fabienhebuterne"
13-
version = "1.0.0"
13+
version = "1.0.1"
1414

1515
repositories {
1616
mavenCentral()

domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/Item.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ abstract class ItemBase {
7676
return getColoredText(it, div)
7777
} ?: run {
7878
if (firstColor != null) {
79-
getColoredText(firstColor, div)
79+
return getColoredText(firstColor, div)
8080
}
8181

8282
return div.span {

domain/src/main/kotlin/fr/fabienhebuterne/mcscan/domain/output/OutputHtmlService.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ class OutputHtmlService(private val countItemService: CountItemService) : Output
1212
override fun showResults() {
1313
logger.info { "start parsing item into html" }
1414

15-
val inputStream: InputStream = javaClass.classLoader?.getResource("template.html")?.openStream()
15+
File("./mcscankt-results").mkdir()
16+
17+
val htmlDefaultTemplate: InputStream = javaClass.classLoader?.getResource("template.html")?.openStream()
1618
?: throw IllegalAccessException("template html not found")
17-
val template = File("./template.html")
18-
template.writeBytes(inputStream.readAllBytes())
19+
val template = File("./mcscankt-results/template.html")
20+
template.writeBytes(htmlDefaultTemplate.readAllBytes())
21+
22+
val fontDefaultTemplate: InputStream = javaClass.classLoader?.getResource("minecraftia-regular.ttf")?.openStream()
23+
?: throw IllegalAccessException("custom font not found")
24+
val fontTemplate = File("./mcscankt-results/minecraftia-regular.ttf")
25+
fontTemplate.writeBytes(fontDefaultTemplate.readAllBytes())
1926

2027
// TODO : Split into pages when have too many item in one page
2128
countItemService.getCounter()

domain/src/main/resources/template.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
justify-content: flex-start;
1212
align-content: center;
1313
align-items: flex-start;
14+
background: linear-gradient(to left, #636FA4, #E8CBC0);
1415
}
1516

1617
.item {
@@ -43,6 +44,7 @@
4344
.item-count-center {
4445
align-self: center;
4546
text-align: center;
47+
color: white;
4648
}
4749

4850
.id {

0 commit comments

Comments
 (0)