Initial commit

This commit is contained in:
Anand Bose 2024-12-30 21:59:10 +05:30
commit 626eccb038
Signed by: anandbose
GPG key ID: 69698042BA46B2B5
24 changed files with 3843 additions and 0 deletions

48
.github/workflows/compose-web.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: Compose Web CI
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
name: Setup Java 21
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew :composeApp:wasmJsBrowserDistribution
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./composeApp/build/dist/wasmJs/productionExecutable
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

18
.gitignore vendored Normal file
View file

@ -0,0 +1,18 @@
*.iml
.kotlin
.gradle
**/build/
xcuserdata
!src/**/build/
local.properties
.idea
.DS_Store
captures
.externalNativeBuild
.cxx
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings

18
README.md Normal file
View file

@ -0,0 +1,18 @@
This is a Kotlin Multiplatform project targeting Web.
* `/composeApp` is for code that will be shared across your Compose Multiplatform applications.
It contains several subfolders:
- `commonMain` is for code thats common for all targets.
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name.
For example, if you want to use Apples CoreCrypto for the iOS part of your Kotlin app,
`iosMain` would be the right folder for such calls.
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html),
[Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform/#compose-multiplatform),
[Kotlin/Wasm](https://kotl.in/wasm/)…
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel [#compose-web](https://slack-chats.kotlinlang.org/c/compose-web).
If you face any issues, please report them on [GitHub](https://github.com/JetBrains/compose-multiplatform/issues).
You can open the web application by running the `:composeApp:wasmJsBrowserDevelopmentRun` Gradle task.

7
build.gradle.kts Normal file
View file

@ -0,0 +1,7 @@
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.composeMultiplatform) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
}

View file

@ -0,0 +1,50 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.composeCompiler)
}
kotlin {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
val rootDirPath = project.rootDir.path
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(rootDirPath)
add(projectDirPath)
}
}
}
}
binaries.executable()
}
sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.coil)
implementation(libs.coil.compose)
implementation(libs.coil.ktor)
}
}
}

View file

