diff --git a/examples/falling_balls_with_web/build.gradle.kts b/examples/falling_balls_with_web/build.gradle.kts index 1f61ef1466..659b2094c0 100644 --- a/examples/falling_balls_with_web/build.gradle.kts +++ b/examples/falling_balls_with_web/build.gradle.kts @@ -1,6 +1,8 @@ import org.jetbrains.compose.compose import org.jetbrains.compose.desktop.application.dsl.TargetFormat +// This project is autogenerated from ../web/samples/falling_balls_with_web +// In case you want modify code, please, modify it there. plugins { kotlin("multiplatform") version "1.5.21" id("org.jetbrains.compose") version "0.5.0-build270" diff --git a/examples/web-compose-bird/build.gradle.kts b/examples/web-compose-bird/build.gradle.kts index 3c27cb5e45..1e97b60179 100644 --- a/examples/web-compose-bird/build.gradle.kts +++ b/examples/web-compose-bird/build.gradle.kts @@ -1,4 +1,6 @@ // Add compose gradle plugin +// This project is autogenerated from ../web/samples/web-compose-bird +// In case you want modify code, please, modify it there. plugins { kotlin("multiplatform") version "1.5.21" id("org.jetbrains.compose") version "0.5.0-build270" diff --git a/examples/web-getting-started/build.gradle.kts b/examples/web-getting-started/build.gradle.kts index 042c67327f..b609f1038c 100644 --- a/examples/web-getting-started/build.gradle.kts +++ b/examples/web-getting-started/build.gradle.kts @@ -1,3 +1,5 @@ +// This project is autogenerated from ../web/samples/web-getting-started +// In case you want modify code, please, modify it there. plugins { kotlin("multiplatform") version "1.5.21" id("org.jetbrains.compose") version "0.5.0-build270" diff --git a/examples/web-with-react/build.gradle.kts b/examples/web-with-react/build.gradle.kts index 34b34c468d..14bdeb0201 100644 --- a/examples/web-with-react/build.gradle.kts +++ b/examples/web-with-react/build.gradle.kts @@ -1,3 +1,5 @@ +// This project is autogenerated from ../web/samples/web-with-react +// In case you want modify code, please, modify it there. plugins { kotlin("multiplatform") version "1.5.21" id("org.jetbrains.compose") version "0.5.0-build270" diff --git a/examples/web_landing/build.gradle.kts b/examples/web_landing/build.gradle.kts index 903f66afea..c9cb9ada78 100644 --- a/examples/web_landing/build.gradle.kts +++ b/examples/web_landing/build.gradle.kts @@ -1,3 +1,5 @@ +// This project is autogenerated from ../web/samples/web_landing +// In case you want modify code, please, modify it there. plugins { kotlin("multiplatform") version "1.5.21" id("org.jetbrains.compose") version "0.5.0-build270" diff --git a/web/build.gradle.kts b/web/build.gradle.kts index cc11c9b1fc..da061e56bf 100644 --- a/web/build.gradle.kts +++ b/web/build.gradle.kts @@ -1,3 +1,4 @@ +val COMPOSE_CORE_VERSION: String by project val COMPOSE_WEB_VERSION: String by project val COMPOSE_REPO_USERNAME: String? by project val COMPOSE_REPO_KEY: String? by project @@ -5,12 +6,62 @@ val COMPOSE_WEB_BUILD_WITH_SAMPLES = project.property("compose.web.buildSamples" apply() +fun Project.isSampleProject() = projectDir.parentFile.name == "samples" + +tasks.register("generateExamples") { + dependsOn( + subprojects.filter { it.isSampleProject() }.map { ":samples:${it.name}:sync" } + ) +} + subprojects { apply(plugin = "maven-publish") group = "org.jetbrains.compose.web" version = COMPOSE_WEB_VERSION + if (isSampleProject()) { + + val buildGradleSpec = copySpec { + from("build.gradle.kts") { + filter { line -> + line + .replace( + "plugins {", +"""// This project is autogenerated from ../web/samples/${project.projectDir.name} +// In case you want modify code, please, modify it there. +plugins {""" + ) + .replace( + "id(\"org.jetbrains.compose\")", + "id(\"org.jetbrains.compose\") version \"$COMPOSE_CORE_VERSION\"", + ) + .replace( + "implementation(project(\":web-core\"))", + "implementation(compose.web.core)" + ) + .replace( + "implementation(project(\":web-widgets\"))", + "implementation(compose.web.widgets)" + ) + } + } + } + + tasks.register("sync") { + val targetDir = rootProject.projectDir.resolve("../examples/${project.projectDir.name}").normalize() + duplicatesStrategy = DuplicatesStrategy.INCLUDE + from(project.projectDir) + into(targetDir) + exclude("build") + + with(buildGradleSpec) + doLast { + println("from ${project.projectDir} => $targetDir") + } + } + } + pluginManager.withPlugin("maven-publish") { configure { repositories { diff --git a/web/samples/falling_balls_with_web/build.gradle.kts b/web/samples/falling_balls_with_web/build.gradle.kts new file mode 100644 index 0000000000..62e17bd648 --- /dev/null +++ b/web/samples/falling_balls_with_web/build.gradle.kts @@ -0,0 +1,74 @@ +import org.jetbrains.compose.compose +import org.jetbrains.compose.desktop.application.dsl.TargetFormat + +plugins { + kotlin("multiplatform") version "1.5.21" + id("org.jetbrains.compose") +} + +version = "1.0-SNAPSHOT" + +repositories { + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") +} + +kotlin { + jvm() + js(IR) { + browser() + binaries.executable() + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(kotlin("stdlib-common")) + implementation(compose.web.widgets) + implementation(compose.runtime) + } + } + + val jvmMain by getting { + dependencies { + implementation(compose.desktop.currentOs) + } + } + + + val commonTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + } + } + } +} + +compose.desktop { + application { + mainClass = "org.jetbrains.compose.common.demo.AppKt" + + nativeDistributions { + targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) + packageName = "ImageViewer" + packageVersion = "1.0.0" + + modules("jdk.crypto.ec") + + val iconsRoot = project.file("../common/src/desktopMain/resources/images") + macOS { + iconFile.set(iconsRoot.resolve("icon-mac.icns")) + } + windows { + iconFile.set(iconsRoot.resolve("icon-windows.ico")) + menuGroup = "Compose Examples" + // see https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html + upgradeUuid = "18159995-d967-4CD2-8885-77BFA97CFA9F" + } + linux { + iconFile.set(iconsRoot.resolve("icon-linux.png")) + } + } + } +} diff --git a/web/samples/falling_balls_with_web/gradle/wrapper/gradle-wrapper.jar b/web/samples/falling_balls_with_web/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..e708b1c023 Binary files /dev/null and b/web/samples/falling_balls_with_web/gradle/wrapper/gradle-wrapper.jar differ diff --git a/web/samples/falling_balls_with_web/gradle/wrapper/gradle-wrapper.properties b/web/samples/falling_balls_with_web/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..29e4134576 --- /dev/null +++ b/web/samples/falling_balls_with_web/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/web/samples/falling_balls_with_web/gradlew b/web/samples/falling_balls_with_web/gradlew new file mode 100755 index 0000000000..4f906e0c81 --- /dev/null +++ b/web/samples/falling_balls_with_web/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# 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 + ;; + 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" + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/web/samples/falling_balls_with_web/gradlew.bat b/web/samples/falling_balls_with_web/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/web/samples/falling_balls_with_web/gradlew.bat @@ -0,0 +1,89 @@ +@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 + +@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=. +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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/web/samples/falling_balls_with_web/settings.gradle.kts b/web/samples/falling_balls_with_web/settings.gradle.kts new file mode 100644 index 0000000000..ad64f11370 --- /dev/null +++ b/web/samples/falling_balls_with_web/settings.gradle.kts @@ -0,0 +1,10 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") } + } + +} +rootProject.name = "falling_balls_with_web" + diff --git a/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/Game.kt b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/Game.kt new file mode 100644 index 0000000000..0f04b6bbfe --- /dev/null +++ b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/Game.kt @@ -0,0 +1,77 @@ +package org.jetbrains.compose.demo.falling + +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateListOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import org.jetbrains.compose.common.ui.unit.IntSize +import org.jetbrains.compose.common.core.graphics.Color +import kotlin.random.Random + +private fun Color.Companion.random() = + Color((0..255).random(), (0..255).random(), (0..255).random()) + +abstract class Game { + internal var previousTime: Long = Long.MAX_VALUE + private var startTime = 0L + + var size by mutableStateOf(IntSize(0, 0)) + + var width: Int + get() = size.width + set(newWidth: Int) { + size = IntSize(newWidth, height) + } + + var height: Int + get() = size.height + set(newHeight) { + size = IntSize(width, newHeight) + } + + var pieces = mutableStateListOf() + private set + + var elapsed by mutableStateOf(0L) + var score by mutableStateOf(0) + var clicked by mutableStateOf(0) + + var started by mutableStateOf(false) + var paused by mutableStateOf(false) + var finished by mutableStateOf(false) + + var numBlocks by mutableStateOf(5) + + fun isInBoundaries(pieceData: PieceData) = pieceData.position < size.height + + abstract fun now(): Long + + fun togglePause() { + paused = !paused + previousTime = Long.MAX_VALUE + } + + fun start() { + previousTime = now() + startTime = previousTime + clicked = 0 + started = true + finished = false + paused = false + pieces.clear() + repeat(numBlocks) { index -> + pieces.add( + PieceData(this, index * 1.5f + 5f, Color.random()).also { piece -> + piece.position = Random.nextDouble(0.0, 100.0).toFloat() + } + ) + } + } + + fun update(nanos: Long) { + val dt = (nanos - previousTime).coerceAtLeast(0) + previousTime = nanos + elapsed = nanos - startTime + pieces.forEach { it.update(dt) } + } +} diff --git a/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/Piece.kt b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/Piece.kt new file mode 100644 index 0000000000..ce3fda443e --- /dev/null +++ b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/Piece.kt @@ -0,0 +1,29 @@ +package org.jetbrains.compose.demo.falling.views + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.demo.falling.PieceData +import org.jetbrains.compose.common.ui.Modifier +import org.jetbrains.compose.common.foundation.layout.Box +import org.jetbrains.compose.common.ui.unit.dp +import org.jetbrains.compose.common.ui.unit.Dp +import org.jetbrains.compose.common.foundation.layout.offset +import org.jetbrains.compose.common.ui.background +import org.jetbrains.compose.common.ui.size +import org.jetbrains.compose.common.foundation.clickable +import org.jetbrains.compose.common.ui.draw.clip +import org.jetbrains.compose.common.core.graphics.Color +import jetbrains.compose.common.shapes.CircleShape +import org.jetbrains.compose.common.demo.position + +@Composable +fun Piece(index: Int, piece: PieceData) { + val boxSize = 40.dp + Box( + Modifier + .position(Dp(boxSize.value * index * 5 / 3), Dp(piece.position)) + .size(boxSize, boxSize) + .background(if (piece.picked) Color.Gray else piece.color) + .clickable { piece.pick() } + .clip(CircleShape) + ) {} +} diff --git a/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/PieceData.kt b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/PieceData.kt new file mode 100644 index 0000000000..8617d16642 --- /dev/null +++ b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/PieceData.kt @@ -0,0 +1,32 @@ +package org.jetbrains.compose.demo.falling + +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import androidx.compose.runtime.getValue +import org.jetbrains.compose.common.core.graphics.Color + +data class PieceData(val game: Game, val velocity: Float, val color: Color) { + var picked: Boolean by mutableStateOf(false) + var position: Float by mutableStateOf(0f) + + private fun Game.pickPiece(piece: PieceData) { + score += piece.velocity.toInt() + clicked++ + if (clicked == numBlocks) { + finished = true + } + } + + fun update(dt: Long) { + if (picked) return + val delta = (dt / 1E8 * velocity).toFloat() + position = if (game.isInBoundaries(this)) position + delta else 0f + } + + fun pick() { + if (!picked && !game.paused) { + picked = true + game.pickPiece(this) + } + } +} diff --git a/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/fallingBalls.kt b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/fallingBalls.kt new file mode 100644 index 0000000000..f24f62a854 --- /dev/null +++ b/web/samples/falling_balls_with_web/src/commonMain/kotlin/fallingBalls/fallingBalls.kt @@ -0,0 +1,103 @@ +package org.jetbrains.compose.demo.falling.views + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.withFrameNanos +import org.jetbrains.compose.demo.falling.Game +import org.jetbrains.compose.common.material.Text +import org.jetbrains.compose.common.foundation.layout.Column +import org.jetbrains.compose.common.material.Slider +import org.jetbrains.compose.common.foundation.layout.Row +import org.jetbrains.compose.common.foundation.layout.Box +import org.jetbrains.compose.common.material.Button +import org.jetbrains.compose.common.ui.Modifier +import org.jetbrains.compose.common.ui.unit.em +import org.jetbrains.compose.common.ui.unit.dp +import org.jetbrains.compose.common.foundation.layout.offset +import org.jetbrains.compose.common.foundation.layout.width +import org.jetbrains.compose.common.ui.layout.onSizeChanged +import org.jetbrains.compose.common.ui.background +import org.jetbrains.compose.common.foundation.border +import org.jetbrains.compose.common.ui.size +import org.jetbrains.compose.common.core.graphics.Color +import org.jetbrains.compose.common.foundation.layout.fillMaxHeight +import org.jetbrains.compose.common.foundation.layout.fillMaxWidth + +@Composable +fun fallingBalls(game: Game) { + Column(Modifier.fillMaxWidth().fillMaxHeight(1f)) { + Box() { + Text( + "Catch balls!${if (game.finished) " Game over!" else ""}", + size = 1.8f.em, + color = Color(218, 120, 91) + ) + } + Box() { + Text( + "Score: ${game.score} Time: ${game.elapsed / 1_000_000} Blocks: ${game.numBlocks}", + size = 1.8f.em + ) + } + Row() { + if (!game.started) { + Slider( + value = game.numBlocks / 20f, + onValueChange = { game.numBlocks = (it * 20f).toInt().coerceAtLeast(1) }, + modifier = Modifier.width(100.dp) + ) + } + Button( + Modifier + .border(2.dp, Color(255, 215, 0)) + .background(Color.Yellow), + onClick = { + game.started = !game.started + if (game.started) { + game.start() + } + } + ) { + Text(if (game.started) "Stop" else "Start", size = 2f.em) + } + if (game.started) { + Button( + Modifier + .offset(10.dp, 0.dp) + .border(2.dp, Color(255, 215, 0)) + .background(Color.Yellow), + onClick = { + game.togglePause() + } + ) { + Text(if (game.paused) "Resume" else "Pause", size = 2f.em) + } + } + } + + if (game.started) { + Box( + Modifier + .fillMaxWidth() + .fillMaxHeight(1f) + .size(game.width.dp, game.height.dp) + .onSizeChanged { + game.size = it + } + ) { + game.pieces.forEachIndexed { index, piece -> + Piece(index, piece) + } + } + } + + LaunchedEffect(Unit) { + while (true) { + withFrameNanos { + if (game.started && !game.paused && !game.finished) + game.update(it) + } + } + } + } +} diff --git a/web/samples/falling_balls_with_web/src/commonMain/kotlin/modifiers/position.kt b/web/samples/falling_balls_with_web/src/commonMain/kotlin/modifiers/position.kt new file mode 100644 index 0000000000..795d4ec018 --- /dev/null +++ b/web/samples/falling_balls_with_web/src/commonMain/kotlin/modifiers/position.kt @@ -0,0 +1,8 @@ +package org.jetbrains.compose.common.demo + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.common.ui.Modifier +import org.jetbrains.compose.common.ui.unit.Dp + +@Composable +expect fun Modifier.position(width: Dp, height: Dp): Modifier \ No newline at end of file diff --git a/web/samples/falling_balls_with_web/src/jsMain/kotlin/androidx/compose/web/with-web/App.kt b/web/samples/falling_balls_with_web/src/jsMain/kotlin/androidx/compose/web/with-web/App.kt new file mode 100644 index 0000000000..0490d7924b --- /dev/null +++ b/web/samples/falling_balls_with_web/src/jsMain/kotlin/androidx/compose/web/with-web/App.kt @@ -0,0 +1,30 @@ +package org.jetbrainsc.compose.common.demo + +import org.jetbrains.compose.web.renderComposable +import kotlinx.browser.document +import org.w3c.dom.HTMLElement +import org.jetbrains.compose.demo.falling.views.fallingBalls +import org.jetbrains.compose.demo.falling.Game +import androidx.compose.runtime.remember +import kotlinx.browser.window +import org.jetbrains.compose.web.css.Style +import org.jetbrains.compose.web.ui.Styles + +class JsGame : Game() { + override fun now() = window.performance.now().toLong() +} + +fun main() { + val root = document.getElementById("root") as HTMLElement + + renderComposable(root = root) { + Style(Styles) + val game = remember { + JsGame().apply { + width = root.offsetWidth + height = root.offsetHeight + } + } + fallingBalls(game) + } +} diff --git a/web/samples/falling_balls_with_web/src/jsMain/kotlin/modifiers/position.kt b/web/samples/falling_balls_with_web/src/jsMain/kotlin/modifiers/position.kt new file mode 100644 index 0000000000..decc9ee0a7 --- /dev/null +++ b/web/samples/falling_balls_with_web/src/jsMain/kotlin/modifiers/position.kt @@ -0,0 +1,21 @@ +package org.jetbrains.compose.common.demo + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.common.ui.Modifier +import org.jetbrains.compose.common.foundation.layout.offset +import org.jetbrains.compose.common.ui.unit.Dp +import org.jetbrains.compose.common.internal.castOrCreate +import org.jetbrains.compose.web.css.top +import org.jetbrains.compose.web.css.left +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.css.position +import org.jetbrains.compose.web.css.Position + +@Composable +actual fun Modifier.position(width: Dp, height: Dp): Modifier = castOrCreate().apply { + add { + position(Position.Absolute) + top(height.value.px) + left(width.value.px) + } +} \ No newline at end of file diff --git a/web/samples/falling_balls_with_web/src/jsMain/resources/index.html b/web/samples/falling_balls_with_web/src/jsMain/resources/index.html new file mode 100644 index 0000000000..5c5e954a1e --- /dev/null +++ b/web/samples/falling_balls_with_web/src/jsMain/resources/index.html @@ -0,0 +1,29 @@ + + + + + + + compose-browser-with-web-demo + + + +
+ + + diff --git a/web/samples/falling_balls_with_web/src/jsMain/resources/styles.css b/web/samples/falling_balls_with_web/src/jsMain/resources/styles.css new file mode 100644 index 0000000000..e5b3293a7a --- /dev/null +++ b/web/samples/falling_balls_with_web/src/jsMain/resources/styles.css @@ -0,0 +1,8 @@ +#root { + width: 100%; + height: 100vh; +} + +#root > .compose-web-column > div { + position: relative; +} \ No newline at end of file diff --git a/web/samples/falling_balls_with_web/src/jvmMain/kotlin/App.kt b/web/samples/falling_balls_with_web/src/jvmMain/kotlin/App.kt new file mode 100644 index 0000000000..f5550d29ec --- /dev/null +++ b/web/samples/falling_balls_with_web/src/jvmMain/kotlin/App.kt @@ -0,0 +1,24 @@ +package org.jetbrains.compose.common.demo + +import androidx.compose.desktop.Window +import androidx.compose.ui.unit.IntSize +import org.jetbrains.compose.demo.falling.views.fallingBalls +import org.jetbrains.compose.demo.falling.Game +import androidx.compose.runtime.remember + +class JvmGame : Game() { + override fun now() = System.nanoTime() +} + +fun main() { + Window(title = "Demo", size = IntSize(600, 400)) { + fallingBalls( + remember { + JvmGame().apply { + width = 600 + height = 400 + } + } + ) + } +} diff --git a/web/samples/falling_balls_with_web/src/jvmMain/kotlin/modifiers/position.kt b/web/samples/falling_balls_with_web/src/jvmMain/kotlin/modifiers/position.kt new file mode 100644 index 0000000000..ed072dac40 --- /dev/null +++ b/web/samples/falling_balls_with_web/src/jvmMain/kotlin/modifiers/position.kt @@ -0,0 +1,14 @@ +package org.jetbrains.compose.common.demo + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.common.ui.Modifier +import org.jetbrains.compose.common.foundation.layout.offset +import org.jetbrains.compose.common.ui.unit.Dp +import org.jetbrains.compose.common.internal.castOrCreate +import org.jetbrains.compose.common.ui.unit.implementation +import androidx.compose.foundation.layout.offset + +@Composable +actual fun Modifier.position(width: Dp, height: Dp): Modifier = castOrCreate().apply { + modifier = modifier.offset(width.implementation, height.implementation) +} \ No newline at end of file diff --git a/web/samples/web-compose-bird/.gitignore b/web/samples/web-compose-bird/.gitignore new file mode 100644 index 0000000000..ba8435b9c5 --- /dev/null +++ b/web/samples/web-compose-bird/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +build/ +/captures +.externalNativeBuild +.cxx \ No newline at end of file diff --git a/web/samples/web-compose-bird/README.md b/web/samples/web-compose-bird/README.md new file mode 100644 index 0000000000..f0aede880b --- /dev/null +++ b/web/samples/web-compose-bird/README.md @@ -0,0 +1,35 @@ +# 🐦 Compose Bird + +![](demo.gif) + +![latestVersion](https://img.shields.io/github/v/release/theapache64/compose-bird) + +Twitter: theapache64 + + +> A flappy bird clone using Compose Web and radio buttons + +## ▶️ Play + +- https://theapache64.github.io/compose-bird/ + +## 🏃 Run + +``` +./gradlew jsBrowserRun +``` + +## 📦 Distribute + +``` +./gradlew jsBrowserDistribution // and then open index.html (build/distributions) +``` + +## ✍️ Author + +👤 **theapache64** + +* Twitter: @theapache64 +* Email: theapache64@gmail.com + +Feel free to ping me 😉 \ No newline at end of file diff --git a/web/samples/web-compose-bird/build.gradle.kts b/web/samples/web-compose-bird/build.gradle.kts new file mode 100644 index 0000000000..9187926202 --- /dev/null +++ b/web/samples/web-compose-bird/build.gradle.kts @@ -0,0 +1,28 @@ +// Add compose gradle plugin +plugins { + kotlin("multiplatform") version "1.5.21" + id("org.jetbrains.compose") +} +group = "com.theapache64.composebird" +version = "1.0.0-alpha01" + +// Add maven repositories +repositories { + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") +} + +kotlin { + js(IR) { + browser() + binaries.executable() + } + sourceSets { + val jsMain by getting { + dependencies { + implementation(project(":web-core")) + implementation(compose.runtime) + } + } + } +} diff --git a/web/samples/web-compose-bird/cover.jpeg b/web/samples/web-compose-bird/cover.jpeg new file mode 100644 index 0000000000..7ad7efca86 Binary files /dev/null and b/web/samples/web-compose-bird/cover.jpeg differ diff --git a/web/samples/web-compose-bird/demo.gif b/web/samples/web-compose-bird/demo.gif new file mode 100644 index 0000000000..b826c3137b Binary files /dev/null and b/web/samples/web-compose-bird/demo.gif differ diff --git a/web/samples/web-compose-bird/gradle.properties b/web/samples/web-compose-bird/gradle.properties new file mode 100644 index 0000000000..39f0b7a404 --- /dev/null +++ b/web/samples/web-compose-bird/gradle.properties @@ -0,0 +1,2 @@ +kotlin.code.style=official +org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 diff --git a/web/samples/web-compose-bird/gradle/wrapper/gradle-wrapper.jar b/web/samples/web-compose-bird/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..e708b1c023 Binary files /dev/null and b/web/samples/web-compose-bird/gradle/wrapper/gradle-wrapper.jar differ diff --git a/web/samples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties b/web/samples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..da9702f9e7 --- /dev/null +++ b/web/samples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/web/samples/web-compose-bird/gradlew b/web/samples/web-compose-bird/gradlew new file mode 100755 index 0000000000..4f906e0c81 --- /dev/null +++ b/web/samples/web-compose-bird/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# 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 + ;; + 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" + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/web/samples/web-compose-bird/gradlew.bat b/web/samples/web-compose-bird/gradlew.bat new file mode 100644 index 0000000000..ac1b06f938 --- /dev/null +++ b/web/samples/web-compose-bird/gradlew.bat @@ -0,0 +1,89 @@ +@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 + +@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=. +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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/web/samples/web-compose-bird/settings.gradle.kts b/web/samples/web-compose-bird/settings.gradle.kts new file mode 100644 index 0000000000..ff0da4130a --- /dev/null +++ b/web/samples/web-compose-bird/settings.gradle.kts @@ -0,0 +1,8 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } +} +rootProject.name = "web-compose-bird" + diff --git a/web/samples/web-compose-bird/src/jsMain/kotlin/core/ComposeBirdGame.kt b/web/samples/web-compose-bird/src/jsMain/kotlin/core/ComposeBirdGame.kt new file mode 100644 index 0000000000..e445cb3909 --- /dev/null +++ b/web/samples/web-compose-bird/src/jsMain/kotlin/core/ComposeBirdGame.kt @@ -0,0 +1,157 @@ +package core + +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.State +import androidx.compose.runtime.mutableStateOf +import data.GameFrame +import data.Tube +import kotlin.js.Date + +/** + * Game logic + */ +class ComposeBirdGame : Game { + + companion object { + const val COLUMNS = 15 + const val ROWS = 9 + const val BIRD_COLUMN = 1 + private const val TUBES_START_FROM = (COLUMNS * 0.75).toInt() + const val TOTAL_TUBES = 10 + private const val TUBE_HORIZONTAL_DISTANCE = 3 + private const val TUBE_VERTICAL_DISTANCE = 3 + private const val TUBE_WEIGHT = 500 + private const val BIRD_WEIGHT = 300 + } + + private val tubeGapRange = TUBE_VERTICAL_DISTANCE until ROWS + private var tubeLastSteppedAt = 0.0 + private var birdLastSteppedAt = 0.0 + private var shouldMoveBirdUp = false + + private val _gameFrame: MutableState by lazy { + mutableStateOf( + // First frame + GameFrame( + birdPos = ROWS / 2, + tubes = buildLevel(), + isGameOver = false, + isGameWon = false, + score = 0 + ) + ) + } + + /** + * To build a random level + */ + private fun buildLevel(): List { + return mutableListOf().apply { + var tubesAdded = 0 + var tubePosition = 0 + while (tubesAdded < TOTAL_TUBES) { + if (tubePosition > TUBES_START_FROM && tubePosition % TUBE_HORIZONTAL_DISTANCE == 0) { // To give space to each tube + add( + Tube( + tubePosition, + buildRandomTube() + ) + ) + tubesAdded++ + } + tubePosition++ + } + } + } + + + /** + * To build a random vertical tube/pipe + */ + private fun buildRandomTube(): List { + // creating a full tube + val tube = mutableListOf().apply { + repeat(ROWS) { + add(true) + } + } + + // Adding gaps in random middle positions to make it two tubes. + val gap1 = tubeGapRange.random() + repeat(TUBE_VERTICAL_DISTANCE) { index -> + tube[gap1 - index] = false + } + + return tube + } + + override val gameFrame: State = _gameFrame + + override fun step() { + update { + val now = Date().getTime() + + // Stepping tube + val tubeDiff = now - tubeLastSteppedAt + val newTubes = if (tubeDiff > TUBE_WEIGHT) { + tubeLastSteppedAt = now + tubes.map { + it.copy(position = it.position - 1) + } + } else { + tubes + } + + // Stepping bird position + val birdDiff = now - birdLastSteppedAt + val newBirdPos = when { + shouldMoveBirdUp -> { + birdLastSteppedAt = now + shouldMoveBirdUp = false + birdPos - 1 // move up + } + birdDiff > BIRD_WEIGHT -> { + birdLastSteppedAt = now + birdPos + 1 // move down + } + else -> { + birdPos + } + } + + val newScore = newTubes.filter { it.position < BIRD_COLUMN }.size // All passed tube + val newIsGameWon = newScore >= TOTAL_TUBES // If all tubes passed + + // Checking if bird gone out + val newIsGameOver = if (newBirdPos < 0 || newBirdPos >= ROWS || isCollidedWithTube(newBirdPos, tubes)) { + true + } else { + isGameOver + } + + copy( + isGameOver = newIsGameOver, + tubes = newTubes, + birdPos = newBirdPos, + score = newScore, + isGameWon = newIsGameWon + ) + } + } + + /** + * To check if the bird collided with the tube (collision-detection) + */ + private fun isCollidedWithTube(newBirdPos: Int, tubes: List): Boolean { + val birdTube = tubes.find { it.position == BIRD_COLUMN } + return birdTube?.coordinates?.get(newBirdPos) ?: false + } + + override fun moveBirdUp() { + shouldMoveBirdUp = true + } + + private inline fun update(func: GameFrame.() -> GameFrame) { + _gameFrame.value = _gameFrame.value.func() + } +} \ No newline at end of file diff --git a/web/samples/web-compose-bird/src/jsMain/kotlin/core/Game.kt b/web/samples/web-compose-bird/src/jsMain/kotlin/core/Game.kt new file mode 100644 index 0000000000..35e593e903 --- /dev/null +++ b/web/samples/web-compose-bird/src/jsMain/kotlin/core/Game.kt @@ -0,0 +1,13 @@ +package core + +import androidx.compose.runtime.State +import data.GameFrame + +/** + * A generic game interface + */ +interface Game { + val gameFrame: State + fun step() + fun moveBirdUp() +} \ No newline at end of file diff --git a/web/samples/web-compose-bird/src/jsMain/kotlin/data/GameFrame.kt b/web/samples/web-compose-bird/src/jsMain/kotlin/data/GameFrame.kt new file mode 100644 index 0000000000..8c97018abb --- /dev/null +++ b/web/samples/web-compose-bird/src/jsMain/kotlin/data/GameFrame.kt @@ -0,0 +1,9 @@ +package data + +data class GameFrame( + val birdPos: Int, + val tubes: List, + val isGameOver: Boolean, + val isGameWon : Boolean, + val score: Int, +) diff --git a/web/samples/web-compose-bird/src/jsMain/kotlin/data/Tube.kt b/web/samples/web-compose-bird/src/jsMain/kotlin/data/Tube.kt new file mode 100644 index 0000000000..eecf793662 --- /dev/null +++ b/web/samples/web-compose-bird/src/jsMain/kotlin/data/Tube.kt @@ -0,0 +1,6 @@ +package data + +data class Tube( + var position: Int, + val coordinates: List +) diff --git a/web/samples/web-compose-bird/src/jsMain/kotlin/main.kt b/web/samples/web-compose-bird/src/jsMain/kotlin/main.kt new file mode 100644 index 0000000000..5525fc84c5 --- /dev/null +++ b/web/samples/web-compose-bird/src/jsMain/kotlin/main.kt @@ -0,0 +1,140 @@ +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import core.ComposeBirdGame +import core.Game +import data.GameFrame +import kotlinx.browser.document +import kotlinx.browser.window +import kotlinx.coroutines.delay +import org.jetbrains.compose.web.attributes.InputType +import org.jetbrains.compose.web.attributes.checked +import org.jetbrains.compose.web.attributes.disabled +import org.jetbrains.compose.web.css.marginTop +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.dom.* +import org.jetbrains.compose.web.renderComposable +import org.w3c.dom.HTMLElement +import org.w3c.dom.events.KeyboardEvent +import org.w3c.dom.get + + +fun main() { + + val game: Game = ComposeBirdGame() + + val body = document.getElementsByTagName("body")[0] as HTMLElement + + // Enabling keyboard control + body.addEventListener("keyup", { + when ((it as KeyboardEvent).keyCode) { + 38 -> { // Arrow up + game.moveBirdUp() + } + } + }) + + renderComposable(rootElementId = "root") { + + Div( + attrs = { + style { + property("text-align", "center") + } + } + ) { + + // The current frame! + val gameFrame by game.gameFrame + + // Igniting the game loop + LaunchedEffect(Unit) { + while (!gameFrame.isGameOver) { + delay(60) + game.step() + } + } + + Header(gameFrame) + + Div( + attrs = { + style { + marginTop(30.px) + } + } + ) { + if (gameFrame.isGameOver || gameFrame.isGameWon) { + GameResult(gameFrame) + } else { + // Play area + repeat(ComposeBirdGame.ROWS) { rowIndex -> + Div { + repeat(ComposeBirdGame.COLUMNS) { columnIndex -> + Input( + InputType.Radio, + + attrs = { + val tube = gameFrame.tubes.find { it.position == columnIndex } + val isTube = tube?.coordinates?.get(rowIndex) ?: false + val isBird = + !isTube && columnIndex == ComposeBirdGame.BIRD_COLUMN && rowIndex == gameFrame.birdPos + + if (isTube || isBird) { + // if it's either a tube node or bird, check it + checked() + } + + if (!isBird) { + // if it's a bird, enable it. (to change to blue color) + disabled() + } + + + } + ) + } + } + } + } + } + + } + + } +} + +@Composable +private fun Header(gameFrame: GameFrame) { + // Game title + H1 { + Text(value = "🐦 Compose Bird!") + } + + // Game score + Text(value = "Your Score: ${gameFrame.score} || Top Score: ${ComposeBirdGame.TOTAL_TUBES}") +} + +@Composable +private fun GameResult(gameFrame: GameFrame) { + // Game Status + H2 { + if (gameFrame.isGameWon) { + Text("🚀 Won the game! 🚀") + } else { + // core.Game over + Text("💀 Game Over 💀") + } + } + + // Try Again + Button( + attrs = { + onClick { + window.location.reload() + } + } + ) { + Text("Try Again!") + } +} \ No newline at end of file diff --git a/web/samples/web-compose-bird/src/jsMain/resources/index.html b/web/samples/web-compose-bird/src/jsMain/resources/index.html new file mode 100644 index 0000000000..c237d9bbd2 --- /dev/null +++ b/web/samples/web-compose-bird/src/jsMain/resources/index.html @@ -0,0 +1,17 @@ + + + + + compose-bird + + + +
+ + + diff --git a/web/samples/web-getting-started/.gitignore b/web/samples/web-getting-started/.gitignore new file mode 100644 index 0000000000..8ea68f1b7d --- /dev/null +++ b/web/samples/web-getting-started/.gitignore @@ -0,0 +1,3 @@ +/.gradle/ +/.idea/ +/build/ diff --git a/web/samples/web-getting-started/README.md b/web/samples/web-getting-started/README.md new file mode 100644 index 0000000000..c9f47d93bc --- /dev/null +++ b/web/samples/web-getting-started/README.md @@ -0,0 +1,4 @@ +### Running web application +``` +./gradlew jsBrowserRun +``` \ No newline at end of file diff --git a/web/samples/web-getting-started/build.gradle.kts b/web/samples/web-getting-started/build.gradle.kts new file mode 100644 index 0000000000..73e9357898 --- /dev/null +++ b/web/samples/web-getting-started/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + kotlin("multiplatform") version "1.5.21" + id("org.jetbrains.compose") +} + +repositories { + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") +} + +kotlin { + js(IR) { + browser() + binaries.executable() + } + sourceSets { + val jsMain by getting { + dependencies { + implementation(project(":web-core")) + implementation(compose.runtime) + } + } + } +} diff --git a/web/samples/web-getting-started/gradle.properties b/web/samples/web-getting-started/gradle.properties new file mode 100644 index 0000000000..29e08e8ca8 --- /dev/null +++ b/web/samples/web-getting-started/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official \ No newline at end of file diff --git a/web/samples/web-getting-started/gradle/wrapper/gradle-wrapper.jar b/web/samples/web-getting-started/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..e708b1c023 Binary files /dev/null and b/web/samples/web-getting-started/gradle/wrapper/gradle-wrapper.jar differ diff --git a/web/samples/web-getting-started/gradle/wrapper/gradle-wrapper.properties b/web/samples/web-getting-started/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..29e4134576 --- /dev/null +++ b/web/samples/web-getting-started/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/web/samples/web-getting-started/gradlew b/web/samples/web-getting-started/gradlew new file mode 100755 index 0000000000..4f906e0c81 --- /dev/null +++ b/web/samples/web-getting-started/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# 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 + ;; + 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" + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/web/samples/web-getting-started/gradlew.bat b/web/samples/web-getting-started/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/web/samples/web-getting-started/gradlew.bat @@ -0,0 +1,89 @@ +@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 + +@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=. +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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/web/samples/web-getting-started/settings.gradle.kts b/web/samples/web-getting-started/settings.gradle.kts new file mode 100644 index 0000000000..7072e1fd1a --- /dev/null +++ b/web/samples/web-getting-started/settings.gradle.kts @@ -0,0 +1,9 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } +} + +rootProject.name = "web-getting-started" + diff --git a/web/samples/web-getting-started/src/jsMain/kotlin/Main.kt b/web/samples/web-getting-started/src/jsMain/kotlin/Main.kt new file mode 100644 index 0000000000..95d7be667c --- /dev/null +++ b/web/samples/web-getting-started/src/jsMain/kotlin/Main.kt @@ -0,0 +1,34 @@ +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.getValue +import androidx.compose.runtime.setValue +import org.jetbrains.compose.web.css.padding +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.dom.Button +import org.jetbrains.compose.web.dom.Div +import org.jetbrains.compose.web.dom.Span +import org.jetbrains.compose.web.dom.Text +import org.jetbrains.compose.web.renderComposable + +fun main() { + var count: Int by mutableStateOf(0) + + renderComposable(rootElementId = "root") { + Div({ style { padding(25.px) } }) { + Button(attrs = { + onClick { count -= 1 } + }) { + Text("-") + } + + Span({style { padding(15.px) }}) { + Text("$count") + } + + Button({ + onClick { count += 1 } + }) { + Text("+") + } + } + } +} \ No newline at end of file diff --git a/web/samples/web-getting-started/src/jsMain/resources/index.html b/web/samples/web-getting-started/src/jsMain/resources/index.html new file mode 100644 index 0000000000..60e237b3aa --- /dev/null +++ b/web/samples/web-getting-started/src/jsMain/resources/index.html @@ -0,0 +1,11 @@ + + + + + Getting Started + + +
+ + + \ No newline at end of file diff --git a/web/samples/web-with-react/.gitignore b/web/samples/web-with-react/.gitignore new file mode 100644 index 0000000000..8ea68f1b7d --- /dev/null +++ b/web/samples/web-with-react/.gitignore @@ -0,0 +1,3 @@ +/.gradle/ +/.idea/ +/build/ diff --git a/web/samples/web-with-react/README.md b/web/samples/web-with-react/README.md new file mode 100644 index 0000000000..c5fc03c24e --- /dev/null +++ b/web/samples/web-with-react/README.md @@ -0,0 +1,24 @@ +### Use Compose(web) in React app + +[see ComposeInReactApp.kt](src/jsMain/kotlin/ComposeInReactApp.kt) + +`useCompose(...)` is a custom React effect to render a content using Compose. +It's not a part of any library. + +### Use React in Compose(web) app + +`UseReactEffect(...)` is a custom Compose effect to render a content using React. +It's not a part of any library. + +[see ReactInComposeApp.kt](src/jsMain/kotlin/ReactInComposeApp.kt) + +### How to use existing React components: + +It requires adding `external` declarations. For example: [ReactYoutubePlayer.kt](src/jsMain/kotlin/ReactYoutubePlayer.kt) + +Here is a good tutorial - [Using packages from NPM](https://play.kotlinlang.org/hands-on/Building%20Web%20Applications%20with%20React%20and%20Kotlin%20JS/07_Using_Packages_From_NPM) + +### Running web application +``` +./gradlew jsBrowserRun +``` \ No newline at end of file diff --git a/web/samples/web-with-react/build.gradle.kts b/web/samples/web-with-react/build.gradle.kts new file mode 100644 index 0000000000..cbda7bcc04 --- /dev/null +++ b/web/samples/web-with-react/build.gradle.kts @@ -0,0 +1,31 @@ +plugins { + kotlin("multiplatform") version "1.5.21" + id("org.jetbrains.compose") +} + +repositories { + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-js-wrappers") +} + +kotlin { + js(IR) { + browser() + binaries.executable() + } + sourceSets { + val jsMain by getting { + dependencies { + implementation(project(":web-core")) + implementation(compose.runtime) + implementation("org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.201-kotlin-1.5.0") + implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.201-kotlin-1.5.0") + implementation("org.jetbrains.kotlin-wrappers:kotlin-styled:5.3.0-pre.201-kotlin-1.5.0") + implementation(npm("react", "17.0.2")) + implementation(npm("react-dom", "17.0.2")) + implementation(npm("react-youtube-lite", "1.0.1")) + } + } + } +} diff --git a/web/samples/web-with-react/gradle.properties b/web/samples/web-with-react/gradle.properties new file mode 100644 index 0000000000..29e08e8ca8 --- /dev/null +++ b/web/samples/web-with-react/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official \ No newline at end of file diff --git a/web/samples/web-with-react/gradle/wrapper/gradle-wrapper.jar b/web/samples/web-with-react/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..e708b1c023 Binary files /dev/null and b/web/samples/web-with-react/gradle/wrapper/gradle-wrapper.jar differ diff --git a/web/samples/web-with-react/gradle/wrapper/gradle-wrapper.properties b/web/samples/web-with-react/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..29e4134576 --- /dev/null +++ b/web/samples/web-with-react/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/web/samples/web-with-react/gradlew b/web/samples/web-with-react/gradlew new file mode 100755 index 0000000000..4f906e0c81 --- /dev/null +++ b/web/samples/web-with-react/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# 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 + ;; + 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" + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/web/samples/web-with-react/gradlew.bat b/web/samples/web-with-react/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/web/samples/web-with-react/gradlew.bat @@ -0,0 +1,89 @@ +@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 + +@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=. +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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/web/samples/web-with-react/settings.gradle.kts b/web/samples/web-with-react/settings.gradle.kts new file mode 100644 index 0000000000..bbdf9586ce --- /dev/null +++ b/web/samples/web-with-react/settings.gradle.kts @@ -0,0 +1,9 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } +} + +rootProject.name = "web-with-react" + diff --git a/web/samples/web-with-react/src/jsMain/kotlin/ComposeInReactApp.kt b/web/samples/web-with-react/src/jsMain/kotlin/ComposeInReactApp.kt new file mode 100644 index 0000000000..d3e041c6df --- /dev/null +++ b/web/samples/web-with-react/src/jsMain/kotlin/ComposeInReactApp.kt @@ -0,0 +1,149 @@ +import androidx.compose.runtime.Composable +import androidx.compose.runtime.State +import androidx.compose.runtime.mutableStateOf +import org.jetbrains.compose.web.dom.Div +import org.jetbrains.compose.web.dom.Text +import org.jetbrains.compose.web.renderComposable +import kotlinx.browser.document +import kotlinx.browser.window +import kotlinx.css.* +import kotlinx.html.InputType +import kotlinx.html.js.onClickFunction +import kotlinx.html.js.onInputFunction +import org.w3c.dom.HTMLElement +import react.* +import react.dom.* +import styled.css +import styled.styledDiv + +@Composable +private fun ComposableComponentToUseInReact(count: State) { + repeat(count.value) { + Div { + Text("Item $it") + } + } +} + +/** + * @param containerRef - [RMutableRef] - reference to the HTMLElement that is used as a root for Composition + * @param stateInitialValue - initial state value for the Composition + * @param stateValueProvider - a lambda that's used to change the state's value + * @param composable - the content controlled by Compose and mounted in a root provided by [containerRef] + */ +private fun useCompose( + containerRef: RMutableRef, + stateInitialValue: T, + stateValueProvider: () -> T, + composable: @Composable (state: State) -> Unit +) { + val mutableState = useRef(mutableStateOf(stateInitialValue)) + + useEffect { + mutableState.current?.value = stateValueProvider() + } + + useLayoutEffectWithCleanup(dependencies = emptyList()) { + val composition = renderComposable(containerRef.current!!) { + composable(mutableState.current!!) + } + return@useLayoutEffectWithCleanup { + composition.dispose() + } + } +} + +private external interface ListProps : RProps { + var countOfItems: Int +} + +private val composeListComponentWrapper = functionalComponent { props -> + val containerRef = useRef(null) + + useCompose( + containerRef = containerRef, + stateInitialValue = 0, + stateValueProvider = { props.countOfItems } + ) { + ComposableComponentToUseInReact(it) + } + + // This div will be a root for the Composition managed by Compose + div { ref { containerRef.current = it } } +} + +private val column = functionalComponent { + val (counter, setCounter) = useState(0) + + styledDiv { + css { + padding = "25px" + } + + h3 { + +"Update items count using slider:" + } + + input(type = InputType.range) { + attrs { + onInputFunction = { + setCounter(it.target?.asDynamic().value.toString().toInt()) + } + value = "$counter" + } + } + + h3 { + +"Compose controlled items:" + } + + child(composeListComponentWrapper) { + this.attrs { + countOfItems = counter + } + } + } +} + +private val appContent = functionalComponent { + val (columnsCount, setColumnsCount) = useState(3) + + a(href = "${window.location.origin}?app=composeApp") { + +"GO TO REACT IN COMPOSE EXAMPLE" + } + + button { + attrs { + onClickFunction = { + setColumnsCount(columnsCount - 1) + } + } + +"Remove column" + } + + button { + attrs { + onClickFunction = { + setColumnsCount(columnsCount + 1) + } + } + +"Add column" + } + + styledDiv { + css { + display = Display.flex + flexDirection = FlexDirection.row + } + + repeat(columnsCount) { + child(column) + } + } +} + +fun composeInReactAppExample() { + render(document.getElementById("root")) { + child(appContent) + } +} \ No newline at end of file diff --git a/web/samples/web-with-react/src/jsMain/kotlin/Main.kt b/web/samples/web-with-react/src/jsMain/kotlin/Main.kt new file mode 100644 index 0000000000..f046acb54f --- /dev/null +++ b/web/samples/web-with-react/src/jsMain/kotlin/Main.kt @@ -0,0 +1,14 @@ +import kotlinx.browser.window +import org.w3c.dom.url.URLSearchParams + +fun main() { + + val urlParams = URLSearchParams(window.location.search) + + val app = urlParams.get("app") ?: "composeApp" + + when (app) { + "composeApp" -> reactInComposeAppExample() + "reactApp" -> composeInReactAppExample() + } +} \ No newline at end of file diff --git a/web/samples/web-with-react/src/jsMain/kotlin/ReactInComposeApp.kt b/web/samples/web-with-react/src/jsMain/kotlin/ReactInComposeApp.kt new file mode 100644 index 0000000000..f1d462b0e6 --- /dev/null +++ b/web/samples/web-with-react/src/jsMain/kotlin/ReactInComposeApp.kt @@ -0,0 +1,94 @@ +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import org.jetbrains.compose.web.css.margin +import org.jetbrains.compose.web.css.percent +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.css.width +import org.jetbrains.compose.web.dom.* +import org.jetbrains.compose.web.renderComposable +import kotlinx.browser.window +import org.w3c.dom.HTMLElement +import react.RBuilder +import react.dom.render +import react.dom.unmountComponentAtNode + +/** + * @param key - when UseReactEffect is invoked with a new [key], compose forces react to render with a new content. + * @param content - the builder for the content managed by React + */ +@Composable +private fun ElementScope.UseReactEffect( + key: Any?, + content: RBuilder.() -> Unit +) { + DomSideEffect(key = key) { htmlElement -> + render(htmlElement) { + content() + } + } + + DisposableRefEffect { htmlElement -> + onDispose { + unmountComponentAtNode(htmlElement) + } + } +} + +@Composable +fun YoutubeReactPlayerWrapper(videoUrl: String) { + if (videoUrl.isEmpty()) return + Div({ + style { + width(50.percent) + } + }) { + UseReactEffect(key = videoUrl) { + reactPlayer { + attrs.url = videoUrl + } + } + } +} + +private val videos = listOf( + "https://www.youtube.com/watch?v=UryyHq45Y_8", + "https://www.youtube.com/watch?v=698I_AH8h6s", + "https://www.youtube.com/watch?v=F8jj7e-_jFA" +) + +fun reactInComposeAppExample() { + var videoUrl by mutableStateOf("") + + renderComposable(rootElementId = "root") { + + A(href = "${window.location.origin}?app=reactApp") { Text("GO TO COMPOSE IN REACT EXAMPLE") } + + Div { + videos.forEachIndexed { ix, url -> + Button( + attrs = { + onClick { videoUrl = url } + style { + margin(10.px) + } + } + ) { Text("Video ${ix + 1}") } + } + + Button( + attrs = { + onClick { + videoUrl = "" + style { + margin(10.px) + } + } + }, + ) { Text("Reset") } + + YoutubeReactPlayerWrapper(videoUrl) + } + } +} \ No newline at end of file diff --git a/web/samples/web-with-react/src/jsMain/kotlin/ReactYoutubePlayer.kt b/web/samples/web-with-react/src/jsMain/kotlin/ReactYoutubePlayer.kt new file mode 100644 index 0000000000..6b42517ea4 --- /dev/null +++ b/web/samples/web-with-react/src/jsMain/kotlin/ReactYoutubePlayer.kt @@ -0,0 +1,11 @@ +@file:JsModule("react-youtube-lite") +@file:JsNonModule + +import react.* + +@JsName("ReactYouTubeLite") +external val reactPlayer: RClass + +external interface ReactYouTubeProps : RProps { + var url: String +} diff --git a/web/samples/web-with-react/src/jsMain/resources/index.html b/web/samples/web-with-react/src/jsMain/resources/index.html new file mode 100644 index 0000000000..c078599ac9 --- /dev/null +++ b/web/samples/web-with-react/src/jsMain/resources/index.html @@ -0,0 +1,11 @@ + + + + + Compose for Web: with react component + + +
+ + + \ No newline at end of file diff --git a/web/samples/web_landing/.gitignore b/web/samples/web_landing/.gitignore new file mode 100644 index 0000000000..a32b16597b --- /dev/null +++ b/web/samples/web_landing/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +build/ +/captures +.externalNativeBuild +.cxx diff --git a/web/samples/web_landing/build.gradle.kts b/web/samples/web_landing/build.gradle.kts new file mode 100644 index 0000000000..0ee47d2db8 --- /dev/null +++ b/web/samples/web_landing/build.gradle.kts @@ -0,0 +1,26 @@ +plugins { + kotlin("multiplatform") version "1.5.21" + id("org.jetbrains.compose") +} + +repositories { + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") +} + +kotlin { + js(IR) { + browser() + binaries.executable() + } + + sourceSets { + val jsMain by getting { + dependencies { + implementation(npm("highlight.js", "10.7.2")) + implementation(project(":web-core")) + implementation(compose.runtime) + } + } + } +} diff --git a/web/samples/web_landing/gradle.properties b/web/samples/web_landing/gradle.properties new file mode 100644 index 0000000000..29e08e8ca8 --- /dev/null +++ b/web/samples/web_landing/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official \ No newline at end of file diff --git a/web/samples/web_landing/gradle/wrapper/gradle-wrapper.jar b/web/samples/web_landing/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..e708b1c023 Binary files /dev/null and b/web/samples/web_landing/gradle/wrapper/gradle-wrapper.jar differ diff --git a/web/samples/web_landing/gradle/wrapper/gradle-wrapper.properties b/web/samples/web_landing/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..29e4134576 --- /dev/null +++ b/web/samples/web_landing/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/web/samples/web_landing/gradlew b/web/samples/web_landing/gradlew new file mode 100755 index 0000000000..4f906e0c81 --- /dev/null +++ b/web/samples/web_landing/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# 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 + ;; + 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" + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/web/samples/web_landing/gradlew.bat b/web/samples/web_landing/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/web/samples/web_landing/gradlew.bat @@ -0,0 +1,89 @@ +@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 + +@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=. +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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/web/samples/web_landing/license/LICENSE.txt b/web/samples/web_landing/license/LICENSE.txt new file mode 100644 index 0000000000..9c8f3ea087 --- /dev/null +++ b/web/samples/web_landing/license/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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 + + http://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. \ No newline at end of file diff --git a/web/samples/web_landing/license/third_party/README.md b/web/samples/web_landing/license/third_party/README.md new file mode 100644 index 0000000000..84ee18f00f --- /dev/null +++ b/web/samples/web_landing/license/third_party/README.md @@ -0,0 +1,5 @@ +Following third-party dependencies exist in web_landing: + +* highlight.js@10.7.2: + * BSD 3-Clause License: [highlight.js](highlightjs.txt) + * https://github.com/highlightjs/highlight.js/blob/main/LICENSE \ No newline at end of file diff --git a/web/samples/web_landing/license/third_party/highlightjs.txt b/web/samples/web_landing/license/third_party/highlightjs.txt new file mode 100644 index 0000000000..02fa51c520 --- /dev/null +++ b/web/samples/web_landing/license/third_party/highlightjs.txt @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2006, Ivan Sagalaev. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/web/samples/web_landing/settings.gradle.kts b/web/samples/web_landing/settings.gradle.kts new file mode 100644 index 0000000000..8e6877f344 --- /dev/null +++ b/web/samples/web_landing/settings.gradle.kts @@ -0,0 +1,10 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") } + } + +} +rootProject.name = "compose-web-lp" + diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/HighlightJs.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/HighlightJs.kt new file mode 100644 index 0000000000..4331267b0f --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/HighlightJs.kt @@ -0,0 +1,12 @@ +package com.sample + +import org.w3c.dom.HTMLElement + +@JsName("hljs") +@JsModule("highlight.js") +@JsNonModule +external class HighlightJs { + companion object { + fun highlightElement(block: HTMLElement) + } +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/Main.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/Main.kt new file mode 100644 index 0000000000..b7e50a37f8 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/Main.kt @@ -0,0 +1,27 @@ +package com.sample + +import org.jetbrains.compose.web.css.Style +import org.jetbrains.compose.web.renderComposable +import com.sample.components.* +import com.sample.content.* +import com.sample.style.AppStylesheet +import org.w3c.dom.HTMLElement + + +fun main() { + renderComposable(rootElementId = "root") { + Style(AppStylesheet) + + Layout { + Header() + MainContentLayout { + Intro() + ComposeWebLibraries() + GetStarted() + CodeSamples() + JoinUs() + } + PageFooter() + } + } +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/components/Card.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/components/Card.kt new file mode 100644 index 0000000000..987cd379c9 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/components/Card.kt @@ -0,0 +1,80 @@ +package com.sample.components + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.attributes.ATarget +import org.jetbrains.compose.web.attributes.target +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.* +import com.sample.style.* + + +data class LinkOnCard(val linkText: String, val linkUrl: String) + +@Composable +private fun CardTitle(title: String, darkTheme: Boolean = false) { + H3({ + classes(WtTexts.wtH3) + if (darkTheme) { + classes(WtTexts.wtH3ThemeDark) + } + }) { + Text(title) + } +} + +@Composable +private fun CardLink(link: LinkOnCard) { + A( + attrs = { + classes(WtTexts.wtLink, WtOffsets.wtTopOffset24) + target(ATarget.Blank) + }, + href = link.linkUrl + ) { + Text(link.linkText) + } +} + +@Composable +fun Card( + title: String, + links: List, + darkTheme: Boolean = false, + wtExtraStyleClasses: List = listOf(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12), + content: @Composable () -> Unit +) { + Div({ + classes(WtCards.wtCard, WtOffsets.wtTopOffset24, *wtExtraStyleClasses.toTypedArray()) + classes(if (darkTheme) WtCards.wtCardThemeDark else WtCards.wtCardThemeLight) + }) { + Div({ + classes(WtCards.wtCardSection, WtCards.wtVerticalFlex) + }) { + + Div({ classes(WtCards.wtVerticalFlexGrow) }) { + CardTitle(title = title, darkTheme = darkTheme) + content() + } + + links.forEach { + CardLink(it) + } + } + } +} + +@Composable +fun CardDark( + title: String, + links: List, + wtExtraStyleClasses: List = listOf(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12), + content: @Composable () -> Unit +) { + Card( + title = title, + links = links, + darkTheme = true, + wtExtraStyleClasses = wtExtraStyleClasses, + content = content + ) +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/components/Layout.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/components/Layout.kt new file mode 100644 index 0000000000..de4887da04 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/components/Layout.kt @@ -0,0 +1,54 @@ +package com.sample.components + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.Div +import org.jetbrains.compose.web.dom.Main +import org.jetbrains.compose.web.dom.Section +import com.sample.style.WtContainer +import com.sample.style.WtOffsets +import com.sample.style.WtSections + +@Composable +fun Layout(content: @Composable () -> Unit) { + Div({ + style { + display(DisplayStyle.Flex) + flexDirection(FlexDirection.Column) + height(100.percent) + margin(0.px) + property("box-sizing", "border-box") + } + }) { + content() + } +} + +@Composable +fun MainContentLayout(content: @Composable () -> Unit) { + Main({ + style { + property("flex", "1 0 auto") + property("box-sizing", "border-box") + } + }) { + content() + } +} + +@Composable +fun ContainerInSection(sectionThemeStyleClass: String? = null, content: @Composable () -> Unit) { + Section({ + if (sectionThemeStyleClass != null) { + classes(WtSections.wtSection, sectionThemeStyleClass) + } else { + classes(WtSections.wtSection) + } + }) { + Div({ + classes(WtContainer.wtContainer, WtOffsets.wtTopOffset96) + }) { + content() + } + } +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt new file mode 100644 index 0000000000..cc5d810eb0 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/AboutComposeWebLibsSection.kt @@ -0,0 +1,96 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.css.value +import org.jetbrains.compose.web.dom.* +import com.sample.components.Card +import com.sample.components.ContainerInSection +import com.sample.components.LinkOnCard +import com.sample.style.* + +data class CardWithListPresentation( + val title: String, + val list: List, + val links: List = emptyList() +) + +private fun createAboutComposeWebCards(): List { + return listOf( + CardWithListPresentation( + title = "Composable DOM API", + list = listOf( + "Express your design and layout in terms of DOM elements and HTML tags", + "Use a type-safe HTML DSL to build your UI representation", + "Get full control over the look and feel of your application by creating stylesheets with a typesafe CSS DSL", + "Integrate with other JavaScript libraries via DOM subtrees" + ) + ), + CardWithListPresentation( + title = "Multiplatform Widgets With Web Support", + list = listOf( + "Use and build Compose widgets that work on Android, Desktop, and Web by utilizing Kotlin's expect-actual mechanisms to provide platform-specific implementations", + "Experiment with a set of layout primitives and APIs that mimic the features you already know from Compose for Desktop and Android" + ) + ) + ) +} + +@Composable +fun ComposeWebLibraries() { + ContainerInSection(WtSections.wtSectionBgGrayLight) { + H2(attrs = { classes(WtTexts.wtH2) }) { + Text("Building user interfaces with Compose for Web") + } + + Div(attrs = { + classes(WtRows.wtRow, WtRows.wtRowSizeM) + }) { + Div(attrs = { + classes(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12, WtOffsets.wtTopOffset24) + }) { + P(attrs = { + classes(WtTexts.wtText1) + }) { + Text("Compose for Web allows you to build reactive user interfaces for the web in Kotlin, using the concepts and APIs of Jetpack Compose to express the state, behavior, and logic of your application.") + } + } + + Div(attrs = { + classes(WtCols.wtCol6, WtCols.wtColMd6, WtCols.wtColSm12, WtOffsets.wtTopOffset24) + }) { + P(attrs = { + classes(WtTexts.wtText1) + }) { + Text("Compose for Web provides multiple ways of declaring user interfaces in Kotlin code, allowing you to have full control over your website layout with a declarative DOM API, or use versions of the widgets you already know from Jetpack Compose for Desktop and Android.\n") + } + } + } + + Div(attrs = { + classes(WtRows.wtRow, WtRows.wtRowSizeM, WtOffsets.wtTopOffset48) + }) { + createAboutComposeWebCards().forEach { CardWithList(it) } + } + } +} + +@Composable +private fun CardWithList(card: CardWithListPresentation) { + Card( + title = card.title, + links = card.links + ) { + Ul(attrs = { + classes(WtTexts.wtText2) + }) { + card.list.forEachIndexed { _, it -> + Li({ + style { + property("padding-top", 24.px) + } + }) { Text(it) } + } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSamplesSwitcher.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSamplesSwitcher.kt new file mode 100644 index 0000000000..89d907dd27 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSamplesSwitcher.kt @@ -0,0 +1,90 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.attributes.InputType +import org.jetbrains.compose.web.attributes.checked +import org.jetbrains.compose.web.attributes.name +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.css.selectors.CSSSelector +import org.jetbrains.compose.web.css.selectors.descendant +import org.jetbrains.compose.web.css.selectors.selector +import org.jetbrains.compose.web.dom.Form +import org.jetbrains.compose.web.dom.Input +import org.jetbrains.compose.web.dom.Label +import org.jetbrains.compose.web.dom.Text +import com.sample.style.AppStylesheet +import org.jetbrains.compose.web.attributes.value + +private object SwitcherVariables { + val labelWidth by variable() + val labelPadding by variable() +} + +object SwitcherStylesheet : StyleSheet(AppStylesheet) { + val boxed by style { + + media(mediaMaxWidth(640.px)) { + self style { + SwitcherVariables.labelWidth(48.px) + SwitcherVariables.labelPadding(5.px) + } + } + + descendant(self, CSSSelector.Type("label")) style { + display(DisplayStyle.InlineBlock) + property("width", SwitcherVariables.labelWidth.value(56.px)) + property("padding", SwitcherVariables.labelPadding.value(10.px)) + property("transition", "all 0.3s") + property("text-align", "center") + property("box-sizing", "border-box") + + border { + style(LineStyle.Solid) + width(3.px) + color(Color("transparent")) + borderRadius(20.px, 20.px, 20.px) + } + color(Color("#aaa")) + } + + border { + style(LineStyle.Solid) + width(1.px) + color(Color("#aaa")) + padding(0.px) + borderRadius(22.px, 22.px, 22.px) + } + + descendant(self, selector("input[type=\"radio\"]")) style { + display(DisplayStyle.None) + } + + descendant(self, selector("input[type=\"radio\"]:checked + label")) style { + border { + style(LineStyle.Solid) + width(3.px) + color(Color("#167dff")) + borderRadius(20.px, 20.px, 20.px) + } + color(Color("#000")) + } + } +} + +@Composable +fun CodeSampleSwitcher(count: Int, current: Int, onSelect: (Int) -> Unit) { + Form(attrs = { + classes(SwitcherStylesheet.boxed) + }) { + repeat(count) { ix -> + Input(type = InputType.Radio, attrs = { + name("code-snippet") + value("snippet$ix") + id("snippet$ix") + if (current == ix) checked() + onChange { onSelect(ix) } + }) + Label(forId = "snippet$ix") { Text("${ix + 1}") } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt new file mode 100644 index 0000000000..35111abca0 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/CodeSnippets.kt @@ -0,0 +1,276 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.setValue +import androidx.compose.runtime.mutableStateOf +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.* +import com.sample.HighlightJs +import com.sample.components.ContainerInSection +import com.sample.style.* +import org.jetbrains.compose.web.css.keywords.auto +import org.w3c.dom.HTMLElement + +private fun HTMLElement.setHighlightedCode(code: String) { + innerText = code + HighlightJs.highlightElement(this) +} + +private val SimpleCounterSnippet = CodeSnippetData( + title = "Simple Counter using Composable DOM", + source = """ + fun main() { + val count = mutableStateOf(0) + + renderComposable(rootElementId = "root") { + Button(attrs = { + onClick { count.value = count.value - 1 } + }) { + Text("-") + } + Span(attrs = { style { padding(15.px) }}) { /* we use inline style here */ + Text("${"$"}{count.value}") + } + Button(attrs = { + onClick { count.value = count.value + 1 } + }) { + Text("+") + } + } + } + """.trimIndent() +) + +private val DeclareAndUseStylesheet = CodeSnippetData( + title = "Declare and use a stylesheet", + source = """ + object MyStyleSheet : StyleSheet() { + val container by style { /* define a class `container` */ + border(1.px, LineStyle.Solid, Color.RGB(255, 0, 0)) + } + } + + @Composable + fun MyComponent() { + Div(attrs = { + classes(MyStyleSheet.container) /* use `container` class */ + }) { + Text("Hello world!") + } + } + + fun main() { + renderComposable(rootElementId = "root") { + Style(MyStyleSheet) /* mount the stylesheet */ + MyComponent() + } + } + """.trimIndent() +) + +private val DeclareAndUseCssVariable = CodeSnippetData( + title = "Declare and use CSS variables", + source = """ + object MyVariables : CSSVariables { + val contentBackgroundColor by variable() /* declare a variable */ + } + + object MyStyleSheet: StyleSheet() { + val container by style { + MyVariables.contentBackgroundColor(Color("blue")) /* set its value */ + } + val content by style { + backgroundColor(MyVariables.contentBackgroundColor.value()) /* use it */ + } + } + + @Composable + fun MyComponent() { + Div(attrs = { + classes(MyStyleSheet.container) + }) { + Span(attrs = { + classes(MyStyleSheet.content) + }) { + Text("Hello world!") + } + } + } + """.trimIndent() +) + +private val HoverSelectorAndMedia = CodeSnippetData( + title = "Hover selector and media query examples", + source = """ + object MyStyleSheet: StyleSheet() { + val container by style { + + backgroundColor(Color("blue")) + + padding(20.px) + + hover(self) style { /* `self` is a reference to the class */ + backgroundColor(Color("red")) + } + + media(maxWidth(500.px)) { + self style { + padding(10.px) + } + } + } + } + """.trimIndent() +) + +private val DefineCssClassInComponent = CodeSnippetData( + title = "Define a CSS class in a component", + source = """ + object MyStyleSheet: StyleSheet() {} + + @Composable + fun MyComponent() { + Div(attrs = { + /* the class name will be generated at runtime */ + classes(MyStyleSheet.css { + + backgroundColor(Color("blue")) + + self + ":hover" style { /* this is an example of a raw selector */ + backgroundColor(Color("red")) + } + }) + }) { + Text("Hello world!") + } + } + """.trimIndent() +) + +private val LayoutsSample = CodeSnippetData( + title = "Counter for Web and Desktop", + source = """ + /* Shared code in commonMain - App.kt (No direct control over DOM or CSS here) */ + + private val counter = mutableStateOf(0) + + @Composable + fun App() { + Row { + Button(onClick = { counter.value = counter.value - 1 }) { + Text("-") + } + + Text("${"$"}{counter.value}", modifier = Modifier.padding(16.dp)) + + Button(onClick = { counter.value = counter.value + 1 }) { + Text("+") + } + } + } + + /* Desktop specific code in desktopMain: */ + + fun main() = Window(title = "Demo", size = IntSize(800, 800)) { + App() + } + + /* Web specific code in jsMain: */ + + fun main() = renderComposable(rootElementId = "root") { + App() + } + """.trimIndent() +) + +private val allSnippets = arrayOf( + SimpleCounterSnippet, + DeclareAndUseStylesheet, + DeclareAndUseCssVariable, + HoverSelectorAndMedia, + DefineCssClassInComponent, + LayoutsSample +) + +private var currentCodeSnippet: CodeSnippetData by mutableStateOf(allSnippets[0]) +private var selectedSnippetIx: Int by mutableStateOf(0) + +@Composable +fun CodeSamples() { + ContainerInSection { + Div({ + classes(WtRows.wtRow) + style { + justifyContent(JustifyContent.SpaceBetween) + } + }) { + Div({ classes(WtCols.wtCol6, WtCols.wtColMd4, WtCols.wtColSm12) }) { + H1({ + classes(WtTexts.wtH2) + }) { + Text("Code samples") + } + } + + Div({ classes(WtOffsets.wtTopOffsetSm24) }) { + CodeSampleSwitcher(count = allSnippets.size, current = selectedSnippetIx) { + selectedSnippetIx = it + currentCodeSnippet = allSnippets[it] + } + } + } + + TitledCodeSample(title = currentCodeSnippet.title, code = currentCodeSnippet.source) + } +} + +@Composable +private fun TitledCodeSample(title: String, code: String) { + H3({ + classes(WtTexts.wtH3, WtOffsets.wtTopOffset48) + }) { + Text(title) + } + + Div({ + classes(WtOffsets.wtTopOffset24) + style { + backgroundColor(rgba(39, 40, 44, 0.05)) + borderRadius(8.px, 8.px, 8.px) + property("padding", "12px 16px") + } + }) { + FormattedCodeSnippet(code = code) + } +} + +@Composable +fun FormattedCodeSnippet(code: String, language: String = "kotlin") { + Pre({ + style { + property("max-height", 25.em) + property("overflow", "auto") + height(auto) + } + }) { + Code({ + classes("language-$language", "hljs") + style { + property("font-family", "'JetBrains Mono', monospace") + property("tab-size", 4) + fontSize(10.pt) + backgroundColor(Color("transparent")) + } + }) { + DomSideEffect(code) { + it.setHighlightedCode(code) + } + } + } +} + +private data class CodeSnippetData( + val title: String, + val source: String +) diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/Footer.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/Footer.kt new file mode 100644 index 0000000000..2d565f7c7b --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/Footer.kt @@ -0,0 +1,113 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.attributes.ATarget +import org.jetbrains.compose.web.attributes.target +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.* +import com.sample.style.* + + +@Composable +fun PageFooter() { + Footer({ + style { + flexShrink(0) + property("box-sizing", "border-box") + } + }) { + Section({ + classes(WtSections.wtSectionBgGrayDark) + style { + property("padding", "24px 0") + } + }) { + Div({ classes(WtContainer.wtContainer) }) { + Div({ + classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter) + style { + justifyContent(JustifyContent.Center) + flexWrap(FlexWrap.Wrap) + } + }) { + + Div({ + classes(WtCols.wtColInline) + }) { + P({ + classes(WtTexts.wtText1, WtTexts.wtText1ThemeDark) + }) { + Text("Follow us") + } + } + + Div({ + classes(WtCols.wtColInline) + }) { + getSocialLinks().forEach { SocialIconLink(it) } + } + } + + CopyrightInFooter() + } + } + } +} + +@Composable +private fun CopyrightInFooter() { + Div({ + classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter, WtOffsets.wtTopOffset48) + style { + justifyContent(JustifyContent.SpaceEvenly) + flexWrap(FlexWrap.Wrap) + property("padding", "0px 12px") + } + }) { + Span({ + classes(WtTexts.wtText3, WtTexts.wtTextPale) + }) { + Text("Copyright © 2000-2021 JetBrains s.r.o.") + } + + Span({ + classes(WtTexts.wtText3, WtTexts.wtTextPale) + }) { + Text("Developed with drive and IntelliJ IDEA") + } + } +} + +@Composable +private fun SocialIconLink(link: SocialLink) { + A(attrs = { + classes(WtTexts.wtSocialButtonItem) + target(ATarget.Blank) + }, href = link.url) { + Img(src = link.iconSvg) {} + } +} + +private data class SocialLink( + val id: String, + val url: String, + val title: String, + val iconSvg: String +) + +private fun getSocialLinks(): List { + return listOf( + SocialLink("facebook", "https://www.facebook.com/JetBrains", "JetBrains on Facebook", "ic_fb.svg"), + SocialLink("twitter", "https://twitter.com/jetbrains", "JetBrains on Twitter", "ic_twitter.svg"), + SocialLink( + "linkedin", + "https://www.linkedin.com/company/jetbrains", + "JetBrains on Linkedin", + "ic_linkedin.svg" + ), + SocialLink("youtube", "https://www.youtube.com/user/JetBrainsTV", "JetBrains on YouTube", "ic_youtube.svg"), + SocialLink("instagram", "https://www.instagram.com/jetbrains/", "JetBrains on Instagram", "ic_insta.svg"), + SocialLink("blog", "https://blog.jetbrains.com/", "JetBrains blog", "ic_jb_blog.svg"), + SocialLink("rss", "https://blog.jetbrains.com/feed/", "JetBrains RSS Feed", "ic_feed.svg"), + ) +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/GetStartedSection.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/GetStartedSection.kt new file mode 100644 index 0000000000..b3db58c8f1 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/GetStartedSection.kt @@ -0,0 +1,107 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.* +import com.sample.components.CardDark +import com.sample.components.ContainerInSection +import com.sample.components.LinkOnCard +import com.sample.style.* + +private data class GetStartedCardPresentation( + val title: String, + val content: String, + val links: List +) + +private fun getCards(): List { + return listOf( + GetStartedCardPresentation( + title = "Start tutorial here", + content = "In this tutorial we will see how to create our first web UI application using Compose for Web.", + links = listOf( + LinkOnCard( + linkText = "View tutorial", + linkUrl = "https://github.com/JetBrains/compose-jb/tree/master/tutorials/Web/Getting_Started" + ) + ) + ), + GetStartedCardPresentation( + title = "Landing page example", + content = "An example of a landing page built using the Composable DOM API and Stylesheet DSL.", + links = listOf( + LinkOnCard( + linkText = "Explore the source code", + linkUrl = "https://github.com/JetBrains/compose-jb/tree/master/examples/web_landing" + ) + ) + ), + GetStartedCardPresentation( + title = "Falling Balls app example", + content = "This example demonstrates the use of multiplatform widgets – sharing user interface code between Compose for Desktop and Web.", + links = listOf( + LinkOnCard( + linkText = "Explore the source code", + linkUrl = "https://github.com/JetBrains/compose-jb/tree/master/examples/falling_balls_with_web" + ), + LinkOnCard( + linkText = "Play", + linkUrl = "https://falling-balls.ui.pages.jetbrains.team/" + ) + ) + ) + ) +} + +@Composable +private fun CardContent(text: String) { + P(attrs = { + classes(WtTexts.wtText2, WtTexts.wtText2ThemeDark, WtOffsets.wtTopOffset24) + }) { + Text(text) + } +} + +@Composable +fun GetStarted() { + ContainerInSection(WtSections.wtSectionBgGrayDark) { + H1(attrs = { + classes(WtTexts.wtH2, WtTexts.wtH2ThemeDark) + }) { + Text("Try out the Compose for Web") + } + + Div(attrs = { + classes(WtRows.wtRowSizeM, WtRows.wtRow, WtOffsets.wtTopOffset24) + }) { + Div(attrs = { + classes(WtCols.wtCol6, WtCols.wtColMd10, WtCols.wtColSm12, WtOffsets.wtTopOffset24) + }) { + P(attrs = { + classes(WtTexts.wtText1) + style { + color(Color("#fff")) + } + }) { + Text("Ready for your next adventure? Learn how to build reactive user interfaces with Compose for Web.") + } + } + } + + Div( + attrs = { + classes(WtRows.wtRow, WtRows.wtRowSizeM, WtOffsets.wtTopOffset24) + } + ) { + getCards().forEach { + CardDark( + title = it.title, + links = it.links, + wtExtraStyleClasses = listOf(WtCols.wtCol4, WtCols.wtColMd6, WtCols.wtColSm12) + ) { + CardContent(it.content) + } + } + } + } +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/Header.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/Header.kt new file mode 100644 index 0000000000..dadb0a1d06 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/Header.kt @@ -0,0 +1,59 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.attributes.ATarget +import org.jetbrains.compose.web.attributes.target +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.* +import com.sample.style.* +import kotlinx.browser.window + +@Composable +fun Header() { + Section(attrs = { + classes(WtSections.wtSectionBgGrayDark) + }) { + Div({ classes(WtContainer.wtContainer) }) { + Div({ + classes(WtRows.wtRow, WtRows.wtRowSizeM) + }) { + Logo() + // TODO: support i18n + //LanguageButton() + } + } + } +} + +@Composable +private fun Logo() { + Div(attrs = { + classes(WtCols.wtColInline) + }) { + A(attrs = { + target(ATarget.Blank) + }, href = "https://www.jetbrains.com/") { + Div(attrs = { + classes("jetbrains-logo", "_logo-jetbrains-square", "_size-3") + }) {} + } + } +} + +@Composable +private fun LanguageButton() { + Div(attrs = { + classes(WtCols.wtColInline) + }) { + Button(attrs = { + classes(WtTexts.wtButton, WtTexts.wtLangButton) + onClick { window.alert("Oops! This feature is yet to be implemented") } + }) { + Img(src = "ic_lang.svg", attrs = { style { + property("padding-left", 8.px) + property("padding-right", 8.px) + }}) + Text("English") + } + } +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt new file mode 100644 index 0000000000..e76f4206c3 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/IntroSection.kt @@ -0,0 +1,223 @@ +package com.sample.content + +import androidx.compose.runtime.* +import org.jetbrains.compose.web.attributes.ATarget +import org.jetbrains.compose.web.attributes.AttrsBuilder +import org.jetbrains.compose.web.attributes.target +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.dom.* +import com.sample.components.ContainerInSection +import com.sample.style.* +import org.w3c.dom.HTMLElement + +@Composable +fun Intro() { + ContainerInSection { + Div({ + classes(WtRows.wtRow, WtRows.wtRowSizeM, WtRows.wtRowSmAlignItemsCenter) + }) { + + Div({ + classes(WtCols.wtCol2, WtCols.wtColMd3) + style { + alignSelf(AlignSelf.Start) + } + }) { + Img(src = "i1.svg", attrs = { classes(AppStylesheet.composeLogo) }) + } + + Div({ + classes( + WtCols.wtCol10, + WtCols.wtColMd8, + WtCols.wtColSm12, + WtOffsets.wtTopOffsetSm12 + ) + }) { + H1(attrs = { classes(WtTexts.wtHero) }) { + Text("Compose for ") + Span({ + classes(WtTexts.wtHero) + style { + display(DisplayStyle.InlineBlock) + property("white-space", "nowrap") + } + }) { + Text("Web") + + Span(attrs = { classes(AppStylesheet.composeTitleTag) }) { + Text("Technology preview") + } + } + } + Div({ + classes(WtDisplay.wtDisplayMdNone) + }) { + IntroAboutComposeWeb() + } + } + } + + + Div(attrs = { + classes(WtDisplay.wtDisplayNone, WtDisplay.wtDisplayMdBlock) + }) { + IntroAboutComposeWeb() + } + } +} + +@Composable +private fun IntroAboutComposeWeb() { + Div({ + classes(WtRows.wtRow, WtRows.wtRowSizeM) + }) { + + Div({ + classes(WtCols.wtCol9, WtCols.wtColMd9, WtCols.wtColSm12) + }) { + P({ classes(WtTexts.wtSubtitle2, WtOffsets.wtTopOffset24) }) { + Text("Reactive web UIs for Kotlin, based on Google's ") + + A(href = "https://developer.android.com/jetpack/compose", attrs = { + classes(WtTexts.wtLink) + target(ATarget.Blank) + }) { + Text("modern toolkit") + } + + Text(" and brought to you by JetBrains") + } + + P({ + classes(WtTexts.wtText1, WtOffsets.wtTopOffset24) + }) { + Text( + "Compose for Web simplifies and accelerates UI development for web applications, " + + "and aims to enable UI code sharing between web, desktop, and Android applications " + + "in the future. Currently in technology preview." + ) + } + + ComposeWebStatusMessage() + + IntroCodeSample() + + A( + attrs = { + classes(WtTexts.wtButton, WtOffsets.wtTopOffset24) + target(ATarget.Blank) + }, + href = "https://github.com/jetbrains/compose-jb" + ) { + Text("Explore on GitHub") + } + } + } +} + +@Composable +private fun IntroCodeSample() { + Div({ + style { + marginTop(24.px) + backgroundColor(rgba(39, 40, 44, 0.05)) + borderRadius(8.px) + property("font-family", "'JetBrains Mono', monospace") + } + }) { + Div({ + style { + property("padding", "12px 16px") + } + }) { + FormattedCodeSnippet( + code = """ + fun greet() = listOf("Hello", "Hallo", "Hola", "Servus").random() + + renderComposable("greetingContainer") { + var greeting by remember { mutableStateOf(greet()) } + Button(attrs = { onClick { greeting = greet() } }) { + Text(greeting) + } + } + """.trimIndent() + ) + } + + Hr({ + style { + height(1.px) + border(width = 0.px) + backgroundColor(rgba(39, 40, 44, 0.15)) + } + }) + + IntroCodeSampleResult() + } +} + +@Composable +private fun IntroCodeSampleResult() { + Div({ + style { + property("padding", "12px 16px") + display(DisplayStyle.Flex) + flexDirection(FlexDirection.Row) + alignItems(AlignItems.Center) + } + }) { + Span({ + classes(WtTexts.wtText2) + style { + property("margin-right", 8.px) + } + }) { + Text("Result:") + } + + fun greet() = listOf("Hello", "Hallo", "Hola", "Servus").random() + + Div({ + id("greetingContainer") + }) { + var greeting by remember { mutableStateOf(greet()) } + Button(attrs = { onClick { greeting = greet() } }) { + Text(greeting) + } + } + } +} + +@Composable +private fun ComposeWebStatusMessage() { + Div({ + classes(WtRows.wtRow, WtRows.wtRowSizeXs, WtOffsets.wtTopOffset24) + }) { + Div({ + classes(WtCols.wtColInline) + }) { + Img(src = "ic_info.svg", attrs = { + style { + width(24.px) + height(24.px) + } + }) + } + + Div({ + classes(WtCols.wtColAutoFill) + }) { + P({ + classes(WtTexts.wtText3) + }) { + Text( + "With its current status Technology Preview, Compose for Web " + + "is not production-ready, and should only be used in experiments. " + + "We are hard at work to bring you great learning materials, tutorials, " + + "and documentation, and optimize the performance of Compose for Web in the future!" + ) + } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/JoinUs.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/JoinUs.kt new file mode 100644 index 0000000000..2dc30b17d9 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/content/JoinUs.kt @@ -0,0 +1,72 @@ +package com.sample.content + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.web.attributes.ATarget +import org.jetbrains.compose.web.attributes.target +import org.jetbrains.compose.web.dom.* +import org.jetbrains.compose.web.css.* +import com.sample.components.ContainerInSection +import com.sample.style.* + +@Composable +fun JoinUs() { + ContainerInSection(WtSections.wtSectionBgGrayLight) { + Div(attrs = { + classes(WtRows.wtRow, WtRows.wtRowSizeM) + }) { + Div(attrs = { + classes(WtCols.wtCol9, WtCols.wtColMd11, WtCols.wtColSm12) + }) { + + P(attrs = { + classes(WtTexts.wtSubtitle2) + }) { + Text("Interested in Compose for other platforms?") + + P { + Text("Have a look at ") + A(href = "https://www.jetbrains.com/lp/compose/", attrs = { + classes(WtTexts.wtLink) + target(ATarget.Blank) + }) { + Text("Compose for Desktop") + } + } + } + + P(attrs = { + classes(WtTexts.wtSubtitle2, WtOffsets.wtTopOffset24) + }) { + Text("Feel free to join the ") + LinkToSlack( + url = "https://kotlinlang.slack.com/archives/C01F2HV7868", + text = "#compose-web" + ) + Text(" channel on Kotlin Slack to discuss Compose for Web, or ") + LinkToSlack( + url = "https://kotlinlang.slack.com/archives/CJLTWPH7S", + text = "#compose" + ) + Text(" for general Compose discussions") + } + } + } + + A(attrs = { + classes(WtTexts.wtButton, WtTexts.wtButtonContrast, WtOffsets.wtTopOffset24) + target(ATarget.Blank) + }, href = "https://surveys.jetbrains.com/s3/kotlin-slack-sign-up") { + Text("Join Kotlin Slack") + } + } +} + +@Composable +private fun LinkToSlack(url: String, text: String) { + A(href = url, attrs = { + target(ATarget.Blank) + classes(WtTexts.wtLink) + }) { + Text(text) + } +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/Stylesheet.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/Stylesheet.kt new file mode 100644 index 0000000000..0450ebd6a2 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/Stylesheet.kt @@ -0,0 +1,95 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.css.selectors.CSSSelector + +object AppCSSVariables { + val wtColorGreyLight by variable() + val wtColorGreyDark by variable() + + val wtOffsetTopUnit by variable() + val wtHorizontalLayoutGutter by variable() + val wtFlowUnit by variable() + + val wtHeroFontSize by variable() + val wtHeroLineHeight by variable() + val wtSubtitle2FontSize by variable() + val wtSubtitle2LineHeight by variable() + val wtH2FontSize by variable() + val wtH2LineHeight by variable() + val wtH3FontSize by variable() + val wtH3LineHeight by variable() + + val wtColCount by variable() +} + + +object AppStylesheet : StyleSheet() { + val composeLogo by style { + property("max-width", 100.percent) + } + + val composeTitleTag by style { + property("padding", "5px 12px") + property("letter-spacing", "normal") + property("font-weight", 400) + property("line-height", 24.px) + + position(Position.Relative) + top((-32).px) + marginLeft(8.px) + fontSize(15.px) + backgroundColor(rgba(39, 40, 44, .05)) + color(rgba(39,40,44,.7)) + borderRadius(4.px, 4.px, 4.px) + + media(mediaMaxWidth(640.px)) { + self style { + top((-16).px) + } + } + } + + init { + "label, a, button" style { + property( + "font-family", + "system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + CSSSelector.Universal style { + AppCSSVariables.wtColorGreyLight(Color("#f4f4f4")) + AppCSSVariables.wtColorGreyDark(Color("#323236")) + AppCSSVariables.wtOffsetTopUnit(24.px) + + margin(0.px) + } + + media(mediaMaxWidth(640.px)) { + CSSSelector.Universal style { + AppCSSVariables.wtOffsetTopUnit(16.px) + AppCSSVariables.wtFlowUnit(16.px) + } + } + + CSSSelector.Attribute( + name = "class", + value = "wtCol", + operator = CSSSelector.Attribute.Operator.Contains + ) style { + property("margin-right", AppCSSVariables.wtHorizontalLayoutGutter.value()) + property("margin-left", AppCSSVariables.wtHorizontalLayoutGutter.value()) + + property( + "flex-basis", + "calc(8.33333%*${AppCSSVariables.wtColCount.value()} - ${AppCSSVariables.wtHorizontalLayoutGutter.value()}*2)" + ) + property( + "max-width", + "calc(8.33333%*${AppCSSVariables.wtColCount.value()} - ${AppCSSVariables.wtHorizontalLayoutGutter.value()}*2)" + ) + property("box-sizing", "border-box") + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtCard.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtCard.kt new file mode 100644 index 0000000000..7c39c9e39a --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtCard.kt @@ -0,0 +1,49 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* + +object WtCards : StyleSheet(AppStylesheet) { + val wtCard by style { + display(DisplayStyle.Flex) + flexDirection(FlexDirection.Column) + border(1.px, LineStyle.Solid) + property("min-height", 0) + property("box-sizing", "border-box") + } + + val wtCardThemeLight by style { + border(color = rgba(39,40,44,.2)) + color(Color("#27282c")) + backgroundColor(Color("white")) + } + + val wtCardThemeDark by style { + backgroundColor(rgba(255, 255, 255, 0.05)) + color(rgba(255, 255, 255, 0.6)) + border(0.px) + } + + val wtCardSection by style { + position(Position.Relative) + property("overflow", "auto") + property("flex", "1 1 auto") + property("min-height", 0) + property("box-sizing", "border-box") + property("padding", "24px 32px") + + media(mediaMaxWidth(640.px)) { + self style { padding(16.px) } + } + } + + val wtVerticalFlex by style { + display(DisplayStyle.Flex) + flexDirection(FlexDirection.Column) + alignItems(AlignItems.FlexStart) + } + + val wtVerticalFlexGrow by style { + flexGrow(1) + property("max-width", 100.percent) + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtCol.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtCol.kt new file mode 100644 index 0000000000..6be3f12ab6 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtCol.kt @@ -0,0 +1,137 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.CSSBuilder +import org.jetbrains.compose.web.css.CSSUnitValue +import org.jetbrains.compose.web.css.GenericStyleSheetBuilder +import org.jetbrains.compose.web.css.StyleSheet +import org.jetbrains.compose.web.css.flexGrow +import org.jetbrains.compose.web.css.maxWidth +import org.jetbrains.compose.web.css.media +import org.jetbrains.compose.web.css.percent +import org.jetbrains.compose.web.css.px +import org.jetbrains.compose.web.css.mediaMaxWidth +import org.jetbrains.compose.web.css.selectors.CSSSelector + +fun GenericStyleSheetBuilder.mediaMaxWidth( + value: CSSUnitValue, + cssSelector: CSSSelector, + rulesBuild: TBuilder.() -> Unit +) { + media(mediaMaxWidth(value)) { + cssSelector style rulesBuild + } +} + +fun CSSBuilder.forMaxWidth(value: CSSUnitValue, builder: CSSBuilder.() -> Unit) { + mediaMaxWidth(value, self, builder) +} + +object WtCols : StyleSheet(AppStylesheet) { + val wtCol2 by style { + AppCSSVariables.wtColCount(2) + } + + val wtCol3 by style { + AppCSSVariables.wtColCount(3) + } + + val wtCol4 by style { + AppCSSVariables.wtColCount(4) + } + + val wtCol5 by style { + AppCSSVariables.wtColCount(5) + } + + val wtCol6 by style { + AppCSSVariables.wtColCount(6) + } + + val wtCol9 by style { + AppCSSVariables.wtColCount(9) + } + + val wtCol10 by style { + AppCSSVariables.wtColCount(10) + } + + val wtColMd3 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(3) + } + } + + val wtColMd4 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(4) + } + } + + val wtColMd8 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(8) + } + } + + val wtColMd9 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(9) + } + } + + val wtColMd10 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(10) + } + } + + val wtColMd11 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(11) + } + } + + val wtColMd6 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(6) + } + } + + val wtColMd12 by style { + forMaxWidth(1000.px) { + AppCSSVariables.wtColCount(12) + } + } + + val wtColSm12 by style { + forMaxWidth(640.px) { + AppCSSVariables.wtColCount(12) + } + } + + val wtColLg6 by style { + forMaxWidth(1276.px) { + AppCSSVariables.wtColCount(6) + } + } + + val wtColSmAutoFill by style { + forMaxWidth(640.px) { + AppCSSVariables.wtColCount(0) + flexGrow(1) + property("max-width", 100.percent) + } + } + + val wtColAutoFill by style { + AppCSSVariables.wtColCount(0) + flexGrow(1) + property("max-width", 100.percent) + } + + val wtColInline by style { + AppCSSVariables.wtColCount(0) + property("max-width", 100.percent) + property("flex-basis", "auto") + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtContainer.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtContainer.kt new file mode 100644 index 0000000000..187cf346e9 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtContainer.kt @@ -0,0 +1,38 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* + +object WtContainer : StyleSheet(AppStylesheet) { + val wtContainer by style { + property("margin-left", "auto") + property("margin-right", "auto") + property("box-sizing", "border-box") + property("padding-left", 22.px) + property("padding-right", 22.px) + property("max-width", 1276.px) + + media(mediaMaxWidth(640.px)) { + self style { + property("max-width", 100.percent) + property("padding-left", 16.px) + property("padding-right", 16.px) + } + } + + media(mediaMaxWidth(1276.px)) { + self style { + property("max-width", 996.px) + property("padding-left", 22.px) + property("padding-right", 22.px) + } + } + + media(mediaMaxWidth(1000.px)) { + self style { + property("max-width", 100.percent) + property("padding-left", 22.px) + property("padding-right", 22.px) + } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtDisplay.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtDisplay.kt new file mode 100644 index 0000000000..2930f6f395 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtDisplay.kt @@ -0,0 +1,25 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* + +object WtDisplay : StyleSheet(AppStylesheet) { + val wtDisplayNone by style { + display(DisplayStyle.None) + } + + val wtDisplayMdBlock by style { + media(mediaMaxWidth(1000.px)) { + self style { + display(DisplayStyle.Block) + } + } + } + + val wtDisplayMdNone by style { + media(mediaMaxWidth(1000.px)) { + self style { + display(DisplayStyle.None) + } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtOffest.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtOffest.kt new file mode 100644 index 0000000000..ba70d247c0 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtOffest.kt @@ -0,0 +1,41 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* + +object WtOffsets : StyleSheet(AppStylesheet) { + val wtTopOffset96 by style { + marginTop(96.px) + property( + "margin-top", + "calc(4*${AppCSSVariables.wtOffsetTopUnit.value(24.px)})" + ) + } + + val wtTopOffset24 by style { + marginTop(24.px) + property( + "margin-top", + "calc(1*${AppCSSVariables.wtOffsetTopUnit.value(24.px)})" + ) + } + + val wtTopOffset48 by style { + marginTop(48.px) + } + + val wtTopOffsetSm12 by style { + media(mediaMaxWidth(640.px)) { + self style { + marginTop(12.px) + } + } + } + + val wtTopOffsetSm24 by style { + media(mediaMaxWidth(640.px)) { + self style { + marginTop(24.px) + } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtRow.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtRow.kt new file mode 100644 index 0000000000..bc6dc626dc --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtRow.kt @@ -0,0 +1,42 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* + +object WtRows : StyleSheet(AppStylesheet) { + + val wtRow by style { + AppCSSVariables.wtHorizontalLayoutGutter(0.px) + display(DisplayStyle.Flex) + flexWrap(FlexWrap.Wrap) + + property( + "margin-right", + "calc(-1*${AppCSSVariables.wtHorizontalLayoutGutter.value()})" + ) + property( + "margin-left", + "calc(-1*${AppCSSVariables.wtHorizontalLayoutGutter.value()})" + ) + property("box-sizing", "border-box") + } + + val wtRowSizeM by style { + AppCSSVariables.wtHorizontalLayoutGutter(16.px) + + media(mediaMaxWidth(640.px)) { + self style { + AppCSSVariables.wtHorizontalLayoutGutter(8.px) + } + } + } + + val wtRowSizeXs by style { + AppCSSVariables.wtHorizontalLayoutGutter(6.px) + } + + val wtRowSmAlignItemsCenter by style { + self style { + alignItems(AlignItems.Center) + } + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtSection.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtSection.kt new file mode 100644 index 0000000000..93580a690a --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtSection.kt @@ -0,0 +1,27 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* + +object WtSections : StyleSheet(AppStylesheet) { + + val wtSection by style { + property("box-sizing", "border-box") + property("padding-bottom", 96.px) + property("padding-top", 1.px) + property( + propertyName = "padding-bottom", + value = "calc(4*${AppCSSVariables.wtOffsetTopUnit.value(24.px)})" + ) + backgroundColor(Color("#fff")) + } + + val wtSectionBgGrayLight by style { + backgroundColor(Color("#f4f4f4")) + backgroundColor(AppCSSVariables.wtColorGreyLight.value()) + } + + val wtSectionBgGrayDark by style { + backgroundColor(Color("#323236")) + backgroundColor(AppCSSVariables.wtColorGreyDark.value()) + } +} diff --git a/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtText.kt b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtText.kt new file mode 100644 index 0000000000..90a1410b2b --- /dev/null +++ b/web/samples/web_landing/src/jsMain/kotlin/com/sample/style/WtText.kt @@ -0,0 +1,221 @@ +package com.sample.style + +import org.jetbrains.compose.web.css.* +import org.jetbrains.compose.web.css.selectors.hover + +object WtTexts : StyleSheet(AppStylesheet) { + + val wtHero by style { + color(Color("#27282c")) + fontSize(60.px) + property("font-size", AppCSSVariables.wtHeroFontSize.value(60.px)) + property("letter-spacing", (-1.5).px) + property("font-weight", 900) + property("line-height", 64.px) + property("line-height", AppCSSVariables.wtHeroLineHeight.value(64.px)) + + media(mediaMaxWidth(640.px)) { + self style { + AppCSSVariables.wtHeroFontSize(42.px) + AppCSSVariables.wtHeroLineHeight(48.px) + } + } + + property( + "font-family", + "Gotham SSm A,Gotham SSm B,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtSubtitle2 by style { + color(Color("#27282c")) + fontSize(28.px) + property("font-size", AppCSSVariables.wtSubtitle2FontSize.value(28.px)) + property("letter-spacing", "normal") + property("font-weight", 300) + property("line-height", 40.px) + property("line-height", AppCSSVariables.wtSubtitle2LineHeight.value(40.px)) + + media(mediaMaxWidth(640.px)) { + self style { + AppCSSVariables.wtSubtitle2FontSize(24.px) + AppCSSVariables.wtSubtitle2LineHeight(32.px) + } + } + + property( + "font-family", + "Gotham SSm A,Gotham SSm B,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtText1 by style { + color(rgba(39, 40, 44, .7)) + fontSize(18.px) + property("letter-spacing", "normal") + property("font-weight", 400) + property("line-height", 28.px) + + property( + "font-family", + "system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtText1ThemeDark by style { + color(rgba(255, 255, 255, 0.6)) + } + + val wtText2 by style { + color(rgba(39, 40, 44, .7)) + fontSize(15.px) + property("letter-spacing", "normal") + property("font-weight", 400) + property("line-height", 24.px) + + property( + "font-family", + "system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtText3 by style { + color(rgba(39, 40, 44, .7)) + fontSize(12.px) + property("letter-spacing", "normal") + property("font-weight", 400) + property("line-height", 16.px) + + property( + "font-family", + "system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtTextPale by style { + color(rgba(255, 255, 255, 0.30)) + } + + val wtText2ThemeDark by style { + color(rgba(255, 255, 255, 0.6)) + } + + val wtText3ThemeDark by style { + color(rgba(255, 255, 255, 0.6)) + } + + val wtLink by style { + property("border-bottom", "1px solid transparent") + property("text-decoration", "none") + color(Color("#167dff")) + + hover(self) style { + property("border-bottom-color", "#167dff") + } + } + + val wtH2 by style { + color(Color("#27282c")) + fontSize(31.px) + property("font-size", AppCSSVariables.wtH2FontSize.value(31.px)) + property("letter-spacing", (-.5).px) + property("font-weight", 700) + property("line-height", 40.px) + property("line-height", 40.px) + + media(mediaMaxWidth(640.px)) { + self style { + AppCSSVariables.wtH2FontSize(24.px) + AppCSSVariables.wtH2LineHeight(32.px) + } + } + + property( + "font-family", + "Gotham SSm A,Gotham SSm B,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtH2ThemeDark by style { + color(Color("#fff")) + } + + val wtH3 by style { + color(Color("#27282c")) + fontSize(21.px) + property("font-size", AppCSSVariables.wtH3FontSize.value(20.px)) + property("letter-spacing", "normal") + property("font-weight", 700) + property("line-height", 28.px) + property("line-height", AppCSSVariables.wtH3LineHeight.value(28.px)) + + property( + "font-family", + "system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,Arial,sans-serif" + ) + } + + val wtH3ThemeDark by style { + color(Color("#fff")) + } + + val wtButton by style { + color(Color("white")) + backgroundColor(Color("#167dff")) + fontSize(15.px) + display(DisplayStyle.InlineBlock) + property("text-decoration", "none") + property("border-radius", "24px") + property("padding", "12px 32px") + property("line-height", 24.px) + property("font-weight", 400) + property("width", "fit-content") + + hover(self) style { + backgroundColor(rgba(22, 125, 255, .8)) + } + } + + val wtLangButton by style { + display(DisplayStyle.LegacyInlineFlex) + justifyContent(JustifyContent.Center) + alignItems(AlignItems.Center) + backgroundColor(Color("transparent")) + border(0.px) + + property("outline", "none") + + hover(self) style { + backgroundColor(rgba(255, 255, 255, 0.1)) + } + } + + val wtButtonContrast by style { + color(Color("white")) + backgroundColor(Color("#27282c")) + + hover(self) style { + backgroundColor(rgba(39, 40, 44, .7)) + } + } + + val wtSocialButtonItem by style { + property("margin-right", 16.px) + marginLeft(16.px) + padding(12.px) + backgroundColor(Color("transparent")) + display(DisplayStyle.LegacyInlineFlex) + + hover(self) style { + backgroundColor(rgba(255, 255, 255, 0.1)) + property("border-radius", "24px") + } + + media(mediaMaxWidth(640.px)) { + self style { + property("margin-right", 8.px) + property("margin-left", 8.px) + } + } + } +} diff --git a/web/samples/web_landing/src/jsMain/resources/favicon-32x32.png b/web/samples/web_landing/src/jsMain/resources/favicon-32x32.png new file mode 100644 index 0000000000..7aece0f532 Binary files /dev/null and b/web/samples/web_landing/src/jsMain/resources/favicon-32x32.png differ diff --git a/web/samples/web_landing/src/jsMain/resources/hljs.css b/web/samples/web_landing/src/jsMain/resources/hljs.css new file mode 100644 index 0000000000..cfcf781a09 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/hljs.css @@ -0,0 +1,58 @@ +/*! + * StackOverflow.com light style + * + * @stackoverflow/stacks v0.56.0 + * https://github.com/StackExchange/Stacks + */ +.hljs { + display: block; + overflow-x: auto; + padding: .5em; + color: #2f3337; + background: #f6f6f6 +} + +.hljs-comment { + color: #656e77 +} + +.hljs-attr, .hljs-doctag, .hljs-keyword, .hljs-meta, .hljs-meta-keyword, .hljs-section, .hljs-selector-class, .hljs-selector-pseudo, .hljs-selector-tag { + color: #015692; + font-weight: bold; +} + +.hljs-attribute { + color: #803378 +} + +.hljs-built_in, .hljs-literal, .hljs-name, .hljs-number, .hljs-quote, .hljs-selector-id, .hljs-template-tag, .hljs-title, .hljs-type { + color: #b75501 +} + +.hljs-title { + font-style: italic; +} + +.hljs-link, .hljs-meta-string, .hljs-regexp, .hljs-selector-attr, .hljs-string, .hljs-symbol, .hljs-template-variable, .hljs-variable { + color: #54790d +} + +.hljs-bullet, .hljs-code { + color: #535a60 +} + +.hljs-deletion { + color: #c02d2e +} + +.hljs-addition { + color: #2f6f44 +} + +.hljs-emphasis { + font-style: italic +} + +.hljs-strong { + font-weight: 700 +} \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/i1.svg b/web/samples/web_landing/src/jsMain/resources/i1.svg new file mode 100644 index 0000000000..1aa3f8bd18 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/i1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_fb.svg b/web/samples/web_landing/src/jsMain/resources/ic_fb.svg new file mode 100644 index 0000000000..e327b1725a --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_fb.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_feed.svg b/web/samples/web_landing/src/jsMain/resources/ic_feed.svg new file mode 100644 index 0000000000..2ac9c9a90b --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_feed.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_info.svg b/web/samples/web_landing/src/jsMain/resources/ic_info.svg new file mode 100644 index 0000000000..3176c71c06 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_info.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_insta.svg b/web/samples/web_landing/src/jsMain/resources/ic_insta.svg new file mode 100644 index 0000000000..73620b7721 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_insta.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_jb_blog.svg b/web/samples/web_landing/src/jsMain/resources/ic_jb_blog.svg new file mode 100644 index 0000000000..ac0280083c --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_jb_blog.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_lang.svg b/web/samples/web_landing/src/jsMain/resources/ic_lang.svg new file mode 100644 index 0000000000..a572022813 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_lang.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_linkedin.svg b/web/samples/web_landing/src/jsMain/resources/ic_linkedin.svg new file mode 100644 index 0000000000..d6c17d7293 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_linkedin.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_twitter.svg b/web/samples/web_landing/src/jsMain/resources/ic_twitter.svg new file mode 100644 index 0000000000..e3ddf5ca76 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_twitter.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/ic_youtube.svg b/web/samples/web_landing/src/jsMain/resources/ic_youtube.svg new file mode 100644 index 0000000000..11211a06b2 --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/ic_youtube.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/index.html b/web/samples/web_landing/src/jsMain/resources/index.html new file mode 100644 index 0000000000..1c665576ec --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/index.html @@ -0,0 +1,17 @@ + + + + + Compose for Web UI Framework | JetBrains: Developer Tools for Professionals and Teams + + + + + + + + +
+ + + \ No newline at end of file diff --git a/web/samples/web_landing/src/jsMain/resources/logos.css b/web/samples/web_landing/src/jsMain/resources/logos.css new file mode 100644 index 0000000000..10221f2edf --- /dev/null +++ b/web/samples/web_landing/src/jsMain/resources/logos.css @@ -0,0 +1,762 @@ +.jetbrains-logo { + display: inline-block; + background-color: transparent; + background-repeat: no-repeat; + background-size: contain; + vertical-align: top; + text-indent: -9000px +} + +.jetbrains-logo._logo-jetbrains { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='120.1' height='130.2' viewBox='0 0 120.1 130.2' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='31.841' y1='120.558' x2='110.24' y2='73.24'%3E%3Cstop offset='0' stop-color='%23FCEE39'/%3E%3Cstop offset='1' stop-color='%23F37B3D'/%3E%3C/linearGradient%3E%3Cpath d='M118.6,71.8c0.9-0.8,1.4-1.9,1.5-3.2c0.1-2.6-1.8-4.7-4.4-4.9 c-1.2-0.1-2.4,0.4-3.3,1.1l0,0l-83.8,45.9c-1.9,0.8-3.6,2.2-4.7,4.1c-2.9,4.8-1.3,11,3.6,13.9c3.4,2,7.5,1.8,10.7-0.2l0,0l0,0 c0.2-0.2,0.5-0.3,0.7-0.5l78-54.8C117.3,72.9,118.4,72.1,118.6,71.8L118.6,71.8L118.6,71.8z' fill='url(%23a)'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='48.361' y1='6.908' x2='119.918' y2='69.555'%3E%3Cstop offset='0' stop-color='%23EF5A6B'/%3E%3Cstop offset='.57' stop-color='%23F26F4E'/%3E%3Cstop offset='1' stop-color='%23F37B3D'/%3E%3C/linearGradient%3E%3Cpath d='M118.8,65.1L118.8,65.1L55,2.5C53.6,1,51.6,0,49.3,0 c-4.3,0-7.7,3.5-7.7,7.7v0c0,2.1,0.8,3.9,2.1,5.3l0,0l0,0c0.4,0.4,0.8,0.7,1.2,1l67.4,57.7l0,0c0.8,0.7,1.8,1.2,3,1.3 c2.6,0.1,4.7-1.8,4.9-4.4C120.2,67.3,119.7,66,118.8,65.1z' fill='url(%23b)'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='52.947' y1='63.641' x2='10.538' y2='37.156'%3E%3Cstop offset='0' stop-color='%237C59A4'/%3E%3Cstop offset='.385' stop-color='%23AF4C92'/%3E%3Cstop offset='.765' stop-color='%23DC4183'/%3E%3Cstop offset='.957' stop-color='%23ED3D7D'/%3E%3C/linearGradient%3E%3Cpath d='M57.1,59.5C57,59.5,17.7,28.5,16.9,28l0,0l0,0c-0.6-0.3-1.2-0.6-1.8-0.9 c-5.8-2.2-12.2,0.8-14.4,6.6c-1.9,5.1,0.2,10.7,4.6,13.4l0,0l0,0C6,47.5,6.6,47.8,7.3,48c0.4,0.2,45.4,18.8,45.4,18.8l0,0 c1.8,0.8,3.9,0.3,5.1-1.2C59.3,63.7,59,61,57.1,59.5z' fill='url(%23c)'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='52.174' y1='3.702' x2='10.771' y2='37.897'%3E%3Cstop offset='0' stop-color='%23EF5A6B'/%3E%3Cstop offset='.364' stop-color='%23EE4E72'/%3E%3Cstop offset='1' stop-color='%23ED3D7D'/%3E%3C/linearGradient%3E%3Cpath d='M49.3,0c-1.7,0-3.3,0.6-4.6,1.5L4.9,28.3c-0.1,0.1-0.2,0.1-0.2,0.2l-0.1,0 l0,0c-1.7,1.2-3.1,3-3.9,5.1C-1.5,39.4,1.5,45.9,7.3,48c3.6,1.4,7.5,0.7,10.4-1.4l0,0l0,0c0.7-0.5,1.3-1,1.8-1.6l34.6-31.2l0,0 c1.8-1.4,3-3.6,3-6.1v0C57.1,3.5,53.6,0,49.3,0z' fill='url(%23d)'/%3E%3Cpath fill='%23000' d='M34.6 37.4H85.6V88.4H34.6z'/%3E%3Cpath fill='%23FFF' d='M39 78.8H58.1V82H39z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M38.8,50.8l1.5-1.4c0.4,0.5,0.8,0.8,1.3,0.8c0.6,0,0.9-0.4,0.9-1.2l0-5.3l2.3,0 l0,5.3c0,1-0.3,1.8-0.8,2.3c-0.5,0.5-1.3,0.8-2.3,0.8C40.2,52.2,39.4,51.6,38.8,50.8z'/%3E%3Cpath d='M45.3,43.8l6.7,0v1.9l-4.4,0V47l4,0l0,1.8l-4,0l0,1.3l4.5,0l0,2l-6.7,0 L45.3,43.8z'/%3E%3Cpath d='M55,45.8l-2.5,0l0-2l7.3,0l0,2l-2.5,0l0,6.3l-2.3,0L55,45.8z'/%3E%3Cpath d='M39,54l4.3,0c1,0,1.8,0.3,2.3,0.7c0.3,0.3,0.5,0.8,0.5,1.4v0 c0,1-0.5,1.5-1.3,1.9c1,0.3,1.6,0.9,1.6,2v0c0,1.4-1.2,2.3-3.1,2.3l-4.3,0L39,54z M43.8,56.6c0-0.5-0.4-0.7-1-0.7l-1.5,0l0,1.5 l1.4,0C43.4,57.3,43.8,57.1,43.8,56.6L43.8,56.6z M43,59l-1.8,0l0,1.5H43c0.7,0,1.1-0.3,1.1-0.8v0C44.1,59.2,43.7,59,43,59z'/%3E%3Cpath d='M46.8,54l3.9,0c1.3,0,2.1,0.3,2.7,0.9c0.5,0.5,0.7,1.1,0.7,1.9v0 c0,1.3-0.7,2.1-1.7,2.6l2,2.9l-2.6,0l-1.7-2.5h-1l0,2.5l-2.3,0L46.8,54z M50.6,58c0.8,0,1.2-0.4,1.2-1v0c0-0.7-0.5-1-1.2-1 l-1.5,0v2H50.6z'/%3E%3Cpath d='M56.8,54l2.2,0l3.5,8.4l-2.5,0l-0.6-1.5l-3.2,0l-0.6,1.5l-2.4,0L56.8,54z M58.8,59l-0.9-2.3L57,59L58.8,59z'/%3E%3Cpath d='M62.8,54l2.3,0l0,8.3l-2.3,0L62.8,54z'/%3E%3Cpath d='M65.7,54l2.1,0l3.4,4.4l0-4.4l2.3,0l0,8.3l-2,0L68,57.8l0,4.6l-2.3,0L65.7,54z'/%3E%3Cpath d='M73.7,61.1l1.3-1.5c0.8,0.7,1.7,1,2.7,1c0.6,0,1-0.2,1-0.6v0 c0-0.4-0.3-0.5-1.4-0.8c-1.8-0.4-3.1-0.9-3.1-2.6v0c0-1.5,1.2-2.7,3.2-2.7c1.4,0,2.5,0.4,3.4,1.1l-1.2,1.6 c-0.8-0.5-1.6-0.8-2.3-0.8c-0.6,0-0.8,0.2-0.8,0.5v0c0,0.4,0.3,0.5,1.4,0.8c1.9,0.4,3.1,1,3.1,2.6v0c0,1.7-1.3,2.7-3.4,2.7 C76.1,62.5,74.7,62,73.7,61.1z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-jetbrains._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-jetbrains._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-jetbrains._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-jetbrains._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-jetbrains._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-jetbrains-square { + background-image: url("data:image/svg+xml,%3Csvg data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 700'%3E%3Ctitle%3Ejetbrains-simple_2%3C/title%3E%3Cpath d='M0 0H700V700H0z'/%3E%3Cpath fill='%23fff' d='M60.379 568.75H322.879V612.5H60.379z'/%3E%3Cpath d='M57.428,184.315L77.8,165.083c5.542,6.682,10.758,10.594,17.929,10.594,7.823,0,12.877-5.378,12.877-15.972V87.5h31.457v72.367c0,14.343-3.586,24.448-11.246,32.109-7.5,7.5-18.254,11.572-31.294,11.572C77.638,203.548,65.577,195.236,57.428,184.315Z' fill='%23fff'/%3E%3Cpath fill='%23fff' d='M147.394 87.5L239.156 87.5 239.156 114.23 178.688 114.23 178.688 131.67 233.451 131.67 233.451 156.607 178.688 156.607 178.688 174.699 239.971 174.699 239.971 201.592 147.394 201.592 147.394 87.5z'/%3E%3Cpath fill='%23fff' d='M280.491 115.208L246.427 115.208 246.427 87.5 346.338 87.5 346.338 115.208 312.111 115.208 312.111 201.592 280.491 201.592 280.491 115.208z'/%3E%3Cpath d='M139.736,282.7c10.106-4.4,17.6-12.224,17.6-25.426v-0.326A25.675,25.675,0,0,0,150,238.364c-6.682-6.52-16.788-10.106-31.131-10.106H60.362V342.35H119.2c27.218,0,43.191-11.9,43.191-31.457v-0.326C162.392,295.083,153.591,287.26,139.736,282.7Zm-48.57-29.011h20.7c9.29,0,14.343,3.422,14.343,9.779v0.326c0,6.682-5.542,9.942-15.158,9.942H91.166V253.685Zm39.607,52.808c0,6.682-5.379,10.431-15.158,10.431H91.166V295.9h24.123c10.594,0,15.484,4.075,15.484,10.269v0.326Z' fill='%23fff'/%3E%3Cpath d='M335.8,227.444H305.325l-42.63,101.193-17.833-26.056c14.18-6.031,23.469-17.6,23.469-35.205V267.05c0-11.246-3.422-19.885-10.1-26.567-7.661-7.661-19.722-12.224-37.162-12.224H167.116V342.35h31.619V307.8h14.017l22.981,34.553H290l8.15-20.536h44.169l8.149,20.536h33.9Zm-99.093,42.05c0,8.312-6.357,13.529-16.951,13.529H198.736V255.477H219.6c10.432,0,17.114,4.564,17.114,13.692v0.325ZM307.444,297.2l12.877-32.271L333.033,297.2H307.444Z' fill='%23fff'/%3E%3Cpath fill='%23fff' d='M388.119 228.258H419.73800000000006V342.35H388.119z'/%3E%3Cpath fill='%23fff' d='M427.56 228.258L457.061 228.258 504.001 288.564 504.001 228.258 535.295 228.258 535.295 342.35 507.75 342.35 458.854 279.763 458.854 342.35 427.56 342.35 427.56 228.258z'/%3E%3Cpath d='M537.277,325.4l17.6-21.025c11.409,8.964,23.8,13.691,37,13.691,8.638,0,13.2-2.934,13.2-7.824v-0.325c0-4.89-3.749-7.335-19.4-11.084-24.286-5.541-43.03-12.387-43.03-35.694v-0.326c0-21.188,16.788-36.509,44.17-36.509,19.4,0,34.553,5.216,46.94,15.158L617.956,263.79c-10.431-7.5-21.84-11.246-31.946-11.246-7.66,0-11.409,3.1-11.409,7.334V260.2c0,5.216,3.912,7.5,19.885,11.083,26.078,5.7,42.377,14.18,42.377,35.531v0.326c0,23.307-18.418,37.161-46.126,37.161C570.526,344.306,551.457,337.95,537.277,325.4Z' fill='%23fff'/%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-jetbrains-square._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-jetbrains-square._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-jetbrains-square._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-jetbrains-square._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-jetbrains-square._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-appcode { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3Cpath fill='%23247CE6' d='M59.2 55L70 26.3 37.3 19 33 31.2z'/%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='20.617' y1='57.755' x2='70' y2='57.755'%3E%3Cstop offset='.194' stop-color='%2300DAF0'/%3E%3Cstop offset='.903' stop-color='%23247CE6'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M70 56.1L53.5 70 20.6 61.5 29.4 45.5z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='1.274' y1='17.415' x2='38.41' y2='17.415'%3E%3Cstop offset='.194' stop-color='%2300DAF0'/%3E%3Cstop offset='.903' stop-color='%23247CE6'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M9.7 34.8L1.3 10.8 38.4 0 35.4 31z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='45.876' y1='72.222' x2='11.197' y2='23.824'%3E%3Cstop offset='.091' stop-color='%231DDF93'/%3E%3Cstop offset='.484' stop-color='%2300DAF0'/%3E%3Cstop offset='.903' stop-color='%23247CE6'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M61.1 40.5L50.7 22.7 50.9 22.6 38.4 0 0 41.5 0 70 69.8 56.1z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3Cpath d='M24.5,19h3.6l7.6,17.9h-4.1l-1.6-4h-7.5l-1.6,4h-4L24.5,19z M28.6,29.4l-2.4-5.8l-2.4,5.8H28.6z' fill='%23FFF'/%3E%3Cpath d='M34.7,28.1L34.7,28.1c0-5.2,3.9-9.4,9.4-9.4c3.4,0,5.4,1.1,7.1,2.8l-2.5,2.9c-1.4-1.3-2.8-2-4.6-2 c-3,0-5.2,2.5-5.2,5.6V28c0,3.1,2.1,5.7,5.2,5.7c2.1,0,3.3-0.8,4.7-2.1l2.5,2.5c-1.9,2-3.9,3.2-7.4,3.2 C38.6,37.3,34.7,33.2,34.7,28.1' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-appcode._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-appcode._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-appcode._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-appcode._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-appcode._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-clion { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='22.254' y1='15.137' x2='45.654' y2='15.137'%3E%3Cstop offset='0' stop-color='%23ED358C'/%3E%3Cstop offset='.155' stop-color='%23E9388C'/%3E%3Cstop offset='.297' stop-color='%23DE418C'/%3E%3Cstop offset='.433' stop-color='%23CC508C'/%3E%3Cstop offset='.566' stop-color='%23B2658D'/%3E%3Cstop offset='.697' stop-color='%2390808D'/%3E%3Cstop offset='.826' stop-color='%2367A18E'/%3E%3Cstop offset='.951' stop-color='%2337C78F'/%3E%3Cstop offset='1' stop-color='%2322D88F'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M26.9 28.4L22.3 30.3 26.4 0 42.6 8.8z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='17.8' y1='8.982' x2='7.505' y2='78.065'%3E%3Cstop offset='.091' stop-color='%2322D88F'/%3E%3Cstop offset='.903' stop-color='%23029DE0'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M24.3 42L26.7 0 6.5 12.7 0 51.5z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='63.836' y1='6.492' x2='-6.583' y2='80.865'%3E%3Cstop offset='.091' stop-color='%2322D88F'/%3E%3Cstop offset='.903' stop-color='%23029DE0'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M68.6 21L59.6 2.7 42.6 8.8 30.1 22.7 0 51.5 22.7 68 51.2 42.3z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='40.114' y1='49.366' x2='66.875' y2='53.171'%3E%3Cstop offset='.091' stop-color='%2322D88F'/%3E%3Cstop offset='.903' stop-color='%23029DE0'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M29.4 29.9L25.5 53.9 41.5 66.2 59 70 70 45z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath d='M17.2,28.1L17.2,28.1c0-5.1,3.8-9.3,9.3-9.3c3.4,0,5.4,1.1,7.1,2.8l-2.5,2.9c-1.4-1.3-2.8-2-4.6-2 c-3,0-5.2,2.5-5.2,5.6V28c0,3.1,2.1,5.6,5.2,5.6c2,0,3.3-0.8,4.7-2.1l2.5,2.5c-1.8,2-3.9,3.2-7.3,3.2 C21.1,37.3,17.2,33.2,17.2,28.1' fill='%23FFF'/%3E%3Cpath d='M36.4,19.1h3.9v14.6h7.8v3.3H36.4V19.1z' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-clion._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-clion._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-clion._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-clion._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-clion._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-datagrip { + background-image: url("data:image/svg+xml,%3Csvg version='1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3Cpath fill='%239775F8' d='M65.5 10.9L70 39.5 53 49.4 49.8 33.2z'/%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='41.069' y1='54.357' x2='46.521' y2='67.944' gradientTransform='matrix(1 0 0 -1 0 72)'%3E%3Cstop offset='0' stop-color='%239775F8'/%3E%3Cstop offset='.952' stop-color='%2322D88F'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M65.5 10.9L40.5 0 19.4 17.5 49.8 33.2z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='17.067' y1='35.739' x2='24.146' y2='4.895' gradientTransform='matrix(1 0 0 -1 0 72)'%3E%3Cstop offset='0' stop-color='%239775F8'/%3E%3Cstop offset='.214' stop-color='%23689CCE'/%3E%3Cstop offset='.423' stop-color='%2342BDAC'/%3E%3Cstop offset='.59' stop-color='%232BD197'/%3E%3Cstop offset='.694' stop-color='%2322D88F'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M47.3 70L18 30.6 9.3 36.4 0.6 62.5z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='4.9' y1='37.969' x2='66.239' y2='4.102' gradientTransform='matrix(1 0 0 -1 0 72)'%3E%3Cstop offset='.075' stop-color='%2322D88F'/%3E%3Cstop offset='.72' stop-color='%239775F8'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M52.8 50.1L32.3 36.6 0 32.3 47.3 70z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='0' y1='45.15' x2='61.646' y2='45.15' gradientTransform='matrix(1 0 0 -1 0 72)'%3E%3Cstop offset='.075' stop-color='%2322D88F'/%3E%3Cstop offset='.266' stop-color='%235AB0B4'/%3E%3Cstop offset='.565' stop-color='%23B86CF2'/%3E%3Cstop offset='1' stop-color='%23FF59E6'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M0 0.5L0 32.3 60.8 53.2 65.5 10.9z'/%3E%3Cg%3E%3Cpath d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M17.8,19h7c5.6,0,9.5,3.9,9.5,8.9V28c0,5-3.9,8.9-9.5,8.9h-7V19z M21.7,22.6v10.8h3 c3.2,0,5.4-2.2,5.4-5.3V28c0-3.2-2.2-5.4-5.4-5.4H21.7z'/%3E%3Cpath d='M35,28L35,28c0-5.1,4-9.3,9.4-9.3c3.2,0,5.2,0.9,7,2.5l-2.5,3c-1.4-1.2-2.6-1.8-4.7-1.8 c-2.9,0-5.1,2.5-5.1,5.6V28c0,3.3,2.2,5.7,5.4,5.7c1.4,0,2.7-0.4,3.7-1.1V30h-4v-3.4H52v7.8c-1.8,1.6-4.4,2.8-7.6,2.8 C38.8,37.2,35,33.3,35,28z'/%3E%3C/g%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-datagrip._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-datagrip._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-datagrip._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-datagrip._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-datagrip._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-dotcover { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='37.049' y1='55.637' x2='23.558' y2='5.422'%3E%3Cstop offset='.048' stop-color='%237866FF'/%3E%3Cstop offset='.135' stop-color='%238265FA'/%3E%3Cstop offset='.281' stop-color='%239C64EE'/%3E%3Cstop offset='.467' stop-color='%23C661D9'/%3E%3Cstop offset='.608' stop-color='%23EB5FC7'/%3E%3Cstop offset='.729' stop-color='%23FA6398'/%3E%3Cstop offset='.769' stop-color='%23FF6488'/%3E%3Cstop offset='.995' stop-color='%23FF7500'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M42.8 0L0 4.8 0 26.8 10.7 62.6 64.6 48.9z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='69.11' y1='50.451' x2='57.169' y2='46.132'%3E%3Cstop offset='.247' stop-color='%237866FF'/%3E%3Cstop offset='.346' stop-color='%238F5FFA'/%3E%3Cstop offset='.531' stop-color='%23B353F1'/%3E%3Cstop offset='.705' stop-color='%23CD4AEB'/%3E%3Cstop offset='.859' stop-color='%23DD45E7'/%3E%3Cstop offset='.979' stop-color='%23E343E6'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M70 41.3L65.9 22.2 56.7 34.9 50.3 54.2 48.2 70 64 60z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='57.012' y1='46.84' x2='23.73' y2='32.867'%3E%3Cstop offset='.006' stop-color='%23E343E6'/%3E%3Cstop offset='.064' stop-color='%23E649CA'/%3E%3Cstop offset='.19' stop-color='%23EF5982'/%3E%3Cstop offset='.372' stop-color='%23FD7110'/%3E%3Cstop offset='.398' stop-color='%23FF7500'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M65.9 22.2L52.5 15.8 36.8 17.2 21.4 27.9 18.3 47.1 31.8 65.5 48.2 70z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M17.5,19.1h7c5.6,0,9.5,3.9,9.5,8.9v0.1c0,5-3.9,8.9-9.5,8.9h-7V19.1z M21.4,22.7v10.8h3 c3.2,0,5.4-2.2,5.4-5.3v-0.1c0-3.2-2.2-5.4-5.4-5.4H21.4z'/%3E%3Cpath d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath d='M35.4,28.1L35.4,28.1c0-5.1,3.8-9.3,9.3-9.3c3.4,0,5.4,1.1,7.1,2.8l-2.5,2.9c-1.4-1.3-2.8-2-4.6-2 c-3,0-5.2,2.5-5.2,5.6v0.1c0,3.1,2.1,5.6,5.2,5.6c2,0,3.3-0.8,4.7-2.1l2.5,2.5c-1.8,2-3.9,3.2-7.3,3.2 C39.4,37.3,35.4,33.3,35.4,28.1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-dotcover._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-dotcover._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-dotcover._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-dotcover._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-dotcover._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-dotmemory { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='20.477' y1='18.782' x2='32.464' y2='68.958'%3E%3Cstop offset='0' stop-color='%237866FF'/%3E%3Cstop offset='.023' stop-color='%237E64FE'/%3E%3Cstop offset='.195' stop-color='%23AA56F3'/%3E%3Cstop offset='.349' stop-color='%23C94CEC'/%3E%3Cstop offset='.48' stop-color='%23DC45E8'/%3E%3Cstop offset='.57' stop-color='%23E343E6'/%3E%3Cstop offset='.641' stop-color='%23E859BC'/%3E%3Cstop offset='.819' stop-color='%23F48F58'/%3E%3Cstop offset='.942' stop-color='%23FCB019'/%3E%3Cstop offset='1' stop-color='%23FFBD00'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M8 65.1L0.1 37.6 51.7 45.2 44.3 70z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='49.418' y1='41.451' x2='32.72' y2='7.516'%3E%3Cstop offset='0' stop-color='%237866FF'/%3E%3Cstop offset='.202' stop-color='%23965CF8'/%3E%3Cstop offset='.64' stop-color='%23E343E6'/%3E%3Cstop offset='.968' stop-color='%23FFBD00'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M23.5 0.1L42.1 5.4 63.2 0 70 46.3 13.4 37.6z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='26.353' y1='53.604' x2='36.21' y2='30.222'%3E%3Cstop offset='.118' stop-color='%23E343E6'/%3E%3Cstop offset='.211' stop-color='%23C84CEC'/%3E%3Cstop offset='.338' stop-color='%23AB55F3'/%3E%3Cstop offset='.472' stop-color='%23955DF8'/%3E%3Cstop offset='.618' stop-color='%238562FC'/%3E%3Cstop offset='.781' stop-color='%237B65FE'/%3E%3Cstop offset='1' stop-color='%237866FF'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M70 46.1L67.3 28.9 25.6 14.4 0.1 19.9 0 37.7 49.6 51.3z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3Cpath d='M17.4,19h6.9c5.6,0,9.5,3.9,9.5,8.9V28c0,5-3.9,9-9.5,9h-6.9V19z M21.3,22.6v10.8h2.9 c3.2,0,5.4-2.2,5.4-5.4V28c0-3.2-2.2-5.4-5.4-5.4H21.3z' fill='%23FFF'/%3E%3Cpath fill='%23FFF' d='M34.8 19.1L39.1 19.1 43.7 26.6 48.4 19.1 52.6 19.1 52.6 36.9 48.7 36.9 48.7 25.2 43.7 32.8 43.6 32.8 38.7 25.3 38.7 36.9 34.8 36.9z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-dotmemory._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-dotmemory._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-dotmemory._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-dotmemory._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-dotmemory._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-dotpeek { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='10.879' y1='26.793' x2='47.049' y2='63.717'%3E%3Cstop offset='.097' stop-color='%23E343E6'/%3E%3Cstop offset='.108' stop-color='%23D948E8'/%3E%3Cstop offset='.165' stop-color='%23AC5DEF'/%3E%3Cstop offset='.222' stop-color='%23876FF5'/%3E%3Cstop offset='.279' stop-color='%236B7DF9'/%3E%3Cstop offset='.336' stop-color='%235687FC'/%3E%3Cstop offset='.392' stop-color='%234A8DFE'/%3E%3Cstop offset='.446' stop-color='%23468FFF'/%3E%3Cstop offset='.935' stop-color='%2300CAFF'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M44.3 20.9L5.2 30.3 0 40.8 14.1 70 49.3 63.9z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='9.66' y1='55.746' x2='32.843' y2='36.427'%3E%3Cstop offset='.097' stop-color='%23E343E6'/%3E%3Cstop offset='.118' stop-color='%23DE45E7'/%3E%3Cstop offset='.289' stop-color='%23B951F0'/%3E%3Cstop offset='.462' stop-color='%239D5AF6'/%3E%3Cstop offset='.632' stop-color='%238861FB'/%3E%3Cstop offset='.802' stop-color='%237C65FE'/%3E%3Cstop offset='.968' stop-color='%237866FF'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M65.8 31.5L38.2 14 0 22.1 0 40.8 62.6 53.3z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='39.855' y1='16.927' x2='56.356' y2='50.653'%3E%3Cstop offset='.199' stop-color='%23E343E6'/%3E%3Cstop offset='.31' stop-color='%23DA46E8'/%3E%3Cstop offset='.491' stop-color='%23C24EEE'/%3E%3Cstop offset='.718' stop-color='%239A5BF7'/%3E%3Cstop offset='.887' stop-color='%237866FF'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M70 31.3L39.6 0 15.8 7.2 23.6 30.9 62.6 53.3z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='19.875' y1='18.305' x2='61.328' y2='8.256'%3E%3Cstop offset='.097' stop-color='%23E343E6'/%3E%3Cstop offset='.175' stop-color='%23DA48E7'/%3E%3Cstop offset='.302' stop-color='%23C157EA'/%3E%3Cstop offset='.464' stop-color='%23996FEE'/%3E%3Cstop offset='.653' stop-color='%236290F4'/%3E%3Cstop offset='.863' stop-color='%231CB9FC'/%3E%3Cstop offset='.941' stop-color='%2300CAFF'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M64.5 19.6L61.8 0 51.3 0 39.6 0 15.8 7.2 23.6 30.9z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M17.5,19.1h7c5.6,0,9.5,3.9,9.5,8.9v0.1c0,5-3.9,8.9-9.5,8.9h-7V19.1z M21.4,22.7v10.8h3 c3.2,0,5.4-2.2,5.4-5.3v-0.1c0-3.2-2.2-5.4-5.4-5.4H21.4z'/%3E%3Cpath d='M35.6,19.1h7.3c4.3,0,6.9,2.5,6.9,6.2v0.1c0,4.1-3.2,6.3-7.2,6.3h-3V37h-3.9V19.1z M42.6,28.1 c2,0,3.1-1.2,3.1-2.7v-0.1c0-1.8-1.2-2.7-3.2-2.7h-3v5.5H42.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-dotpeek._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-dotpeek._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-dotpeek._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-dotpeek._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-dotpeek._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-dottrace { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='-1.332' y1='43.737' x2='67.042' y2='26.097'%3E%3Cstop offset='.124' stop-color='%237866FF'/%3E%3Cstop offset='.538' stop-color='%23FE2EB6'/%3E%3Cstop offset='.855' stop-color='%23FD0486'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M67.3 16L43.7 0 0 31.1 11.1 70 58.9 60.3z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='45.915' y1='38.91' x2='67.658' y2='9.099'%3E%3Cstop offset='.124' stop-color='%23FF0080'/%3E%3Cstop offset='.259' stop-color='%23FE0385'/%3E%3Cstop offset='.411' stop-color='%23FA0C92'/%3E%3Cstop offset='.571' stop-color='%23F41BA9'/%3E%3Cstop offset='.736' stop-color='%23EB2FC8'/%3E%3Cstop offset='.866' stop-color='%23E343E6'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M67.3 16L43.7 0 38 15.7 38 47.8 70 47.8z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M17.4,19.1h6.9c5.6,0,9.5,3.8,9.5,8.9V28c0,5-3.9,8.9-9.5,8.9h-6.9V19.1z M21.4,22.7v10.7h3 c3.2,0,5.4-2.2,5.4-5.3V28c0-3.2-2.2-5.4-5.4-5.4H21.4z'/%3E%3Cpath d='M40.3 22.7L34.9 22.7 34.9 19.1 49.6 19.1 49.6 22.7 44.2 22.7 44.2 37 40.3 37z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-dottrace._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-dottrace._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-dottrace._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-dottrace._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-dottrace._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-gogland { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='218.31' y1='276.731' x2='206.336' y2='294.988' gradientTransform='translate(-286.906 -405.031) scale(1.5625)'%3E%3Cstop offset='.174' stop-color='%23078EFC'/%3E%3Cstop offset='.204' stop-color='%23118AFC'/%3E%3Cstop offset='.435' stop-color='%235971FC'/%3E%3Cstop offset='.627' stop-color='%238E5EFC'/%3E%3Cstop offset='.77' stop-color='%23AF52FC'/%3E%3Cstop offset='.849' stop-color='%23BB4EFC'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M57.274,22.361l9.541,21.197l-13.49,23.045L20.922,40.202L37.493,24.23L57.274,22.361z'/%3E%3Cpath fill='%23BB4EFC' d='M43.499,42.747l9.826,23.857L23.39,56.314l-2.468-16.111L43.499,42.747z'/%3E%3Cpath fill='%23078EFC' d='M24.281,9.433l13.776,7.06l-12.398,37.54L0.69,53.773l5.364-11.895L0.69,26.677L24.281,9.433z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='188.25' y1='278.506' x2='212.533' y2='260.237' gradientTransform='translate(-286.906 -405.031) scale(1.5625)'%3E%3Cstop offset='.174' stop-color='%23078EFC'/%3E%3Cstop offset='.204' stop-color='%23118AFC'/%3E%3Cstop offset='.435' stop-color='%235971FC'/%3E%3Cstop offset='.627' stop-color='%238E5EFC'/%3E%3Cstop offset='.77' stop-color='%23AF52FC'/%3E%3Cstop offset='.849' stop-color='%23BB4EFC'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M41.563,0.479l6.515,22.17L0.69,26.677L15.761,0.479H41.563z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='189.941' y1='296.496' x2='220.469' y2='276.879' gradientTransform='translate(-286.906 -405.031) scale(1.5625)'%3E%3Cstop offset='0' stop-color='%23078EFC'/%3E%3Cstop offset='.106' stop-color='%2315A7D3'/%3E%3Cstop offset='.228' stop-color='%2323BFAA'/%3E%3Cstop offset='.348' stop-color='%232DD28B'/%3E%3Cstop offset='.463' stop-color='%2335DF74'/%3E%3Cstop offset='.573' stop-color='%2339E767'/%3E%3Cstop offset='.67' stop-color='%233BEA62'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M66.815 14.519L39.091 21.099 0.69 53.773 25.458 66.604 46.973 44.423z'/%3E%3Cg%3E%3Cpath d='M11.711 11.5H55.794V55.583H11.711z'/%3E%3Cpath fill='%23FFF' d='M16.119 48.309H32.65V50.954H16.119z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M14.607,25.88v-0.054c-0.18-5.295,3.967-9.734,9.262-9.913c0.09-0.003,0.179-0.005,0.269-0.005 c2.64-0.135,5.22,0.815,7.142,2.63l-2.52,3.206c-1.251-1.272-2.969-1.975-4.753-1.945c-3.083,0.226-5.41,2.889-5.22,5.974v0.054 c-0.258,3.091,2.039,5.805,5.13,6.063c0.125,0.01,0.251,0.017,0.377,0.019c1.347,0.04,2.67-0.365,3.765-1.151v-2.74h-4.025v-3.643 h7.895v8.328c-2.113,1.955-4.886,3.041-7.765,3.043c-5.162,0.123-9.446-3.963-9.569-9.125c0,0,0,0,0,0 C14.59,26.374,14.594,26.127,14.607,25.88z'/%3E%3Cpath d='M33.609,25.88v-0.054c-0.141-5.335,4.069-9.774,9.405-9.915s9.774,4.069,9.915,9.405 c0.004,0.152,0.004,0.305,0.001,0.457v0.054c0.141,5.335-4.069,9.774-9.405,9.915c-5.335,0.141-9.774-4.069-9.915-9.405l0,0 C33.606,26.185,33.606,26.033,33.609,25.88z M48.75,25.88v-0.054c0.186-3.14-2.209-5.835-5.349-6.021 c-0.053-0.003-0.105-0.005-0.158-0.007c-3.096,0.078-5.542,2.65-5.464,5.746c0,0,0,0,0,0c0.002,0.076,0.005,0.152,0.01,0.229 v0.054c-0.186,3.14,2.209,5.835,5.349,6.021c0.053,0.003,0.105,0.005,0.158,0.007c3.096-0.078,5.542-2.65,5.464-5.746c0,0,0,0,0,0 C48.758,26.033,48.755,25.956,48.75,25.88z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-gogland._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-gogland._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-gogland._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-gogland._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-gogland._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-hub { + background-image: url("data:image/svg+xml,%3Csvg version='1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' viewBox='0 0 70 70' width='70' height='70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='40.415' y1='69.001' x2='39.585' y2='30.566' gradientTransform='matrix(1 0 0 -1 0 69.89)'%3E%3Cstop offset='.328' stop-color='%2300B8F1'/%3E%3Cstop offset='.973' stop-color='%239758FB'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M61.3,0.9c-1.7-0.8-3.6-1-5.5-0.8c-0.3,0-45.3,3.8-45.3,3.8l31.8,37.5l5.8,0.3L66.3,22 C72.4,15.9,71.1,5,61.3,0.9z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='58.345' y1='64.017' x2='11.932' y2='13.636'%3E%3Cstop offset='0' stop-color='%23FFEE45'/%3E%3Cstop offset='1' stop-color='%239758FB'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M53.6,47.2l-1.3,2l-16-19.5L20.8,40.1L46.5,68c0.5,0.5,1.2,0.9,1.9,1.3c1.4,0.7,3,0.9,4.6,0.4 c1.5-0.4,2.6-1.2,3.5-2.1c0.1-0.1,10.8-10.7,10.8-10.7L53.6,47.2z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='31.025' y1='60.401' x2='21.392' y2='39.808' gradientTransform='matrix(1 0 0 -1 0 69.89)'%3E%3Cstop offset='.328' stop-color='%2300B8F1'/%3E%3Cstop offset='.79' stop-color='%239758FB'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M45.7,41.6L19.6,8.4l0,0c-1.1-1.6-2.8-2.9-5-3.8c-1.7-0.7-3.7-0.9-5.5-0.5 C-0.5,6.2-2.7,16.7,3.5,22.3l18.1,18.6L45.7,41.6z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='-3.259' y1='17.766' x2='68.816' y2='17.766' gradientTransform='matrix(1 0 0 -1 0 69.89)'%3E%3Cstop offset='0' stop-color='%2300B8F1'/%3E%3Cstop offset='.306' stop-color='%239758FB'/%3E%3Cstop offset='.989' stop-color='%23FFEE45'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M63.2,40.5c-3.4-1-5.3-0.7-9.8-0.8l-38-5.4L4.5,44.7c-6.9,6.8-5.8,18.7,4.4,23.8 c2.6,1.3,5.5,1.7,8.2,1.3l0,0c19.3-3.6,43.5-9.4,43.7-9.4c0.4-0.1,0.9-0.2,1.3-0.3c6.3-1.9,8.9-7.8,7.4-12.8 C68.7,44.5,66.5,41.5,63.2,40.5z'/%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M17.4,19.1h4v7.2h7.4v-7.2h4v18.1h-4v-7.3h-7.4v7.3h-4V19.1z'/%3E%3Cpath d='M35.7,19.1h8.4c2.1,0,3.7,0.6,4.7,1.6c0.8,0.8,1.2,1.8,1.2,3.1v0.1c0,2-1.1,3.2-2.4,3.9 c2.1,0.8,3.4,2,3.4,4.5v0.1c0,3.3-2.7,5-6.8,5h-8.6V19.1H35.7z M46.2,24.4c0-1.2-0.9-1.9-2.6-1.9h-3.9v3.8h3.7 C45.1,26.4,46.2,25.8,46.2,24.4L46.2,24.4z M44.2,29.7h-4.6v4h4.7c1.8,0,2.8-0.6,2.8-2v-0.1C47.2,30.5,46.3,29.7,44.2,29.7z'/%3E%3C/g%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-hub._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-hub._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-hub._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-hub._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-hub._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-intellij-idea { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='.79' y1='40.089' x2='33.317' y2='40.089'%3E%3Cstop offset='.258' stop-color='%23F97A12'/%3E%3Cstop offset='.459' stop-color='%23B07B58'/%3E%3Cstop offset='.724' stop-color='%23577BAE'/%3E%3Cstop offset='.91' stop-color='%231E7CE5'/%3E%3Cstop offset='1' stop-color='%23087CFA'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M17.7 54.6L0.8 41.2 9.2 25.6 33.3 35z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='25.767' y1='24.88' x2='79.424' y2='54.57'%3E%3Cstop offset='0' stop-color='%23F97A12'/%3E%3Cstop offset='.072' stop-color='%23CB7A3E'/%3E%3Cstop offset='.154' stop-color='%239E7B6A'/%3E%3Cstop offset='.242' stop-color='%23757B91'/%3E%3Cstop offset='.334' stop-color='%23537BB1'/%3E%3Cstop offset='.432' stop-color='%23387CCC'/%3E%3Cstop offset='.538' stop-color='%23237CE0'/%3E%3Cstop offset='.655' stop-color='%23147CEF'/%3E%3Cstop offset='.792' stop-color='%230B7CF7'/%3E%3Cstop offset='1' stop-color='%23087CFA'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M70 18.7L68.7 59.2 41.8 70 25.6 59.6 49.3 35 38.9 12.3 48.2 1.1z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='63.228' y1='42.915' x2='48.29' y2='-1.719'%3E%3Cstop offset='0' stop-color='%23FE315D'/%3E%3Cstop offset='.078' stop-color='%23CB417E'/%3E%3Cstop offset='.16' stop-color='%239E4E9B'/%3E%3Cstop offset='.247' stop-color='%23755BB4'/%3E%3Cstop offset='.339' stop-color='%235365CA'/%3E%3Cstop offset='.436' stop-color='%23386DDB'/%3E%3Cstop offset='.541' stop-color='%232374E9'/%3E%3Cstop offset='.658' stop-color='%231478F3'/%3E%3Cstop offset='.794' stop-color='%230B7BF8'/%3E%3Cstop offset='1' stop-color='%23087CFA'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M70 18.7L48.7 43.9 38.9 12.3 48.2 1.1z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='10.72' y1='16.473' x2='55.524' y2='90.58'%3E%3Cstop offset='0' stop-color='%23FE315D'/%3E%3Cstop offset='.04' stop-color='%23F63462'/%3E%3Cstop offset='.104' stop-color='%23DF3A71'/%3E%3Cstop offset='.167' stop-color='%23C24383'/%3E%3Cstop offset='.291' stop-color='%23AD4A91'/%3E%3Cstop offset='.55' stop-color='%23755BB4'/%3E%3Cstop offset='.917' stop-color='%231D76ED'/%3E%3Cstop offset='1' stop-color='%23087CFA'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M33.7 58.1L5.6 68.3 10.1 52.5 16 33.1 0 27.7 10.1 0 32.1 2.7 53.7 27.4z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.7 13.5H56.900000000000006V56.7H13.7z'/%3E%3Cpath fill='%23FFF' d='M17.7 48.6H33.9V51.300000000000004H17.7z'/%3E%3Cpath fill='%23FFF' d='M29.4 22.4L29.4 19.1 20.4 19.1 20.4 22.4 23 22.4 23 33.7 20.4 33.7 20.4 37 29.4 37 29.4 33.7 26.9 33.7 26.9 22.4z'/%3E%3Cpath d='M38,37.3c-1.4,0-2.6-0.3-3.5-0.8c-0.9-0.5-1.7-1.2-2.3-1.9l2.5-2.8c0.5,0.6,1,1,1.5,1.3 c0.5,0.3,1.1,0.5,1.7,0.5c0.7,0,1.3-0.2,1.8-0.7c0.4-0.5,0.6-1.2,0.6-2.3V19.1h4v11.7c0,1.1-0.1,2-0.4,2.8c-0.3,0.8-0.7,1.4-1.3,2 c-0.5,0.5-1.2,1-2,1.2C39.8,37.1,39,37.3,38,37.3' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-intellij-idea._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-intellij-idea._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-intellij-idea._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-intellij-idea._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-intellij-idea._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-kotlin { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' viewBox='0 0 60 60' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='15.959' y1='-13.014' x2='44.307' y2='15.333' gradientTransform='matrix(1 0 0 -1 0 61)'%3E%3Cstop offset='.097' stop-color='%230095D5'/%3E%3Cstop offset='.301' stop-color='%23238AD9'/%3E%3Cstop offset='.621' stop-color='%23557BDE'/%3E%3Cstop offset='.864' stop-color='%237472E2'/%3E%3Cstop offset='1' stop-color='%23806EE3'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M0 60L30.1 29.9 60 60z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='4.209' y1='48.941' x2='20.673' y2='65.405' gradientTransform='matrix(1 0 0 -1 0 61)'%3E%3Cstop offset='.118' stop-color='%230095D5'/%3E%3Cstop offset='.418' stop-color='%233C83DC'/%3E%3Cstop offset='.696' stop-color='%236D74E1'/%3E%3Cstop offset='.833' stop-color='%23806EE3'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M0 0L30.1 0 0 32.5z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='-10.102' y1='5.836' x2='45.731' y2='61.669' gradientTransform='matrix(1 0 0 -1 0 61)'%3E%3Cstop offset='.107' stop-color='%23C757BC'/%3E%3Cstop offset='.214' stop-color='%23D0609A'/%3E%3Cstop offset='.425' stop-color='%23E1725C'/%3E%3Cstop offset='.605' stop-color='%23EE7E2F'/%3E%3Cstop offset='.743' stop-color='%23F58613'/%3E%3Cstop offset='.823' stop-color='%23F88909'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M30.1 0L0 31.7 0 60 30.1 29.9 60 0z'/%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-kotlin._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-kotlin._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-kotlin._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-kotlin._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-kotlin._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-mps { + background-image: url("data:image/svg+xml,%3Csvg data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 140 140'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='105.979' y1='186.085' x2='-27.244' y2='15.44' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.091' stop-color='%230b8fff'/%3E%3Cstop offset='.208' stop-color='%230d94f6'/%3E%3Cstop offset='.396' stop-color='%2311a3de'/%3E%3Cstop offset='.633' stop-color='%2318bbb7'/%3E%3Cstop offset='.871' stop-color='%2321d789'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='178.605' y1='129.386' x2='45.382' y2='-41.259' xlink:href='%23a'/%3E%3ClinearGradient id='c' x1='78.586' y1='105.516' x2='126.297' y2='-22.788' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.123' stop-color='%2321d789'/%3E%3Cstop offset='.132' stop-color='%2327d788'/%3E%3Cstop offset='.216' stop-color='%2359d87b'/%3E%3Cstop offset='.303' stop-color='%2385d970'/%3E%3Cstop offset='.394' stop-color='%23abda67'/%3E%3Cstop offset='.487' stop-color='%23cadb5f'/%3E%3Cstop offset='.585' stop-color='%23e1db59'/%3E%3Cstop offset='.688' stop-color='%23f2dc55'/%3E%3Cstop offset='.802' stop-color='%23fcdc53'/%3E%3Cstop offset='.946' stop-color='%23ffdc52'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ctitle%3Emps_logo%3C/title%3E%3Cpath fill='url(%23a)' d='M0 140L140 140 70 70 0 0 0 140z'/%3E%3Cpath data-name='<Path>' fill='url(%23b)' d='M140 140L70 70 140 0 140 140z'/%3E%3Cpath data-name='<Path>' fill='url(%23c)' d='M102 102L70 70 140 0 102 102z'/%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-mps._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-mps._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-mps._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-mps._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-mps._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-phpstorm { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='.558' y1='46.846' x2='29.947' y2='8.026'%3E%3Cstop offset='.016' stop-color='%23765AF8'/%3E%3Cstop offset='.382' stop-color='%23B345F1'/%3E%3Cstop offset='.758' stop-color='%23FA3293'/%3E%3Cstop offset='.941' stop-color='%23FF318C'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M39.6 15.2L36.3 5.2 11.9 0 0 13.5 37.2 32.5z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='2.73' y1='48.379' x2='32.072' y2='9.621'%3E%3Cstop offset='.016' stop-color='%23765AF8'/%3E%3Cstop offset='.382' stop-color='%23B345F1'/%3E%3Cstop offset='.758' stop-color='%23FA3293'/%3E%3Cstop offset='.941' stop-color='%23FF318C'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M28 41.4L27.3 20.6 0 13.5 6.7 53.6 28 53.4z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='50.857' y1='46.405' x2='34.274' y2='7.048'%3E%3Cstop offset='.183' stop-color='%23765AF8'/%3E%3Cstop offset='.238' stop-color='%238655F6'/%3E%3Cstop offset='.345' stop-color='%239F4CF3'/%3E%3Cstop offset='.443' stop-color='%23AE47F2'/%3E%3Cstop offset='.522' stop-color='%23B345F1'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M22.1 41L23.4 24.5 43.2 4.2 60.9 7.4 70 30.1 60.5 39.5 45 37 35.4 47.1z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='63.266' y1='57.339' x2='24.698' y2='27.516'%3E%3Cstop offset='.016' stop-color='%23765AF8'/%3E%3Cstop offset='.382' stop-color='%23B345F1'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M43.2 4.2L14.8 29.4 20.3 61.8 43.9 70 70 54.4z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath d='M17.3,19h7.3c4.3,0,6.9,2.5,6.9,6.2v0.1c0,4.2-3.2,6.3-7.3,6.3h-3l0,5.4h-3.9L17.3,19z M24.4,28 c2,0,3.1-1.2,3.1-2.7v-0.1c0-1.8-1.2-2.7-3.2-2.7h-3V28H24.4z' fill='%23FFF'/%3E%3Cpath d='M32.5,34.4l2.3-2.8c1.6,1.3,3.3,2.2,5.4,2.2c1.6,0,2.6-0.6,2.6-1.7V32c0-1-0.6-1.5-3.6-2.3 c-3.6-0.9-6-1.9-6-5.5v-0.1c0-3.3,2.6-5.4,6.3-5.4c2.6,0,4.9,0.8,6.7,2.3l-2.1,3c-1.6-1.1-3.2-1.8-4.7-1.8c-1.5,0-2.3,0.7-2.3,1.6 v0.1c0,1.2,0.8,1.6,3.9,2.4c3.6,1,5.7,2.3,5.7,5.4v0.1c0,3.6-2.7,5.6-6.6,5.6C37.4,37.3,34.7,36.3,32.5,34.4' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-phpstorm._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-phpstorm._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-phpstorm._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-phpstorm._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-phpstorm._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-pycharm { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='24.998' y1='27.046' x2='66.656' y2='27.046'%3E%3Cstop offset='0' stop-color='%2321D789'/%3E%3Cstop offset='1' stop-color='%2307C3F2'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M49.1 11L69.5 28.1 62.2 43 49.8 39.6 39.2 39.6z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='-24.559' y1='59.081' x2='61.22' y2='-4.241'%3E%3Cstop offset='.011' stop-color='%23FCF84A'/%3E%3Cstop offset='.112' stop-color='%23A7EB62'/%3E%3Cstop offset='.206' stop-color='%235FE077'/%3E%3Cstop offset='.273' stop-color='%2332DA84'/%3E%3Cstop offset='.306' stop-color='%2321D789'/%3E%3Cstop offset='.577' stop-color='%2321D789'/%3E%3Cstop offset='.597' stop-color='%2321D789'/%3E%3Cstop offset='.686' stop-color='%2320D68C'/%3E%3Cstop offset='.763' stop-color='%231ED497'/%3E%3Cstop offset='.835' stop-color='%2319D1A9'/%3E%3Cstop offset='.904' stop-color='%2313CCC2'/%3E%3Cstop offset='.971' stop-color='%230BC6E1'/%3E%3Cstop offset='1' stop-color='%2307C3F2'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M28.5 22.1L24.5 43 24.1 50.2 14.2 54.5 0 56 4.3 10.7 29.9 0 45.7 10.4z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='9.33' y1='77.654' x2='23.637' y2='32.76'%3E%3Cstop offset='0' stop-color='%2321D789'/%3E%3Cstop offset='.164' stop-color='%2324D788'/%3E%3Cstop offset='.305' stop-color='%232FD886'/%3E%3Cstop offset='.437' stop-color='%2341DA82'/%3E%3Cstop offset='.564' stop-color='%235ADC7D'/%3E%3Cstop offset='.688' stop-color='%237AE077'/%3E%3Cstop offset='.809' stop-color='%23A1E36E'/%3E%3Cstop offset='.925' stop-color='%23CFE865'/%3E%3Cstop offset='1' stop-color='%23F1EB5E'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M28.5 22.1L30.4 62.5 24 70 0 56 19.7 26.6z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='28.275' y1='38.623' x2='59.409' y2='-3.236'%3E%3Cstop offset='0' stop-color='%2321D789'/%3E%3Cstop offset='.061' stop-color='%2324D788'/%3E%3Cstop offset='.113' stop-color='%232FD886'/%3E%3Cstop offset='.162' stop-color='%2341DA82'/%3E%3Cstop offset='.209' stop-color='%235ADD7D'/%3E%3Cstop offset='.255' stop-color='%2379E077'/%3E%3Cstop offset='.258' stop-color='%237CE076'/%3E%3Cstop offset='.499' stop-color='%238CE173'/%3E%3Cstop offset='.925' stop-color='%23B2E56B'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M54.9 19.1L30.6 19.1 52.1 0z'/%3E%3ClinearGradient id='e' gradientUnits='userSpaceOnUse' x1='75.889' y1='43.95' x2='13.158' y2='43.369'%3E%3Cstop offset='.387' stop-color='%23FCF84A'/%3E%3Cstop offset='.536' stop-color='%23ECF451'/%3E%3Cstop offset='.826' stop-color='%23C2E964'/%3E%3Cstop offset='.925' stop-color='%23B2E56B'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23e)' d='M70 62.6L48.6 69.9 20.2 61.9 28.5 22.1 31.8 19.1 49.1 17.5 47.5 34.9 61.3 29.6z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath d='M17.3,19.1h7.3c4.3,0,6.9,2.5,6.9,6.2v0.1c0,4.1-3.2,6.3-7.2,6.3h-3V37h-3.9V19.1z M24.4,28.1 c2,0,3.1-1.2,3.1-2.7v-0.1c0-1.8-1.2-2.7-3.2-2.7h-3v5.5H24.4z' fill='%23FFF'/%3E%3Cpath d='M33.1,28.1L33.1,28.1c0-5.1,3.8-9.3,9.3-9.3c3.4,0,5.4,1.1,7.1,2.8l-2.5,2.9c-1.4-1.3-2.8-2-4.6-2 c-3,0-5.2,2.5-5.2,5.6V28c0,3.1,2.1,5.6,5.2,5.6c2,0,3.3-0.8,4.7-2.1l2.5,2.5c-1.8,2-3.9,3.2-7.3,3.2C37,37.3,33.1,33.2,33.1,28.1' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-pycharm._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-pycharm._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-pycharm._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-pycharm._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-pycharm._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-pycharm-edu { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='24.998' y1='27.046' x2='66.656' y2='27.046'%3E%3Cstop offset='0' stop-color='%2321D789'/%3E%3Cstop offset='1' stop-color='%2307C3F2'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M49.1 11L69.5 28.1 62.2 43 49.8 39.6 39.2 39.6z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='-24.559' y1='59.081' x2='61.22' y2='-4.241'%3E%3Cstop offset='.011' stop-color='%23FCF84A'/%3E%3Cstop offset='.112' stop-color='%23A7EB62'/%3E%3Cstop offset='.206' stop-color='%235FE077'/%3E%3Cstop offset='.273' stop-color='%2332DA84'/%3E%3Cstop offset='.306' stop-color='%2321D789'/%3E%3Cstop offset='.577' stop-color='%2321D789'/%3E%3Cstop offset='.597' stop-color='%2321D789'/%3E%3Cstop offset='.686' stop-color='%2320D68C'/%3E%3Cstop offset='.763' stop-color='%231ED497'/%3E%3Cstop offset='.835' stop-color='%2319D1A9'/%3E%3Cstop offset='.904' stop-color='%2313CCC2'/%3E%3Cstop offset='.971' stop-color='%230BC6E1'/%3E%3Cstop offset='1' stop-color='%2307C3F2'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M28.5 22.1L24.5 43 24.1 50.2 14.2 54.5 0 56 4.3 10.7 29.9 0 45.7 10.4z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='9.33' y1='77.654' x2='23.637' y2='32.76'%3E%3Cstop offset='0' stop-color='%2321D789'/%3E%3Cstop offset='.164' stop-color='%2324D788'/%3E%3Cstop offset='.305' stop-color='%232FD886'/%3E%3Cstop offset='.437' stop-color='%2341DA82'/%3E%3Cstop offset='.564' stop-color='%235ADC7D'/%3E%3Cstop offset='.688' stop-color='%237AE077'/%3E%3Cstop offset='.809' stop-color='%23A1E36E'/%3E%3Cstop offset='.925' stop-color='%23CFE865'/%3E%3Cstop offset='1' stop-color='%23F1EB5E'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M28.5 22.1L30.4 62.5 24 70 0 56 19.7 26.6z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='28.275' y1='38.623' x2='59.409' y2='-3.236'%3E%3Cstop offset='0' stop-color='%2321D789'/%3E%3Cstop offset='.061' stop-color='%2324D788'/%3E%3Cstop offset='.113' stop-color='%232FD886'/%3E%3Cstop offset='.162' stop-color='%2341DA82'/%3E%3Cstop offset='.209' stop-color='%235ADD7D'/%3E%3Cstop offset='.255' stop-color='%2379E077'/%3E%3Cstop offset='.258' stop-color='%237CE076'/%3E%3Cstop offset='.499' stop-color='%238CE173'/%3E%3Cstop offset='.925' stop-color='%23B2E56B'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M54.9 19.1L30.6 19.1 52.1 0z'/%3E%3ClinearGradient id='e' gradientUnits='userSpaceOnUse' x1='75.889' y1='43.95' x2='13.158' y2='43.369'%3E%3Cstop offset='.387' stop-color='%23FCF84A'/%3E%3Cstop offset='.536' stop-color='%23ECF451'/%3E%3Cstop offset='.826' stop-color='%23C2E964'/%3E%3Cstop offset='.925' stop-color='%23B2E56B'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23e)' d='M70 62.6L48.6 69.9 20.2 61.9 28.5 22.1 31.8 19.1 49.1 17.5 47.5 34.9 61.3 29.6z'/%3E%3Cg%3E%3Cpath d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath d='M17.3,19.1h7.3c4.3,0,6.9,2.5,6.9,6.2v0.1c0,4.1-3.2,6.3-7.2,6.3h-3V37h-3.9V19.1z M24.4,28.1 c2,0,3.1-1.2,3.1-2.7v-0.1c0-1.8-1.2-2.7-3.2-2.7h-3v5.5H24.4z' fill='%23FFF'/%3E%3Cpath d='M33.6,19.1h13.5v3.5h-9.6v3.6H46v3.5h-8.4v3.8h9.7V37H33.6V19.1z' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-pycharm-edu._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-pycharm-edu._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-pycharm-edu._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-pycharm-edu._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-pycharm-edu._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-rider { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='70.226' y1='27.799' x2='-5.13' y2='63.122' gradientTransform='matrix(1 0 0 -1 0 71.28)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23c90f5e'/%3E%3Cstop offset='.221' stop-color='%23c90f5e'/%3E%3Cstop offset='.236' stop-color='%23c90f5e'/%3E%3Cstop offset='.356' stop-color='%23ca135c'/%3E%3Cstop offset='.466' stop-color='%23ce1e57'/%3E%3Cstop offset='.574' stop-color='%23d4314e'/%3E%3Cstop offset='.678' stop-color='%23dc4b41'/%3E%3Cstop offset='.782' stop-color='%23e66d31'/%3E%3Cstop offset='.883' stop-color='%23f3961d'/%3E%3Cstop offset='.942' stop-color='%23fcb20f'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='24.659' y1='61.996' x2='46.048' y2='2.934' gradientTransform='matrix(1 0 0 -1 0 71.28)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.042' stop-color='%23077cfb'/%3E%3Cstop offset='.445' stop-color='%23c90f5e'/%3E%3Cstop offset='.958' stop-color='%23077cfb'/%3E%3C/linearGradient%3E%3ClinearGradient id='c' x1='17.396' y1='63.346' x2='33.194' y2='7.201' gradientTransform='matrix(1 0 0 -1 0 71.28)' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.277' stop-color='%23c90f5e'/%3E%3Cstop offset='.974' stop-color='%23fcb20f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ctitle%3Erider%3C/title%3E%3Cpath fill='url(%23a)' d='M70 27.237L63.391 23.75 20.926 0 3.827 17.921 21.619 41.068 60.537 44.397 70 27.237z'/%3E%3Cpath fill='url(%23b)' d='M50.423 16.132L44.271 1.107 27.643 17.471 11.768 50.194 49.411 70 70 57.98 50.423 16.132z'/%3E%3Cpath fill='url(%23c)' d='M20.926 0L0 14.095 7.779 62.172 27.848 69.889 53.78 48.823 20.926 0z'/%3E%3Cg%3E%3Cpath d='M13.302 13.193H56.916V56.806999999999995H13.302z'/%3E%3Cg fill='%23fff'%3E%3Cpath d='M17.22741,18.86293h8.39564a7.38416,7.38416,0,0,1,5.34268,1.85358,5.86989,5.86989,0,0,1,1.52648,4.1433h0A5.74339,5.74339,0,0,1,28.567,30.5296l4.47041,6.54206H28.34891L24.42368,31.1838h-3.162v5.88785H17.22741V18.86293h0ZM25.296,27.69471c1.96262,0,3.053-1.09034,3.053-2.61682h0c0-1.74455-1.19938-2.61682-3.162-2.61682H21.15265v5.23365H25.296Z'/%3E%3Cpath d='M36.09034,18.86293H43.2866c5.77882,0,9.70405,3.92523,9.70405,9.15888h0c0,5.12461-3.92523,9.15888-9.70405,9.15888H36.09034V18.86293Zm4.03427,3.59813V33.47352h3.162a5.23727,5.23727,0,0,0,5.56075-5.45171h0a5.26493,5.26493,0,0,0-5.56075-5.56075h-3.162Z'/%3E%3C/g%3E%3Cpath fill='%23fff' d='M17.227 48.629H33.582V51.355H17.227z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-rider._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-rider._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-rider._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-rider._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-rider._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-resharper { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='22.945' y1='75.787' x2='74.787' y2='20.642'%3E%3Cstop offset='.016' stop-color='%23B35BA3'/%3E%3Cstop offset='.404' stop-color='%23C41E57'/%3E%3Cstop offset='.468' stop-color='%23C41E57'/%3E%3Cstop offset='.65' stop-color='%23EB8523'/%3E%3Cstop offset='.952' stop-color='%23FEBD11'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M49.8 15.2L36 36.7 58.4 70 70 23.1z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='17.719' y1='73.292' x2='69.556' y2='18.152'%3E%3Cstop offset='.016' stop-color='%23B35BA3'/%3E%3Cstop offset='.404' stop-color='%23C41E57'/%3E%3Cstop offset='.468' stop-color='%23C41E57'/%3E%3Cstop offset='.704' stop-color='%23EB8523'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M51.1 15.7L49 0 18.8 33.6 27.6 42.3 20.8 70 58.4 70z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='1.828' y1='53.428' x2='48.825' y2='9.226'%3E%3Cstop offset='.016' stop-color='%23B35BA3'/%3E%3Cstop offset='.661' stop-color='%23C41E57'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M49 0L11.6 0 0 47.1 55.6 47.1z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='49.894' y1='-11.557' x2='48.859' y2='24.035'%3E%3Cstop offset='.5' stop-color='%23C41E57'/%3E%3Cstop offset='.667' stop-color='%23D13F48'/%3E%3Cstop offset='.795' stop-color='%23D94F39'/%3E%3Cstop offset='.866' stop-color='%23DD5433'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23d)' d='M55.3 47.1L51.1 15.7 49 0 41.7 23z'/%3E%3Cg%3E%3Cpath transform='matrix(-1 .00258 -.00258 -1 70.029 70.081)' fill='%23000' d='M13.4 13.5H56.6V56.7H13.4z'/%3E%3Cpath transform='rotate(-.148 25.676 49.97)' fill='%23FFF' d='M17.6 48.6H33.8V51.300000000000004H17.6z'/%3E%3Cpath d='M17.4,19.1l8.2,0c2.3,0,4,0.6,5.2,1.8c1,1,1.5,2.4,1.5,4.1l0,0.1c0,1.5-0.3,2.6-1.1,3.5 c-0.7,0.9-1.6,1.6-2.8,2l4.4,6.4l-4.6,0l-3.7-5.5l-3.3,0l0,5.5l-3.9,0L17.4,19.1z M25.3,27.8c1,0,1.7-0.2,2.2-0.7 c0.5-0.5,0.8-1.1,0.8-1.8l0-0.1c0-0.9-0.3-1.5-0.8-1.9c-0.5-0.4-1.3-0.6-2.3-0.6l-3.9,0l0,5.1L25.3,27.8z' fill='%23FFF'/%3E%3Cpath d='M36,33.2l-1.9,0l0-3.3l2.5,0l0.6-3.8l-2.3,0l0-3.3l2.8,0l0.6-3.7l3.4,0l-0.6,3.7l3.7,0l0.6-3.7 l3.4,0l-0.6,3.7l1.9,0l0,3.3l-2.5,0L47,29.9l2.3,0l0,3.3l-2.8,0L45.8,37l-3.4,0l0.7-3.8l-3.7,0L38.7,37l-3.4,0L36,33.2z M43.7,29.9l0.6-3.8l-3.7,0L40,29.9L43.7,29.9z' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-resharper._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-resharper._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-resharper._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-resharper._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-resharper._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-resharper-cpp { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='8.063' y1='16.141' x2='29.26' y2='69.757'%3E%3Cstop offset='.22' stop-color='%23C40B55'/%3E%3Cstop offset='.683' stop-color='%23E343E6'/%3E%3Cstop offset='.925' stop-color='%23F59252'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M20.2 15.2L34 36.7 11.6 70 0 23.1z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='875.719' y1='73.292' x2='927.556' y2='18.152' gradientTransform='matrix(-1 0 0 1 928 0)'%3E%3Cstop offset='.113' stop-color='%23FFBD00'/%3E%3Cstop offset='.586' stop-color='%23E343E6'/%3E%3Cstop offset='.817' stop-color='%23EC841B'/%3E%3Cstop offset='.935' stop-color='%23FFBD00'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M18.9 15.7L21 0 51.2 33.6 42.4 42.3 49.2 70 11.6 70z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='25.5' y1='-1.93' x2='69.96' y2='51.168'%3E%3Cstop offset='.129' stop-color='%23FFBD00'/%3E%3Cstop offset='.64' stop-color='%23E343E6'/%3E%3Cstop offset='.909' stop-color='%23C40B55'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M35.3 47.1L70 47.1 58.4 0 21 0z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath d='M17.4,19h8.2c2.3,0,4,0.6,5.2,1.8c1,1,1.5,2.4,1.5,4.1V25c0,1.5-0.4,2.6-1.1,3.5 c-0.7,0.9-1.6,1.6-2.8,2l4.4,6.4h-4.6l-3.7-5.5h-3.3l0,5.5h-3.9V19z M25.4,27.7c1,0,1.7-0.2,2.2-0.7c0.5-0.5,0.8-1.1,0.8-1.8 v-0.1c0-0.9-0.3-1.5-0.8-1.9c-0.5-0.4-1.3-0.6-2.3-0.6h-3.9v5.1H25.4z' fill='%23FFF'/%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3Cg%3E%3Cpath d='M43.7,24.4h-4v-3.6h4v-4h3.7v4h4v3.6h-4v4h-3.7V24.4z' fill='%23FFF'/%3E%3C/g%3E%3Cg%3E%3Cpath d='M37.1,34.6h-4V31h4v-4h3.7v4h4v3.6h-4v4h-3.7V34.6z' fill='%23FFF'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-resharper-cpp._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-resharper-cpp._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-resharper-cpp._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-resharper-cpp._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-resharper-cpp._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-rubymine { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='49.609' y1='52.554' x2='30.346' y2='7.163'%3E%3Cstop offset='.172' stop-color='%23FF1F51'/%3E%3Cstop offset='.28' stop-color='%23FF3648'/%3E%3Cstop offset='.468' stop-color='%23FF593B'/%3E%3Cstop offset='.646' stop-color='%23FF7231'/%3E%3Cstop offset='.809' stop-color='%23FF812B'/%3E%3Cstop offset='.941' stop-color='%23FF8629'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M58.2 0L38.2 7.2 22.4 0 6.9 38.9 24.7 31.8 24.4 51.5 62.5 52.2 70 13.7z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='33.259' y1='12.887' x2='25.105' y2='33.436'%3E%3Cstop offset='.022' stop-color='%239039D0'/%3E%3Cstop offset='.629' stop-color='%23FF1F51'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M50.8 22.7L25.6 6.2 5.3 18.7 49.8 35.9z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='.29' y1='11.224' x2='45.284' y2='68.42'%3E%3Cstop offset='.107' stop-color='%239039D0'/%3E%3Cstop offset='.387' stop-color='%23FF1F51'/%3E%3Cstop offset='.629' stop-color='%23FF1F51'/%3E%3Cstop offset='.66' stop-color='%23FF3648'/%3E%3Cstop offset='.714' stop-color='%23FF593B'/%3E%3Cstop offset='.765' stop-color='%23FF7231'/%3E%3Cstop offset='.812' stop-color='%23FF812B'/%3E%3Cstop offset='.85' stop-color='%23FF8629'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M29.1 68.2L55.3 64.7 47 48.7 52.5 42 53.1 37.9 25.6 6.1 0 12.4 0 49.1 14.8 70 29.1 68.2 29.1 68.2 29.1 68.2 29.1 68.2z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath fill='%23FFF' d='M34.6 19L38.9 19 43.6 26.6 48.3 19 52.6 19 52.6 36.9 48.6 36.9 48.6 25.2 43.6 32.9 43.5 32.9 38.5 25.3 38.5 36.9 34.6 36.9z'/%3E%3Cpath d='M17.4,19h8.2c2.3,0,4,0.6,5.2,1.8c1,1,1.5,2.4,1.5,4.1v0.1c0,1.5-0.4,2.6-1.1,3.5 c-0.7,0.9-1.6,1.6-2.8,2l4.4,6.4h-4.6l-3.7-5.5h-3.3l0,5.5h-3.9V19z M25.4,27.7c1,0,1.7-0.2,2.2-0.7c0.5-0.5,0.8-1.1,0.8-1.8v-0.1 c0-0.9-0.3-1.5-0.8-1.9c-0.5-0.4-1.3-0.6-2.3-0.6h-3.9v5.1H25.4z' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-rubymine._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-rubymine._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-rubymine._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-rubymine._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-rubymine._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-teamcity { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='1.774' y1='31.273' x2='40.166' y2='31.273'%3E%3Cstop offset='0' stop-color='%23905CFB'/%3E%3Cstop offset='.068' stop-color='%23776CF9'/%3E%3Cstop offset='.173' stop-color='%235681F7'/%3E%3Cstop offset='.286' stop-color='%233B92F5'/%3E%3Cstop offset='.41' stop-color='%23269FF4'/%3E%3Cstop offset='.547' stop-color='%2317A9F3'/%3E%3Cstop offset='.711' stop-color='%230FAEF2'/%3E%3Cstop offset='.968' stop-color='%230CB0F2'/%3E%3C/linearGradient%3E%3Cpath d='M39.7,47.9l-6.1-34c-0.4-2.4-1.2-4.8-2.7-7.1c-2-3.2-5.2-5.4-8.8-6.3 C7.9-2.9-2.6,11.3,3.6,23.9c0,0,0,0,0,0l14.8,31.7c0.4,1,1,2,1.7,2.9c1.2,1.6,2.8,2.8,4.7,3.4C34.4,64.9,42.1,56.4,39.7,47.9z' fill='url(%23a)'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='5.311' y1='9.669' x2='69.228' y2='43.866'%3E%3Cstop offset='0' stop-color='%23905CFB'/%3E%3Cstop offset='.068' stop-color='%23776CF9'/%3E%3Cstop offset='.173' stop-color='%235681F7'/%3E%3Cstop offset='.286' stop-color='%233B92F5'/%3E%3Cstop offset='.41' stop-color='%23269FF4'/%3E%3Cstop offset='.547' stop-color='%2317A9F3'/%3E%3Cstop offset='.711' stop-color='%230FAEF2'/%3E%3Cstop offset='.968' stop-color='%230CB0F2'/%3E%3C/linearGradient%3E%3Cpath d='M67.4,26.5c-1.4-2.2-3.4-3.9-5.7-4.9L25.5,1.7l0,0c-1-0.5-2.1-1-3.3-1.3 C6.7-3.2-4.4,13.8,5.5,27c1.5,2,3.6,3.6,6,4.5L48,47.9c0.8,0.5,1.6,0.8,2.5,1.1C64.5,53.4,75.1,38.6,67.4,26.5z' fill='url(%23b)'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='-19.284' y1='70.82' x2='55.983' y2='33.186'%3E%3Cstop offset='0' stop-color='%233BEA62'/%3E%3Cstop offset='.117' stop-color='%2331DE80'/%3E%3Cstop offset='.302' stop-color='%2324CEA8'/%3E%3Cstop offset='.484' stop-color='%231AC1C9'/%3E%3Cstop offset='.659' stop-color='%2312B7DF'/%3E%3Cstop offset='.824' stop-color='%230EB2ED'/%3E%3Cstop offset='.968' stop-color='%230CB0F2'/%3E%3C/linearGradient%3E%3Cpath d='M67.4,26.5c-1.8-2.8-4.6-4.8-7.9-5.6c-3.5-0.8-6.8-0.5-9.6,0.7L11.4,36.1 c0,0-0.2,0.1-0.6,0.4C0.9,40.4-4,53.3,4,64c1.8,2.4,4.3,4.2,7.1,5c5.3,1.6,10.1,1,14-1.1c0,0,0.1,0,0.1,0l37.6-20.1 c0,0,0,0,0.1-0.1C69.5,43.9,72.6,34.6,67.4,26.5z' fill='url(%23c)'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='38.944' y1='5.85' x2='5.423' y2='77.509'%3E%3Cstop offset='0' stop-color='%233BEA62'/%3E%3Cstop offset='.094' stop-color='%232FDB87'/%3E%3Cstop offset='.196' stop-color='%2324CEA8'/%3E%3Cstop offset='.306' stop-color='%231BC3C3'/%3E%3Cstop offset='.426' stop-color='%2314BAD8'/%3E%3Cstop offset='.56' stop-color='%2310B5E7'/%3E%3Cstop offset='.719' stop-color='%230DB1EF'/%3E%3Cstop offset='.968' stop-color='%230CB0F2'/%3E%3C/linearGradient%3E%3Cpath d='M50.3,12.8c1.2-2.7,1.1-6-0.9-9c-1.1-1.8-2.9-3-4.9-3.5c-4.5-1.1-8.3,1-10.1,4.2L3.5,42 c0,0,0,0,0,0.1C-0.9,47.9-1.6,56.5,4,64c1.8,2.4,4.3,4.2,7.1,5c10.5,3.3,19.3-2.5,22.1-10.8L50.3,12.8z' fill='url(%23d)'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath fill='%23FFF' d='M22.9 22.7L17.5 22.7 17.5 19.1 32.3 19.1 32.3 22.7 26.8 22.7 26.8 37 22.9 37z'/%3E%3Cpath d='M32.5,28.1L32.5,28.1c0-5.1,3.8-9.3,9.3-9.3c3.4,0,5.4,1.1,7.1,2.8l-2.5,2.9c-1.4-1.3-2.8-2-4.6-2 c-3,0-5.2,2.5-5.2,5.6V28c0,3.1,2.1,5.6,5.2,5.6c2,0,3.3-0.8,4.7-2.1l2.5,2.5c-1.8,2-3.9,3.2-7.3,3.2 C36.4,37.3,32.5,33.2,32.5,28.1' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-teamcity._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-teamcity._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-teamcity._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-teamcity._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-teamcity._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-toolbox { + background-image: url("data:image/svg+xml,%3Csvg data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='2.18' y1='23.255' x2='30.041' y2='8.782' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='.043' stop-color='%23ff8618'/%3E%3Cstop offset='.382' stop-color='%23ff246e'/%3E%3Cstop offset='.989' stop-color='%23af1df5'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ctitle%3EToolBox_trayIcon_colour_32-01%3C/title%3E%3Cpath d='M26,22.4713l-6.83,3.8311V23.2578L26,19.4268v3.0445Z' fill='%23fff'/%3E%3Cpath fill='%23000001' d='M16 32.076L30 24.065 30 8.057 16 16.067 16 32.076z'/%3E%3Cpath fill='%23fff' d='M18.925 24.641L18.925 27.041 25.026 23.55 25.026 21.15 18.925 24.641z'/%3E%3Cpath fill='url(%23a)' d='M16 0.076L2 8.057 2 8.057 2 8.057 2 24.065 16 32.076 16 16.067 30 8.057 16 0.076z'/%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-toolbox._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-toolbox._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-toolbox._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-toolbox._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-toolbox._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-upsource { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='64.913' y1='54.385' x2='17.513' y2='47.275' gradientTransform='matrix(1 0 0 -1 0 65.395)'%3E%3Cstop offset='0' stop-color='%23FF8200'/%3E%3Cstop offset='.973' stop-color='%23905CFB'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M60.5 24L9.6 26.9 9.3 7.4 55.2 0.2z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='15.675' y1='30.593' x2='20.093' y2='55.275' gradientTransform='matrix(1 0 0 -1 0 65.395)'%3E%3Cstop offset='0' stop-color='%230CB0F2'/%3E%3Cstop offset='.973' stop-color='%23905CFB'/%3E%3C/linearGradient%3E%3Cpath d='M20.3,43.2l16.4-20.8L18.9,10.2l0,0c-3.1-2.8-7.8-4-12.6-2c-2.4,1-4.3,2.9-5.3,5.3 c-2.1,5-0.8,9.9,2.4,12.9l0,0L20.3,43.2z' fill='url(%23b)'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='58.335' y1='11.729' x2='26.978' y2='27.043' gradientTransform='matrix(1 0 0 -1 0 65.395)'%3E%3Cstop offset='0' stop-color='%230CB0F2'/%3E%3Cstop offset='.973' stop-color='%23905CFB'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M20.3 43.2L45.5 68.1 61.2 38.8 36.7 22.4z'/%3E%3ClinearGradient id='d' gradientUnits='userSpaceOnUse' x1='60.678' y1='9.337' x2='7.352' y2='28.508' gradientTransform='matrix(1 0 0 -1 0 65.395)'%3E%3Cstop offset='0' stop-color='%230CB0F2'/%3E%3Cstop offset='.973' stop-color='%23905CFB'/%3E%3C/linearGradient%3E%3Cpath d='M53.9,36.6L53.9,36.6l-41.9-2l0,0c-1.6-0.3-3.4-0.2-5.3,0.6c-1.8,0.8-3.2,2.1-3.9,3.9 c-2.1,4.9,0.4,9.6,4.5,11.2l0,0L44.8,68c0.5,0.3,3,1,3,1c2,0.6,4.2,0.9,6.2,0.9c2.5,0,5.3-0.7,8.1-2.1c2.6-1.3,4.2-3.4,5.6-6 c1.7-3,2.2-5.8,2.2-8.6C69.8,44.5,62.6,37.2,53.9,36.6z' fill='url(%23d)'/%3E%3ClinearGradient id='e' gradientUnits='userSpaceOnUse' x1='64.194' y1='59.46' x2='18.524' y2='22.651' gradientTransform='matrix(1 0 0 -1 0 65.395)'%3E%3Cstop offset='0' stop-color='%23FF8200'/%3E%3Cstop offset='.973' stop-color='%23905CFB'/%3E%3C/linearGradient%3E%3Cpath d='M52.1,1.1c-0.7,0.3-1.4,0.7-2,1.1l0,0L26.9,19.7l11.5,16.8l25.2-14.1 c1.9-0.9,3.4-2.5,4.3-4.3C73.5,7.3,63.1-3.5,52.1,1.1z' fill='url(%23e)'/%3E%3Cpath fill='%23905CFB' d='M14.5 49.8L38.4 36.5 26.9 19.7 4.9 36.2z'/%3E%3ClinearGradient id='f' gradientUnits='userSpaceOnUse' x1='30.448' y1='16.152' x2='2.265' y2='26.168' gradientTransform='matrix(1 0 0 -1 0 65.395)'%3E%3Cstop offset='0' stop-color='%230CB0F2'/%3E%3Cstop offset='.973' stop-color='%23905CFB'/%3E%3C/linearGradient%3E%3Cpath d='M20.4,56.4V35L12,34.6H12c-1.6-0.3-3.4-0.2-5.3,0.6c-1.8,0.8-3.2,2.1-3.9,3.9 c-2.1,4.9,0.4,9.6,4.5,11.2h0.1L20.4,56.4z' fill='url(%23f)'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cg fill='%23FFF'%3E%3Cpath d='M17.5,29.4V19h4v10.3c0,3,1.5,4.5,3.9,4.5s3.9-1.5,3.9-4.4V19h4v10.2c0,5.5-3.1,8.2-8,8.2 C20.5,37.5,17.5,34.7,17.5,29.4z'/%3E%3Cpath d='M35.4,19h7.4c4.3,0,6.9,2.6,6.9,6.3v0.1c0,4.2-3.3,6.4-7.3,6.4h-3v5.4h-4V19z M42.6,28.2 c2,0,3.2-1.2,3.2-2.7v-0.1c0-1.8-1.2-2.7-3.2-2.7h-3.1v5.5H42.6z'/%3E%3C/g%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-upsource._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-upsource._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-upsource._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-upsource._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-upsource._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-webstorm { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='25.068' y1='1.46' x2='43.183' y2='66.675'%3E%3Cstop offset='.285' stop-color='%2300CDD7'/%3E%3Cstop offset='.941' stop-color='%232086D7'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23a)' d='M9.4 63.3L0 7.3 17.5 0.1 28.6 6.7 38.8 1.2 60.1 9.4 48.1 70z'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='30.72' y1='9.734' x2='61.365' y2='54.671'%3E%3Cstop offset='.14' stop-color='%23FFF045'/%3E%3Cstop offset='.366' stop-color='%2300CDD7'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23b)' d='M70 23.7L61 1.4 44.6 0 19.3 24.3 26.1 55.6 38.8 64.6 70 46 62.3 31.7z'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='61.082' y1='15.29' x2='65.106' y2='29.544'%3E%3Cstop offset='.285' stop-color='%2300CDD7'/%3E%3Cstop offset='.941' stop-color='%232086D7'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23c)' d='M56 20.4L62.3 31.7 70 23.7 64.4 9.8z'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.5 48.5H33.7V51.2H17.5z'/%3E%3Cpath d='M38.7,34.3l2.3-2.8c1.6,1.3,3.3,2.2,5.3,2.2c1.6,0,2.5-0.6,2.5-1.7v-0.1c0-1-0.6-1.5-3.6-2.3 c-3.6-0.9-5.8-1.9-5.8-5.5v-0.1c0-3.3,2.6-5.4,6.2-5.4c2.6,0,4.8,0.8,6.6,2.3l-2,3c-1.6-1.1-3.1-1.8-4.6-1.8 c-1.5,0-2.3,0.7-2.3,1.6v0.1c0,1.2,0.8,1.6,3.8,2.4c3.6,1,5.6,2.3,5.6,5.4v0.1c0,3.6-2.7,5.6-6.5,5.6 C43.5,37.2,40.8,36.2,38.7,34.3' fill='%23FFF'/%3E%3Cpath fill='%23FFF' d='M35.2 19L32.5 29.4 29.5 19 26.5 19 23.4 29.4 20.7 19 16.6 19 21.7 36.9 25 36.9 28 26.5 30.9 36.9 34.3 36.9 39.4 19z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-webstorm._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-webstorm._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-webstorm._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-webstorm._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-webstorm._size-5 { + width: 150px; + height: 150px +} + +.jetbrains-logo._logo-youtrack { + background-image: url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0' y='0' width='70' height='70' viewBox='0 0 70 70' xml:space='preserve'%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='7.083' y1='16.294' x2='64.106' y2='42.288' gradientTransform='matrix(1 0 0 -1 0 71.047)'%3E%3Cstop offset='0' stop-color='%23905CFB'/%3E%3Cstop offset='.165' stop-color='%236677F8'/%3E%3Cstop offset='.378' stop-color='%233596F5'/%3E%3Cstop offset='.54' stop-color='%2317A9F3'/%3E%3Cstop offset='.632' stop-color='%230CB0F2'/%3E%3C/linearGradient%3E%3Cpath d='M66.9,47.5c-0.2-0.2-13.1-12.6-13.1-12.6s9.8-10.4,12.4-13c0.8-0.8,1.5-1.6,2-2.6 c3.6-6.1,1.5-13.9-4.6-17.5c-4.5-2.6-10.1-2.2-14.1,0.8c-0.7,0.5-1.3,1-1.9,1.6C47.3,4.6,33.7,17,21.9,27.8l22.1,14L20.8,67.9 c-1.4,1-2.8,1.6-4.3,1.9c0.3,0,0.5,0,0.8-0.1c4.6-0.7,43.9-7.3,45.8-7.7c2.3-0.4,4.4-1.8,5.7-3.9C71,54.5,70,50,66.9,47.5z' fill='url(%23a)'/%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='30.31' y1='42.916' x2='1.068' y2='68.744' gradientTransform='matrix(1 0 0 -1 0 71.047)'%3E%3Cstop offset='0' stop-color='%23905CFB'/%3E%3Cstop offset='.072' stop-color='%23A554E6'/%3E%3Cstop offset='.252' stop-color='%23D641B5'/%3E%3Cstop offset='.39' stop-color='%23F43597'/%3E%3Cstop offset='.468' stop-color='%23FF318C'/%3E%3C/linearGradient%3E%3Cpath d='M45.9,30.5c-0.4-2.7-1.8-4.9-3.8-6.5C40,22.4,23.8,5.6,22,3.7C19.2,1,15.2-0.5,11.1,0.2 C4.1,1.2-0.8,7.8,0.3,14.8c0.5,3.5,2.5,6.5,5.1,8.4c2.6,2,23,16,24.3,17c2.1,1.6,4.9,2.5,7.7,2C42.9,41.2,46.8,36,45.9,30.5z' fill='url(%23b)'/%3E%3ClinearGradient id='c' gradientUnits='userSpaceOnUse' x1='4.983' y1='12.362' x2='74.023' y2='55.864' gradientTransform='matrix(1 0 0 -1 0 71.047)'%3E%3Cstop offset='0' stop-color='%23905CFB'/%3E%3Cstop offset='.165' stop-color='%236677F8'/%3E%3Cstop offset='.378' stop-color='%233596F5'/%3E%3Cstop offset='.54' stop-color='%2317A9F3'/%3E%3Cstop offset='.632' stop-color='%230CB0F2'/%3E%3C/linearGradient%3E%3Cpath d='M23,67.8c0.1,0,23.3-26.1,23.3-26.1L22.9,26.9c-8.3,7.6-16,14.5-17.8,16.2 c-1.1,1-2.2,2.3-3,3.7c-4.3,7.4-1.8,16.8,5.6,21.1C10.7,69.6,17.5,71.7,23,67.8z' fill='url(%23c)'/%3E%3Cg%3E%3Cpath fill='%23000' d='M13.4 13.4H56.6V56.6H13.4z'/%3E%3Cpath fill='%23FFF' d='M17.4 48.5H33.599999999999994V51.2H17.4z'/%3E%3Cpath fill='%23FFF' d='M23.8 29.9L17 19.1 21.6 19.1 25.8 26.2 30.2 19.1 34.7 19.1 27.8 29.8 27.8 37 23.8 37z'/%3E%3Cpath fill='%23FFF' d='M41.6 22.7L36.1 22.7 36.1 19.1 51 19.1 51 22.7 45.5 22.7 45.5 37 41.6 37z'/%3E%3C/g%3E%3C/svg%3E") +} + +.jetbrains-logo._logo-youtrack._size-1 { + width: 40px; + height: 40px +} + +.jetbrains-logo._logo-youtrack._size-2 { + width: 60px; + height: 60px +} + +.jetbrains-logo._logo-youtrack._size-3 { + width: 75px; + height: 75px +} + +.jetbrains-logo._logo-youtrack._size-4 { + width: 100px; + height: 100px +} + +.jetbrains-logo._logo-youtrack._size-5 { + width: 150px; + height: 150px +} \ No newline at end of file diff --git a/web/settings.gradle.kts b/web/settings.gradle.kts index 72460b2de7..dfefd2512e 100644 --- a/web/settings.gradle.kts +++ b/web/settings.gradle.kts @@ -28,6 +28,7 @@ fun module(name: String, path: String) { project(name).projectDir = file(path) } + module(":web-core", "$rootDir/core") module(":web-widgets", "$rootDir/widgets") module(":web-integration-core", "$rootDir/integration-core") @@ -35,6 +36,14 @@ module(":web-integration-widgets", "$rootDir/integration-widgets") module(":web-benchmark-core", "$rootDir/benchmark-core") module(":compose-compiler-integration", "$rootDir/compose-compiler-integration") +module(":samples:falling_balls_with_web", "samples/falling_balls_with_web") +module(":samples:compose-web-lp", "samples/web_landing") +module(":samples:web-compose-bird", "samples/web-compose-bird") +module(":samples:web-with-react", "samples/web-with-react") +module(":samples:web-getting-started", "samples/web-getting-started") + + + if (extra["compose.web.buildSamples"]!!.toString().toBoolean() == true) { println("building with examples") module(":examples:falling_balls_with_web", "../examples/falling_balls_with_web")