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 b1a224d
Show file tree
Hide file tree
Showing 12 changed files with 100 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

14 changes: 13 additions & 1 deletion common/src/commonMain/kotlin/ru/posidata/common/Resources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum class Resources(
FEEBAS(22, "A Water-type Pokémon that is often seen as unattractive, but evolves into the beautiful Milotic.", POKEMON),

// BigData
// phase 1
HADOOP(23, "Framework that allows for the distributed processing of large data sets across clusters using programming models.", BIG_DATA),
FLINK(24, "A stream processing framework that processes data in real time and is known for its low-latency performance.", BIG_DATA),
HIVE(25, "A data warehouse infrastructure built on top of Hadoop, enabling users to perform queries on large datasets.", BIG_DATA),
Expand All @@ -60,7 +61,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),
// phase 2
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 {

}
}
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b1a224d

Please sign in to comment.