initial commit - source

This commit is contained in:
Hartmut Bauer committed 2026-02-03 22:36:35 +01:00
1 parent 003b5501f0
commit e89bb29070
45 files changed
+5997

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeCompiler) // sonst fkt. Composable-Import nicht
alias(libs.plugins.koin.compiler)
}
kotlin {
jvm()
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
// nodejs()
browser()
}
macosArm64()
// In einem Compose-Projekt gibt das Ärger, weil Compose nicht mit
// linux + mingw kompatibel ist. Sonst müsste alle UI über die
// restlichen Plattformen verstreut werden.
// linuxX64()
// mingwX64()
sourceSets {
commonMain.dependencies {
implementation(libs.bundles.kotlin.compose)
}
jvmMain.dependencies {
}
wasmJsMain.dependencies {
}
macosArm64Main.dependencies {
}
}
jvmToolchain(masterLibs.versions.javaVersion.get().toInt())
}
@@ -0,0 +1,3 @@
package net.keinekekse.app
const val SERVER_PORT = 7770
@@ -0,0 +1,9 @@
package net.keinekekse.app
class Greeting {
private val platform = getPlatform()
fun greet(): String {
return "Hello, ${platform.name}!"
}
}
@@ -0,0 +1,7 @@
package net.keinekekse.app
interface Platform {
val name: String
}
expect fun getPlatform(): Platform
@@ -0,0 +1,31 @@
package net.keinekekse.app.ui
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.unit.dp
@Composable
fun ProgressIndicator(animationSize: Int = 48, paddingTop: Int = 16, strokeWidth: Int = 5) {
val primaryColor = MaterialTheme.colorScheme.primary
val backgroundColor = MaterialTheme.colorScheme.background
val strokewidth = strokeWidth.dp
CircularProgressIndicator(
modifier =
Modifier.padding(top = paddingTop.dp).size(animationSize.dp).drawBehind {
drawCircle(
primaryColor,
radius = size.width / 2 - strokewidth.toPx() / 2,
style = Stroke(strokewidth.toPx()),
)
},
color = backgroundColor,
strokeWidth = strokewidth
)
}
@@ -0,0 +1,7 @@
package net.keinekekse.app
class JVMPlatform : Platform {
override val name: String = "Java ${System.getProperty("java.version")}"
}
actual fun getPlatform(): Platform = JVMPlatform()
@@ -0,0 +1,7 @@
package net.keinekekse.app
class MacOsPlatform : Platform {
override val name: String = "macOS"
}
actual fun getPlatform(): Platform = MacOsPlatform()
@@ -0,0 +1,7 @@
package net.keinekekse.app
class WasmPlatform : Platform {
override val name: String = "Web with Kotlin/Wasm"
}
actual fun getPlatform(): Platform = WasmPlatform()