Skip to content

Commit

Permalink
Removing randomize machine
Browse files Browse the repository at this point in the history
  • Loading branch information
orchestr7 committed Sep 12, 2024
1 parent fc557b0 commit 4ef8b6f
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 108 deletions.
5 changes: 4 additions & 1 deletion backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ spring:
servlet:
SecurityAutoConfiguration


server:
port : 8081

telegram:
bot:
token:
12345:mybottesttoken

13 changes: 12 additions & 1 deletion common/src/commonMain/kotlin/ru/posidata/common/Resources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,18 @@ enum class Resources(
ARVADOS(41, "An open-source platform for managing and analyzing large-scale genomic and biomedical data.", BIG_DATA),
GEODE(42, "An open-source, distributed data management platform designed for high performance real-time data access and analytics.", BIG_DATA),
ADABAS(43, "A high-performance, transactional database management system designed to handle large volumes of data.", BIG_DATA),
ICEBERG(44, "An open table format for large analytic datasets that enables high-performance reads/writes and supports schema evolution.", BIG_DATA) ;
ICEBERG(44, "An open table format for large analytic datasets that enables high-performance reads/writes and supports schema evolution.", BIG_DATA),

KUDU(45, "A distributed, columnar storage engine optimized for fast analytics on large datasets, designed for integration with Hadoop.", BIG_DATA),
DRUID(46, "A real-time analytics database designed for fast slice-and-dice queries on large, high-dimensional data.", BIG_DATA),
LUIGI(47, "A Python-based workflow management system used to build complex pipelines of batch jobs.", BIG_DATA),
MILVUS(48, "An open-source vector database designed to manage, search, and index massive embedding vectors.", BIG_DATA),
WEAVIATE(49, "An open-source vector search engine and graph database designed for machine learning and semantic search.", BIG_DATA),
PAIMON(50, "A high-performance streaming table store for large-scale real-time data processing.", BIG_DATA),
DORIS(51, "An MPP-based interactive SQL data warehouse that provides sub-second query responses on large datasets.", BIG_DATA),
LANCE(52, "A data format and query engine designed for fast machine learning and analytics workflows with efficient version control.", BIG_DATA),
NIMBLE(53, "A lightweight, flexible, and scalable in-memory computing platform designed for real-time analytics.", BIG_DATA);
;

companion object {
fun getById(i: Int): Resources = Resources.entries.find { it.id == i }!!
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/jsMain/kotlin/ru/posidata/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ val App: FC<Props> = FC {
path = "/"
element = mainView.create()
errorElement = errorBoundary.create()
},
jso {
path = "/luckydraw"
element = luckyDrawCard.create()
errorElement = errorBoundary.create()
}
)
)
Expand Down
184 changes: 83 additions & 101 deletions frontend/src/jsMain/kotlin/ru/posidata/views/main/MainView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package ru.posidata.views.main
import js.objects.jso
import react.*
import react.dom.html.ReactHTML
import react.dom.html.ReactHTML.button
import react.dom.html.ReactHTML.div
import ru.posidata.common.Answer.NONE
import ru.posidata.common.Selection
Expand All @@ -16,8 +15,6 @@ import ru.posidata.common.UserForSerializationDTO
import web.cssom.*

