Skip to content

Commit

Permalink
feat: hamster js๐Ÿน ํŽซ์„ ์ถ”๊ฐ€ํ•œ๋‹ค
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Nov 16, 2024
1 parent 4b28e2c commit 48ae787
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 0 deletions.
1 change: 1 addition & 0 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ _New contributions may take up to 1 hour to be reflected._

| name | ratio | Description |
|---------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| HAMSTER_JS <br> <img src = "docs/hamster-js.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_KOTLIN <br> <img src = "docs/hamster-kotlin.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_JAVA <br> <img src = "docs/hamster-java.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_SPRING <br> <img src = "docs/hamster-spring.svg" width="100px" height="50px"/> | 0.01 | |
Expand Down
1 change: 1 addition & 0 deletions README-zhcn.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ _ๆ–ฐ็š„่ดก็Œฎๅฏ่ƒฝ้œ€่ฆ1ไธชๅฐๆ—ถๆ‰่ƒฝๆ˜พ็คบ_

| ๅๅญ— | ๆฆ‚็Ž‡ | ๆ่ฟฐ |
|---------------------------------------------------------------------------------------------------------|-------|--------------------------------------------------------------------------------------------------------------------|
| HAMSTER_JS <br> <img src = "docs/hamster-js.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_KOTLIN <br> <img src = "docs/hamster-kotlin.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_JAVA <br> <img src = "docs/hamster-java.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_SPRING <br> <img src = "docs/hamster-spring.svg" width="100px" height="50px"/> | 0.01 | |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ _์ƒˆ๋กœ์šด contribution ๋ฐ˜์˜์€ ์ตœ๋Œ€ 1์‹œ๊ฐ„์ด ์†Œ์š”๋  ์ˆ˜ ์žˆ์–ด์š”._

| name | ratio | Description |
|----------------------------------------------------------------------------------------------------------|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| HAMSTER_JS <br> <img src = "docs/hamster-js.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_KOTLIN <br> <img src = "docs/hamster-kotlin.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_JAVA <br> <img src = "docs/hamster-java.svg" width="100px" height="50px"/> | 0.01 | |
| HAMSTER_SPRING <br> <img src = "docs/hamster-spring.svg" width="100px" height="50px"/> | 0.01 | |
Expand Down
120 changes: 120 additions & 0 deletions docs/hamster-js.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,21 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null)
StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0)
.toString()
},
HAMSTER_JS(0.01) {
override fun loadSvg(user: User, persona: Persona, mode: Mode): String {
return hamsterJsSvg.replace("*{act}", act(persona.id))
.replace("*{id}", persona.id.toString())
.replace("*{level}", persona.level.value.toSvg(14.0, 2.0))
.replace(
"*{levelx}",
(-5 + (-1 * (persona.level.value.toString().length))).toString()
)
}

override fun act(id: Long): String =
StringBuilder().moveRandomly("hamster", id, 5, "1000s", 5, 21.0)
.toString()
},
;

init {
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/org/gitanimals/render/domain/Svgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ val hamsterJavaSvg: String = ClassPathResource("persona/animal/hamster-java.svg"
val hamsterKotlinSvg: String = ClassPathResource("persona/animal/hamster-kotlin.svg")
.getContentAsString(Charset.defaultCharset())

val hamsterJsSvg: String = ClassPathResource("persona/animal/hamster-js.svg")
.getContentAsString(Charset.defaultCharset())

val largeTextSvgs = lazy {
val map = mutableMapOf<String, String>()
for (i in 'A'..'Z') {
Expand Down
Loading

0 comments on commit 48ae787

Please sign in to comment.