@ -0,0 +1,36 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="600dp"
android:height="600dp"
android:viewportWidth="600"
android:viewportHeight="600">
<path
android:pathData="M301.21,418.53C300.97,418.54 300.73,418.56 300.49,418.56C297.09,418.59 293.74,417.72 290.79,416.05L222.6,377.54C220.63,376.43 219,374.82 217.85,372.88C216.7,370.94 216.09,368.73 216.07,366.47L216.07,288.16C216.06,287.32 216.09,286.49 216.17,285.67C216.38,283.54 216.91,281.5 217.71,279.6L199.29,268.27L177.74,256.19C175.72,260.43 174.73,265.23 174.78,270.22L174.79,387.05C174.85,393.89 178.57,400.2 184.53,403.56L286.26,461.02C290.67,463.51 295.66,464.8 300.73,464.76C300.91,464.76 301.09,464.74 301.27,464.74C301.24,449.84 301.22,439.23 301.22,439.23L301.21,418.53Z"
android:fillColor="#041619"
android:fillType="nonZero"/>
<path
android:pathData="M409.45,242.91L312.64,188.23C303.64,183.15 292.58,183.26 283.68,188.51L187.92,245C183.31,247.73 179.93,251.62 177.75,256.17L177.74,256.19L199.29,268.27L217.71,279.6C217.83,279.32 217.92,279.02 218.05,278.74C218.24,278.36 218.43,277.98 218.64,277.62C219.06,276.88 219.52,276.18 220.04,275.51C221.37,273.8 223.01,272.35 224.87,271.25L289.06,233.39C290.42,232.59 291.87,231.96 293.39,231.51C295.53,230.87 297.77,230.6 300,230.72C302.98,230.88 305.88,231.73 308.47,233.2L373.37,269.85C375.54,271.08 377.49,272.68 379.13,274.57C379.68,275.19 380.18,275.85 380.65,276.53C380.86,276.84 381.05,277.15 381.24,277.47L397.79,266.39L420.34,252.93L420.31,252.88C417.55,248.8 413.77,245.35 409.45,242.91Z"
android:fillColor="#37BF6E"
android:fillType="nonZero"/>
<path
android:pathData="M381.24,277.47C381.51,277.92 381.77,278.38 382.01,278.84C382.21,279.24 382.39,279.65 382.57,280.06C382.91,280.88 383.19,281.73 383.41,282.59C383.74,283.88 383.92,285.21 383.93,286.57L383.93,361.1C383.96,363.95 383.35,366.77 382.16,369.36C381.93,369.86 381.69,370.35 381.42,370.83C379.75,373.79 377.32,376.27 374.39,378L310.2,415.87C307.47,417.48 304.38,418.39 301.21,418.53L301.22,439.23C301.22,439.23 301.24,449.84 301.27,464.74C306.1,464.61 310.91,463.3 315.21,460.75L410.98,404.25C419.88,399 425.31,389.37 425.22,379.03L425.22,267.85C425.17,262.48 423.34,257.34 420.34,252.93L397.79,266.39L381.24,277.47Z"
android:fillColor="#3870B2"
android:fillType="nonZero"/>
<path
android:pathData="M177.75,256.17C179.93,251.62 183.31,247.73 187.92,245L283.68,188.51C292.58,183.26 303.64,183.15 312.64,188.23L409.45,242.91C413.77,245.35 417.55,248.8 420.31,252.88L420.34,252.93L498.59,206.19C494.03,199.46 487.79,193.78 480.67,189.75L320.86,99.49C306.01,91.1 287.75,91.27 273.07,99.95L114.99,193.2C107.39,197.69 101.81,204.11 98.21,211.63L177.74,256.19L177.75,256.17ZM301.27,464.74C301.09,464.74 300.91,464.76 300.73,464.76C295.66,464.8 290.67,463.51 286.26,461.02L184.53,403.56C178.57,400.2 174.85,393.89 174.79,387.05L174.78,270.22C174.73,265.23 175.72,260.43 177.74,256.19L98.21,211.63C94.86,218.63 93.23,226.58 93.31,234.82L93.31,427.67C93.42,438.97 99.54,449.37 109.4,454.92L277.31,549.77C284.6,553.88 292.84,556.01 301.2,555.94L301.2,555.8C301.39,543.78 301.33,495.26 301.27,464.74Z"
android:strokeWidth="10"
android:fillColor="#00000000"
android:strokeColor="#083042"
android:fillType="nonZero"/>
<path
android:pathData="M498.59,206.19L420.34,252.93C423.34,257.34 425.17,262.48 425.22,267.85L425.22,379.03C425.31,389.37 419.88,399 410.98,404.25L315.21,460.75C310.91,463.3 306.1,464.61 301.27,464.74C301.33,495.26 301.39,543.78 301.2,555.8L301.2,555.94C309.48,555.87 317.74,553.68 325.11,549.32L483.18,456.06C497.87,447.39 506.85,431.49 506.69,414.43L506.69,230.91C506.6,222.02 503.57,213.5 498.59,206.19Z"
android:strokeWidth="10"
android:fillColor="#00000000"
android:strokeColor="#083042"
android:fillType="nonZero"/>
<path
android:pathData="M301.2,555.94C292.84,556.01 284.6,553.88 277.31,549.76L109.4,454.92C99.54,449.37 93.42,438.97 93.31,427.67L93.31,234.82C93.23,226.58 94.86,218.63 98.21,211.63C101.81,204.11 107.39,197.69 114.99,193.2L273.07,99.95C287.75,91.27 306.01,91.1 320.86,99.49L480.67,189.75C487.79,193.78 494.03,199.46 498.59,206.19C503.57,213.5 506.6,222.02 506.69,230.91L506.69,414.43C506.85,431.49 497.87,447.39 483.18,456.06L325.11,549.32C317.74,553.68 309.48,555.87 301.2,555.94Z"
android:strokeWidth="10"
android:fillColor="#00000000"
android:strokeColor="#083042"
android:fillType="nonZero"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path"
android:pathData="M 21.31 2.331 C 18.674 2.331 14.639 6.151 12 10.146 C 9.361 6.152 5.326 2.331 2.69 2.331 C 1 2.331 1 4.098 1 4.947 C 1 5.498 1.335 9.859 1.577 10.757 C 2.012 12.379 3.081 13.887 4.685 14.705 C 4.133 15.157 3.736 15.689 3.536 16.291 C 3.309 16.971 3.148 18.338 4.616 19.853 C 5.79 21.064 6.872 21.653 7.926 21.653 C 9.629 21.653 11.092 19.743 12.001 18.195 C 12.91 19.743 14.373 21.653 16.076 21.653 C 17.13 21.653 18.212 21.064 19.386 19.853 C 20.854 18.339 20.692 16.972 20.466 16.291 C 20.265 15.689 19.868 15.157 19.317 14.705 C 20.921 13.887 21.991 12.379 22.425 10.757 C 22.665 9.859 23 5.499 23 4.947 C 23 4.098 23 2.331 21.31 2.331 Z M 20.492 10.239 C 20.052 11.879 18.607 13.615 16 13.283 L 16 15.367 C 17.613 15.727 18.395 16.409 18.567 16.925 C 18.752 17.478 18.333 18.066 17.948 18.462 C 16.944 19.499 16.343 19.653 16.074 19.653 C 15.311 19.653 13.96 17.801 13.102 16 L 12.015 16 L 12 16.007 L 11.985 16 L 10.898 16 C 10.039 17.801 8.689 19.653 7.926 19.653 C 7.657 19.653 7.057 19.498 6.052 18.462 C 5.668 18.066 5.249 17.478 5.433 16.925 C 5.605 16.409 6.387 15.727 8 15.367 L 8 13.283 C 5.393 13.615 3.948 11.879 3.508 10.239 C 3.354 9.666 3 5.613 3 4.947 C 3 4.687 3.006 4.502 3.016 4.37 C 4.794 4.762 8.42 8.073 10.809 12 L 13.191 12 C 15.58 8.073 19.205 4.762 20.984 4.37 C 20.994 4.502 21 4.688 21 4.947 C 21 5.613 20.646 9.666 20.492 10.239 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path"
android:pathData="M 10.9 2.1 C 6.3 2.6 2.6 6.3 2.1 10.8 C 1.6 15.5 4.3 19.7 8.4 21.3 C 8.7 21.4 9 21.2 9 20.8 L 9 19.2 C 9 19.2 8.6 19.3 8.1 19.3 C 6.7 19.3 6.1 18.1 6 17.4 C 5.9 17 5.7 16.7 5.4 16.4 C 5.1 16.3 5 16.3 5 16.2 C 5 16 5.3 16 5.4 16 C 6 16 6.5 16.7 6.7 17 C 7.2 17.8 7.8 18 8.1 18 C 8.5 18 8.8 17.9 9 17.8 C 9.1 17.1 9.4 16.4 10 16 C 7.7 15.5 6 14.2 6 12 C 6 10.9 6.5 9.8 7.2 9 C 7.1 8.8 7 8.3 7 7.6 C 7 7.2 7 6.6 7.3 6 C 7.3 6 8.7 6 10.1 7.3 C 10.6 7.1 11.3 7 12 7 C 12.7 7 13.4 7.1 14 7.3 C 15.3 6 16.8 6 16.8 6 C 17 6.6 17 7.2 17 7.6 C 17 8.4 16.9 8.8 16.8 9 C 17.5 9.8 18 10.8 18 12 C 18 14.2 16.3 15.5 14 16 C 14.6 16.5 15 17.4 15 18.3 L 15 20.9 C 15 21.2 15.3 21.5 15.7 21.4 C 19.4 19.9 22 16.3 22 12.1 C 22 6.1 16.9 1.4 10.9 2.1 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path_1"
android:pathData="M 5 3 C 3.895 3 3 3.895 3 5 L 3 19 C 3 20.105 3.895 21 5 21 L 19 21 C 20.105 21 21 20.105 21 19 L 21 5 C 21 3.895 20.105 3 19 3 L 5 3 Z M 5 5 L 19 5 L 19 19 L 5 19 L 5 5 Z M 7.779 6.316 C 6.922 6.316 6.408 6.832 6.408 7.518 C 6.408 8.204 6.922 8.717 7.693 8.717 C 8.55 8.717 9.064 8.204 9.064 7.518 C 9.064 6.832 8.55 6.316 7.779 6.316 Z M 6.477 10 L 6.477 17 L 9 17 L 9 10 L 6.477 10 Z M 11.082 10 L 11.082 17 L 13.605 17 L 13.605 13.174 C 13.605 12.035 14.418 11.871 14.662 11.871 C 14.906 11.871 15.559 12.116 15.559 13.174 L 15.559 17 L 18 17 L 18 13.174 C 18 10.977 17.024 10 15.803 10 C 14.582 10 13.93 10.407 13.605 10.977 L 13.605 10 L 11.082 10 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:name="path_1"
android:pathData="M 15.938 4.031 C 12.917 4.043 9.918 4.427 8.357 5.146 C 8.357 5.146 5 6.675 5 11.881 C 5 18.078 4.995 25.86 10.563 27.365 C 12.694 27.938 14.528 28.062 16.002 27.977 C 18.677 27.826 20 27.006 20 27.006 L 19.91 25.029 C 19.91 25.029 18.176 25.64 16.029 25.57 C 13.902 25.495 11.662 25.336 11.313 22.68 C 11.28 22.433 11.265 22.183 11.266 21.934 C 15.773 23.053 19.616 22.421 20.674 22.293 C 23.628 21.934 26.199 20.082 26.527 18.389 C 27.041 15.721 26.998 11.881 26.998 11.881 C 26.998 6.675 23.646 5.146 23.646 5.146 C 22.001 4.378 18.958 4.019 15.938 4.031 Z M 12.705 8.002 C 13.74 8.03 14.763 8.493 15.393 9.471 L 16.002 10.506 L 16.609 9.471 C 17.874 7.504 20.71 7.626 22.059 9.148 C 23.303 10.596 23.025 11.531 23.025 18 L 23.025 18.002 L 20.578 18.002 L 20.578 12.373 C 20.578 9.738 17.219 9.636 17.219 12.738 L 17.219 16 L 14.787 16 L 14.787 12.738 C 14.787 9.636 11.43 9.736 11.43 12.371 L 11.43 18 L 8.977 18 C 8.977 11.526 8.704 10.585 9.943 9.148 C 10.623 8.382 11.67 7.974 12.705 8.002 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path_1"
android:pathData="M 7 8 C 9.757 8 12 10.243 12 13 C 12 15.757 9.757 18 7 18 C 4.243 18 2 15.757 2 13 C 2 10.243 4.243 8 7 8 M 7 6 C 3.134 6 0 9.134 0 13 C 0 16.866 3.134 20 7 20 C 10.866 20 14 16.866 14 13 C 14 9.134 10.866 6 7 6 Z M 18 8.693 C 18.409 9.275 19 10.774 19 13 C 19 15.226 18.409 16.725 18 17.307 C 17.591 16.725 17 15.226 17 13 C 17 10.774 17.591 9.275 18 8.693 M 18 6.5 C 16.343 6.5 15 9.41 15 13 C 15 16.59 16.343 19.5 18 19.5 C 19.657 19.5 21 16.59 21 13 C 21 9.41 19.657 6.5 18 6.5 Z M 23 8 C 22.735 8 22.48 8.527 22.293 9.464 C 22.105 10.402 22 11.674 22 13 C 22 14.326 22.105 15.598 22.293 16.536 C 22.48 17.473 22.735 18 23 18 C 23.265 18 23.52 17.473 23.707 16.536 C 23.895 15.598 24 14.326 24 13 C 24 11.674 23.895 10.402 23.707 9.464 C 23.52 8.527 23.265 8 23 8 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path"
android:pathData="M 22 3.999 C 21.22 4.462 19.655 5.093 18.735 5.275 C 18.708 5.282 18.686 5.291 18.66 5.298 C 17.847 4.496 16.733 3.999 15.5 3.999 C 13.015 3.999 11 6.014 11 8.499 C 11 8.63 10.989 8.871 11 8.999 C 7.647 8.999 5.095 7.243 3.265 4.999 C 3.066 5.499 2.979 6.289 2.979 7.031 C 2.979 8.432 4.074 9.808 5.779 10.661 C 5.465 10.742 5.119 10.8 4.759 10.8 C 4.178 10.8 3.563 10.647 3 10.183 L 3 10.234 C 3 12.192 5.078 13.525 6.926 13.896 C 6.551 14.117 5.795 14.139 5.426 14.139 C 5.166 14.139 4.246 14.02 4 13.974 C 4.514 15.579 6.368 16.481 8.135 16.513 C 6.753 17.597 5.794 17.999 2.964 17.999 L 2 17.999 C 3.788 19.145 6.065 20 8.347 20 C 15.777 20 20 14.337 20 8.999 C 20 8.913 19.998 8.733 19.995 8.552 C 19.995 8.534 20 8.517 20 8.499 C 20 8.472 19.992 8.446 19.992 8.419 C 19.989 8.283 19.986 8.156 19.983 8.09 C 20.773 7.52 21.458 6.809 22 5.999 C 21.275 6.321 20.497 6.537 19.68 6.635 C 20.514 6.135 21.699 4.943 22 3.999 Z M 18 8.999 C 18 13.079 15.043 17.398 9.534 17.942 C 10.28 17.413 11 16.662 11 16.662 C 11 16.662 8 14 7.775 10.522 C 8.81 10.838 9.888 10.999 11 10.999 L 13 10.999 L 13 8.499 L 13 8.498 C 13.002 7.118 14.12 6 15.5 6 C 16.881 6 18 7.119 18 8.5 L 18 8.999 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
</vector>