val mainView = FC {
val (luckyDraw, setLuckyDraw) = useState(false)

Particles::class.react {
id = "tsparticles"
url = "${kotlinx.browser.window.location.origin}/particles.json"
Expand All @@ -31,137 +28,122 @@ val mainView = FC {
val (user, setUser) = useState<UserForSerializationDTO?>(null)
val (tgUser, setTgUser) = useState<UserDataFromTelegram?>(null)

if (!luckyDraw) {
div {
className = ClassName("full-width-container")
div {
className = ClassName("full-width-container")
className = ClassName("row justify-content-center align-items-center")
style = jso {
minHeight = "100vh".unsafeCast<MinHeight>()
}

div {
className = ClassName("row justify-content-center align-items-center")
id = "back"
className = ClassName("card col-xl-4 col-lg-5 col-md-7 col-sm-8 col-12")
style = jso {
minHeight = "100vh".unsafeCast<MinHeight>()
minHeight = "80vh".unsafeCast<MinHeight>()
borderRadius = "40px 40px 40px 40px".unsafeCast<BorderRadius>()
boxShadow = "10px 10px 20px rgba(0, 0, 0, 0.5)".unsafeCast<BoxShadow>()
}

headerRow {}

div {
id = "back"
className = ClassName("card col-xl-4 col-lg-5 col-md-7 col-sm-8 col-12")
className = ClassName("row justify-content-center text-white mt-3 ")
style = jso {
minHeight = "80vh".unsafeCast<MinHeight>()
borderRadius = "40px 40px 40px 40px".unsafeCast<BorderRadius>()
boxShadow = "10px 10px 20px rgba(0, 0, 0, 0.5)".unsafeCast<BoxShadow>()
zIndex = "1000".unsafeCast<ZIndex>()
minHeight = "53vh".unsafeCast<MinHeight>()
display = Display.flex
}
if (user != null && user.gameNumber() == 4) {
ReactHTML.h6 {
className = ClassName("mb-2 text-white mx-2")
+"Ты отыграл уже три раза, в рейтинге участвовать больше не получится, обнови страницу если хочешь просто пройти тест. Твои результаты:"

headerRow {}

div {
className = ClassName("row justify-content-center text-white mt-3 ")
style = jso {
zIndex = "1000".unsafeCast<ZIndex>()
minHeight = "53vh".unsafeCast<MinHeight>()
display = Display.flex
}
if (user != null && user.gameNumber() == 4) {
ReactHTML.h6 {
className = ClassName("mb-2 text-white mx-2")
+"Ты отыграл уже три раза, в рейтинге участвовать больше не получится, обнови страницу если хочешь просто пройти тест. Твои результаты:"

ReactHTML.h6 {
className = ClassName("mb-2 text-center")
style = jso {
color = "yellow".unsafeCast<Color>()
}
ReactHTML.h6 {
className = ClassName("mb-2 text-center")
style = jso {
color = "yellow".unsafeCast<Color>()
}
+"${user.firstGameScore}/12"
+"${user.firstGameScore}/12"
}
ReactHTML.h6 {
className = ClassName("mb-2 text-center")
style = jso {
color = "yellow".unsafeCast<Color>()
}
ReactHTML.h6 {
className = ClassName("mb-2 text-center")
style = jso {
color = "yellow".unsafeCast<Color>()
}
+"${user.firstGameScore}/12"
+"${user.firstGameScore}/12"
}
ReactHTML.h6 {
className = ClassName("mb-2 text-center")
style = jso {
color = "yellow".unsafeCast<Color>()
}
ReactHTML.h6 {
className = ClassName("mb-2 text-center")
style = jso {
color = "yellow".unsafeCast<Color>()
+"${user.thirdGameScore}/12"
}
} else {
when (selection) {
Selection.NONE -> {
welcomeCard {
this.setSelection = setSelection
this.setUser = setUser
this.tgUser = tgUser
this.setTgUser = setTgUser
}
+"${user.thirdGameScore}/12"
}
} else {
when (selection) {
Selection.NONE -> {
welcomeCard {
this.setSelection = setSelection
this.setUser = setUser
this.tgUser = tgUser
this.setTgUser = setTgUser
}

QUESTION -> questionCard {
this.counter = counter
this.setCounter = setCounter
this.answers = answers
this.setAnswers = setAnswers
this.setPokemonId = setPokemonId
this.pokemonId = pokemonId
this.setSelection = setSelection
this.uniqueRandom = uniqueRandom
this.setUniqueRandom = setUniqueRandom

this.user = user
this.tgUser = tgUser
this.setUser = setUser
}

ANSWER -> {
answerCard {
this.setSelection = setSelection
this.counter = counter
this.pokemonId = pokemonId
this.answers = answers
}
}

QUESTION -> questionCard {
RESULTS -> {
resultCard {
this.counter = counter
this.setCounter = setCounter
this.answers = answers
this.setAnswers = setAnswers
this.setPokemonId = setPokemonId
this.pokemonId = pokemonId
this.setSelection = setSelection
this.uniqueRandom = uniqueRandom
this.setCounter = setCounter
this.setAnswers = setAnswers
this.setUniqueRandom = setUniqueRandom
this.setSelection = setSelection

this.user = user
this.tgUser = tgUser
this.setUser = setUser
}

ANSWER -> {
answerCard {
this.setSelection = setSelection
this.counter = counter
this.pokemonId = pokemonId
this.answers = answers
}
}

RESULTS -> {
resultCard {
this.counter = counter
this.answers = answers
this.setSelection = setSelection
this.setCounter = setCounter
this.setAnswers = setAnswers
this.setUniqueRandom = setUniqueRandom
this.setSelection = setSelection

this.user = user
this.tgUser = tgUser
this.setUser = setUser
}
}
}
}
}
}

if (selection != Selection.NONE) {
progressBar {
this.counter = counter
this.selection = selection
this.answers = answers
}
}

button {
className = ClassName("btn btn-outline-info btn-lg")
onClick = {
setLuckyDraw(true)
}
+"Розыгрыш"
if (selection != Selection.NONE) {
progressBar {
this.counter = counter
this.selection = selection
this.answers = answers
}
}
}
}
} else {
luckyDrawCard {

}
}
}

0 comments on commit 4ef8b6f

Please sign in to comment.