Skip to content

Commit

Permalink
added ascii art
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoMarlir committed May 24, 2024
1 parent b61004c commit 21cabd1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
7 changes: 7 additions & 0 deletions node/src/main/kotlin/me/blueamethyst/bluecloud/node/Node.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package me.blueamethyst.bluecloud.node

import com.github.ajalt.colormath.model.Oklab
import com.github.ajalt.colormath.model.SRGB
import com.github.ajalt.colormath.transform.interpolator
import com.github.ajalt.colormath.transform.sequence
import com.github.ajalt.mordant.rendering.TextColors
import me.blueamethyst.bluecloud.api.annontations.InternalBlueCloudApi
import me.blueamethyst.bluecloud.common.internal.AbstractSystemPart
import me.blueamethyst.bluecloud.common.internal.types.InternalSystemPartType
Expand All @@ -14,6 +19,7 @@ import me.blueamethyst.bluecloud.node.models.ClusterConfigModel
import me.blueamethyst.bluecloud.node.models.NodeConfigModel
import me.blueamethyst.bluecloud.node.models.SecretsModel
import me.blueamethyst.bluecloud.node.server.KtorApplication
import me.blueamethyst.bluecloud.node.utils.asciiArt
import me.blueamethyst.bluecloud.node.utils.generateRandomSecret
import me.blueamethyst.bluecloud.node.utils.json
import me.blueamethyst.bluecloud.wrapper.Wrapper
Expand Down Expand Up @@ -44,6 +50,7 @@ class Node: AbstractSystemPart(InternalSystemPartType.NODE) {
}

private fun initialize() {
println(asciiArt())
provideInjector()
setupFileStructure()
provideConfigFile()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package me.blueamethyst.bluecloud.node.utils

import com.github.ajalt.colormath.model.Oklab
import com.github.ajalt.colormath.model.SRGB
import com.github.ajalt.colormath.transform.interpolator
import com.github.ajalt.colormath.transform.sequence
import com.github.ajalt.mordant.rendering.TextColors

fun asciiArt(): String {
val title = """
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@%@@@@@@@@@@@*=%@@@@@@@@@@@%@@@@@@@@@@@
@@@@@%=#@@@@#=*@@@@@%###-.-+#%##%@@@@@*+#%@@%+#@@@@
@@@@%#=+#%@@%%%@%*-=*#%*:-*#+%%#*==*%@@#@@@%*=*%@@@
@@@@@@#%@@%%%%+:++#++*%@%==*@@%++*%=+-#%@@@@@%@@@@@
@@@@@@@@%%@%+--+#@%@#=#@@@@@@%@@@%%@#===*%%#@#%@@@@
@@@@@@#%@%+-#*+@%-#@%*%@@@@@@@@#@@##@#+#*=#%@%@@@@@
@@@@@@@@%=+#-%@+-:+*@%=::::#@@@@%*-=*%@#=#=*%%@@@@@
@@@@@##%+-+#@++@%*#@-....:--*%@@@@@@@%@@@*+=#%*@@@@
@@@@@@%-=#+@@%#%%%%%..::=+++**:..:=#%@@@%%+%+#%@@@@
@@@@@@+-%+%@@%=....:===+++++++:.:=+###@@@@#+%+%#*@@
@@@%%%+#=%@@%:..:-=+*++++-+++=-++++++*#@@@@#=*%%%@@
@@@%%#=%#%=--..-+++*#*+=..+##+++=:.=++*###%@#+*%%@@
@@@@#-=@#:..:--++++++=:...+###*++-+*+==++*##%@+*%@@
@@@@%++@+..-++++:.=++=:...+####*+==+=:.=+*##%@*#%@@
@@@@%#+@*::+++++==*++=--::+#*##*=-=++++++*#*#@#%%@@
@@@@%%+*@#=+#*********+-::+#*###*******##**%@*%%@@@
@@@@@%#-##@%%%%@@@@@@%*=::+#*#%@@@@%%%%%%%@##*%##@@
@@@@@%%*+%=%%+#%#@@@@@#+::+#*%@@@@#@@@#=@%#@#%%#@@@
@@@@@@%%*=#%%#%@*-#@@%@@-:+#*@%@@#-+%@%#@%%*%%%@@@@
@@@@@@#%%#=#**%@*=#@@%@@%=+*%@%%@#-+%@%###*%%%%@@@@
@@@%+@@@%%%==#-#@@@@:-*@@@@@@#:-#@@@@**%*#%%@@@@@@@
@@@@@@#%@%%%%=-#%#+*@%@@@@@%@@@%%*+%@#*#%%@%@#%@@@@
@@@@#+-=#%%%%%%#+=*%#**@%-=#@%#*#%*+*#%%%@@%*-+#%@@
@@@@@@*%@@@@*=*%%%%**++=:.=+##***#%%%@%#+%@@@*%@@@@
@@@@@@@@@@@@%#%@@@@@%%@@#-++%@%%%@@@@@@@#@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@%%@@@@@@@@@@@@@@@@@@@@@@@@
""".trim('\n')
return buildString {
for (line in title.lineSequence()) {
val lerp = Oklab.interpolator {
stop(SRGB("#e74856"))
stop(SRGB("#9648e7"))
}.sequence(line.length)
line.asSequence().zip(lerp).forEach { (c, color) ->
append(TextColors.color(color)(c.toString()))
}
append("\n")
}
}
}

0 comments on commit 21cabd1

Please sign in to comment.