View file

@ -0,0 +1,251 @@
package dev.anandbose
import anandbose.composeapp.generated.resources.Res
import anandbose.composeapp.generated.resources.compose_multiplatform
import anandbose.composeapp.generated.resources.social_bluesky
import anandbose.composeapp.generated.resources.social_github
import anandbose.composeapp.generated.resources.social_linkedin
import anandbose.composeapp.generated.resources.social_mastodon
import anandbose.composeapp.generated.resources.social_medium
import anandbose.composeapp.generated.resources.social_twitter
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import coil3.compose.AsyncImage
import kotlinx.browser.window
import org.jetbrains.compose.resources.painterResource
@Composable
fun App() {
MaterialTheme(
colorScheme = if (isSystemInDarkTheme()) {
darkColorScheme()
} else {
lightColorScheme()
}
) {
Scaffold(modifier = Modifier.fillMaxSize()) {
BoxWithConstraints(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.TopCenter,
) {
val scrollState = rememberScrollState()
Column(
modifier = Modifier
.widthIn(max = 760.dp)
.padding(horizontal = 32.dp)
.verticalScroll(state = scrollState),
horizontalAlignment = Alignment.CenterHorizontally,
) {
AsyncImage(
model = "https://avatars.githubusercontent.com/u/64779880?v=4",
modifier = Modifier
.padding(top = 32.dp)
.clip(CircleShape)
.size(size = 128.dp),
contentDescription = null
)
Text(
modifier = Modifier.padding(top = 16.dp),
text = "Anand Bose",
style = MaterialTheme.typography.titleLarge,
)
Text(
modifier = Modifier.padding(top = 8.dp),
text = "I'm passionate about building software with Kotlin and Compose.",
style = MaterialTheme.typography.labelLarge,
textAlign = TextAlign.Center,
)
if (this@BoxWithConstraints.maxWidth > 480.dp) {
Row(
modifier = Modifier.padding(top = 48.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
UrlButtonLarge(
modifier = Modifier.weight(1f),
icon = painterResource(Res.drawable.social_medium),
text = "Medium",
url = "https://medium.com/@anandbose",
)
UrlButtonLarge(
modifier = Modifier.weight(1f),
icon = painterResource(Res.drawable.social_linkedin),
text = "LinkedIn",
url = "https://linkedin.com/in/anandbosedev",
)
}
Row(
modifier = Modifier.padding(top = 16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
UrlButtonLarge(
modifier = Modifier.weight(1f),
icon = painterResource(Res.drawable.social_github),
text = "GitHub",
url = "https://github.com/anandbosedev",
)
UrlButtonLarge(
modifier = Modifier.weight(1f),
icon = painterResource(Res.drawable.social_mastodon),
text = "Mastodon",
url = "https://mastodon.social/@anandbosedev",
)
}
Row(
modifier = Modifier.padding(top = 16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
UrlButtonLarge(
modifier = Modifier.weight(1f),
icon = painterResource(Res.drawable.social_bluesky),
text = "Bluesky",
url = "https://bsky.app/profile/anandbose.dev",
)
UrlButtonLarge(
modifier = Modifier.weight(1f),
icon = painterResource(Res.drawable.social_twitter),
text = "Twitter",
url = "https://x.com/@anandbosedev",
)
}
} else {
UrlButtonSmall(
modifier = Modifier.fillMaxWidth().padding(top = 24.dp),
icon = painterResource(Res.drawable.social_medium),
text = "Medium",
url = "https://medium.com/@anandbose",
)
UrlButtonSmall(
modifier = Modifier.fillMaxWidth().padding(top = 16.dp),
icon = painterResource(Res.drawable.social_linkedin),
text = "LinkedIn",
url = "https://linkedin.com/in/anandbosedev",
)
UrlButtonSmall(
modifier = Modifier.fillMaxWidth().padding(top = 16.dp),
icon = painterResource(Res.drawable.social_github),
text = "GitHub",
url = "https://github.com/anandbosedev",
)
UrlButtonSmall(
modifier = Modifier.fillMaxWidth().padding(top = 16.dp),
icon = painterResource(Res.drawable.social_mastodon),
text = "Mastodon",
url = "https://mastodon.social/@anandbosedev",
)
UrlButtonSmall(
modifier = Modifier.fillMaxWidth().padding(top = 16.dp),
icon = painterResource(Res.drawable.social_bluesky),
text = "Bluesky",
url = "https://bsky.app/profile/anandbose.dev",
)
UrlButtonSmall(
modifier = Modifier.fillMaxWidth().padding(top = 16.dp),
icon = painterResource(Res.drawable.social_twitter),
text = "Twitter",
url = "https://x.com/@anandbosedev",
)
}
Text(
modifier = Modifier.padding(vertical = 32.dp),
text = "This website is built with Compose Multiplatform and Kotlin/WASM. The icons are sourced from icons8.com",
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}
}
}
}
@Composable
fun UrlButtonLarge(
modifier: Modifier = Modifier,
icon: Painter,
text: String,
url: String,
) {
Button(
modifier = modifier,
shape = MaterialTheme.shapes.small,
content = {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
Image(
modifier = Modifier.size(48.dp),
painter = icon,
contentDescription = null,
colorFilter = ColorFilter.tint(
color = MaterialTheme.colorScheme.onPrimary,
),
)
Text(
text = text,
style = MaterialTheme.typography.labelLarge,
)
}
},
onClick = {
window.open(url, "_blank")
}
)
}
@Composable
fun UrlButtonSmall(
modifier: Modifier = Modifier,
icon: Painter,
text: String,
url: String,
) {
Button(
modifier = modifier,
content = {
Image(
modifier = Modifier.size(32.dp),
painter = icon,
contentDescription = null,
colorFilter = ColorFilter.tint(
color = MaterialTheme.colorScheme.onPrimary,
),
)
Text(
modifier = Modifier.padding(start = 4.dp),
text = text,
style = MaterialTheme.typography.labelLarge,
)
},
onClick = {
window.open(url, "_blank")
}
)
}

View file

@ -0,0 +1,12 @@
package dev.anandbose
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.ComposeViewport
import kotlinx.browser.document
@OptIn(ExperimentalComposeUiApi::class)
fun main() {
ComposeViewport(document.body!!) {
App()
}
}

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anand Bose</title>
<link type="text/css" rel="stylesheet" href="styles.css">
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
</body>
</html>

View file

@ -0,0 +1,7 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}

6
gradle.properties Normal file
View file

@ -0,0 +1,6 @@
#Kotlin
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx2048M
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8

21
gradle/libs.versions.toml Normal file
View file

@ -0,0 +1,21 @@
[versions]
androidx-lifecycle = "2.8.4"
compose-multiplatform = "1.7.0"
junit = "4.13.2"
kotlin = "2.1.0"
coil = "3.0.4"
[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
coil = { group = "io.coil-kt.coil3", name = "coil", version.ref = "coil"}
coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil"}
coil-ktor = { group = "io.coil-kt.coil3", name = "coil-network-ktor3", version.ref = "coil"}
[plugins]
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

252
gradlew vendored Executable file
View file

@ -0,0 +1,252 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

94
gradlew.bat vendored Normal file
View file

@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

2895
kotlin-js-store/yarn.lock Normal file

File diff suppressed because it is too large Load diff

31
settings.gradle.kts Normal file
View file

@ -0,0 +1,31 @@
rootProject.name = "AnandBose"
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
pluginManagement {
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
}
}
include(":composeApp")