diff --git a/app/src/main/resources/welcome/intro/long.svg b/app/src/main/resources/welcome/intro/long.svg
new file mode 100644
index 000000000..19fba5426
--- /dev/null
+++ b/app/src/main/resources/welcome/intro/long.svg
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/app/src/main/resources/welcome/intro/short.svg b/app/src/main/resources/welcome/intro/short.svg
new file mode 100644
index 000000000..d08759c01
--- /dev/null
+++ b/app/src/main/resources/welcome/intro/short.svg
@@ -0,0 +1,17 @@
+
diff --git a/app/src/processing/app/ui/Welcome.kt b/app/src/processing/app/ui/Welcome.kt
index 8743282d6..698f2bb1e 100644
--- a/app/src/processing/app/ui/Welcome.kt
+++ b/app/src/processing/app/ui/Welcome.kt
@@ -1,11 +1,27 @@
package processing.app.ui
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.sizeIn
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.*
+import androidx.compose.foundation.lazy.grid.GridCells
+import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material.MaterialTheme
+import androidx.compose.material.MaterialTheme.colors
+import androidx.compose.material.MaterialTheme.typography
+import androidx.compose.material.Text
import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.graphics.Brush
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import processing.app.Base
+import processing.app.ui.theme.LocalLocale
+import processing.app.ui.theme.PDEButton
import processing.app.ui.theme.PDEWindow
import processing.app.ui.theme.pdeapplication
import java.io.IOException
@@ -22,7 +38,129 @@ class Welcome @Throws(IOException::class) constructor(base: Base) {
companion object {
@Composable
fun welcome() {
- Box(modifier = Modifier.sizeIn(815.dp, 450.dp)){
+ Row(
+ modifier = Modifier
+// .background(
+// Brush.linearGradient(
+// colorStops = arrayOf(0.0f to Color.Transparent, 1f to Color.Blue),
+// start = Offset(815f / 2, 0f),
+// end = Offset(815f, 450f)
+// )
+// )
+ .size(815.dp, 450.dp)
+ .padding(32.dp)
+
+ ,
+ horizontalArrangement = Arrangement.spacedBy(32.dp)
+ ){
+ Box(modifier = Modifier
+ .weight(1f)
+ .fillMaxHeight()
+ ){
+ intro()
+ }
+ Column(modifier = Modifier
+ .weight(1.25f)
+ .fillMaxHeight(),
+ verticalArrangement = Arrangement.SpaceBetween
+ ){
+ examples()
+ val locale = LocalLocale.current
+ Column(
+ verticalArrangement = Arrangement.spacedBy(16.dp)
+ ) {
+ Text(
+ text = locale["welcome.action.examples"],
+ )
+ Text(
+ text = locale["welcome.action.tutorials"],
+ )
+ }
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceBetween,
+ verticalAlignment = Alignment.CenterVertically
+ ){
+ Text(
+ text = locale["welcome.action.startup"],
+ )
+ PDEButton(onClick = { println("Open") }) {
+ val locale = LocalLocale.current
+ Text(locale["welcome.action.go"])
+ }
+ }
+ }
+ }
+ }
+
+ @Composable
+ fun intro(){
+ val locale = LocalLocale.current
+ Column(
+ modifier = Modifier
+ .fillMaxHeight(),
+ verticalArrangement = Arrangement.SpaceBetween) {
+ Column {
+ Text(
+ text = locale["welcome.intro.title"],
+ style = typography.h4,
+ )
+ Text(
+ text = locale["welcome.intro.message"],
+ style = typography.body1,
+ )
+ }
+ Column {
+ Text(
+ text = locale["welcome.intro.suggestion"],
+ style = typography.body1,
+ modifier = Modifier
+ .padding(vertical = 16.dp)
+ .clip(RoundedCornerShape(12.dp))
+ .background(colors.primary)
+ .padding(16.dp)
+ .sizeIn(maxWidth = 200.dp)
+
+ )
+ Row(
+ modifier = Modifier
+ .fillMaxWidth(),
+ horizontalArrangement = Arrangement.SpaceBetween
+ ) {
+ Image(
+ painter = painterResource("welcome/intro/long.svg"),
+ contentDescription = locale["welcome.intro.long"],
+ modifier = Modifier
+ .offset(x = -32.dp)
+ )
+ Image(
+ painter = painterResource("welcome/intro/short.svg"),
+ contentDescription = locale["welcome.intro.short"],
+ modifier = Modifier
+ .align(Alignment.Bottom)
+ )
+ }
+ }
+ }
+ }
+ @Composable
+ fun examples(){
+ LazyVerticalGrid(
+ columns = GridCells.Fixed(2),
+ verticalArrangement = Arrangement.spacedBy(16.dp),
+ horizontalArrangement = Arrangement.spacedBy(16.dp),
+ ){
+ items(4){
+ Column {
+ Box(
+ modifier = Modifier
+ .background(colors.primary)
+ .width(185.dp)
+ .aspectRatio(16f / 9f)
+ )
+ Text("Example $it")
+ }
+ }
}
}
diff --git a/app/src/processing/app/ui/WelcomeToBeta.kt b/app/src/processing/app/ui/WelcomeToBeta.kt
index ab0aaa9e1..ac8302fb8 100644
--- a/app/src/processing/app/ui/WelcomeToBeta.kt
+++ b/app/src/processing/app/ui/WelcomeToBeta.kt
@@ -103,21 +103,8 @@ class WelcomeToBeta {
@JvmStatic
fun main(args: Array) {
- application {
- val windowState = rememberWindowState(
- size = DpSize.Unspecified,
- position = WindowPosition(Alignment.Center)
- )
-
- Window(onCloseRequest = ::exitApplication, state = windowState, title = Locale()["beta.window.title"]) {
- ProcessingTheme {
- Surface(color = colors.background) {
- welcomeToBeta {
- exitApplication()
- }
- }
- }
- }
+ pdeapplication("beta.window.title") {
+ welcomeToBeta()
}
}
}
diff --git a/app/src/processing/app/ui/theme/Typography.kt b/app/src/processing/app/ui/theme/Typography.kt
index 5d87c490e..c21d554f7 100644
--- a/app/src/processing/app/ui/theme/Typography.kt
+++ b/app/src/processing/app/ui/theme/Typography.kt
@@ -2,6 +2,8 @@ package processing.app.ui.theme
import androidx.compose.material.MaterialTheme.typography
import androidx.compose.material.Typography
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.text.ExperimentalTextApi
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
@@ -21,18 +23,39 @@ val processingFont = FontFamily(
style = FontStyle.Normal
)
)
+val spaceGroteskFont = FontFamily(
+ Font(
+ resource = "SpaceGrotesk-Bold.ttf",
+ weight = FontWeight.Bold,
+ ),
+ Font(
+ resource = "SpaceGrotesk-Regular.ttf",
+ weight = FontWeight.Normal,
+ ),
+ Font(
+ resource = "SpaceGrotesk-Medium.ttf",
+ weight = FontWeight.Medium,
+ ),
+ Font(
+ resource = "SpaceGrotesk-SemiBold.ttf",
+ weight = FontWeight.SemiBold,
+ ),
+ Font(
+ resource = "SpaceGrotesk-Light.ttf",
+ weight = FontWeight.Light,
+ )
+)
val Typography = Typography(
- body1 = TextStyle(
- fontFamily = processingFont,
- fontWeight = FontWeight.Normal,
- fontSize = 13.sp,
- lineHeight = 16.sp
- ),
- subtitle1 = TextStyle(
- fontFamily = processingFont,
+ defaultFontFamily = spaceGroteskFont,
+ h4 = TextStyle(
fontWeight = FontWeight.Bold,
- fontSize = 16.sp,
- lineHeight = 20.sp
- )
+ fontSize = 19.sp,
+ lineHeight = 24.sp
+ ),
+ body1 = TextStyle(
+ fontWeight = FontWeight.Normal,
+ fontSize = 15.sp,
+ lineHeight = 19.sp
+ ),
)
\ No newline at end of file
diff --git a/build/shared/lib/fonts/SpaceGrotesk-Bold.ttf b/build/shared/lib/fonts/SpaceGrotesk-Bold.ttf
new file mode 100644
index 000000000..0408641c6
Binary files /dev/null and b/build/shared/lib/fonts/SpaceGrotesk-Bold.ttf differ
diff --git a/build/shared/lib/fonts/SpaceGrotesk-LICENSE.txt b/build/shared/lib/fonts/SpaceGrotesk-LICENSE.txt
new file mode 100644
index 000000000..6a314848b
--- /dev/null
+++ b/build/shared/lib/fonts/SpaceGrotesk-LICENSE.txt
@@ -0,0 +1,93 @@
+Copyright 2020 The Space Grotesk Project Authors (https://github.com/floriankarsten/space-grotesk)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/build/shared/lib/fonts/SpaceGrotesk-Light.ttf b/build/shared/lib/fonts/SpaceGrotesk-Light.ttf
new file mode 100644
index 000000000..d41bcccd8
Binary files /dev/null and b/build/shared/lib/fonts/SpaceGrotesk-Light.ttf differ
diff --git a/build/shared/lib/fonts/SpaceGrotesk-Medium.ttf b/build/shared/lib/fonts/SpaceGrotesk-Medium.ttf
new file mode 100644
index 000000000..7d44b663b
Binary files /dev/null and b/build/shared/lib/fonts/SpaceGrotesk-Medium.ttf differ
diff --git a/build/shared/lib/fonts/SpaceGrotesk-Regular.ttf b/build/shared/lib/fonts/SpaceGrotesk-Regular.ttf
new file mode 100644
index 000000000..981bcf5b2
Binary files /dev/null and b/build/shared/lib/fonts/SpaceGrotesk-Regular.ttf differ
diff --git a/build/shared/lib/fonts/SpaceGrotesk-SemiBold.ttf b/build/shared/lib/fonts/SpaceGrotesk-SemiBold.ttf
new file mode 100644
index 000000000..e7e02e51e
Binary files /dev/null and b/build/shared/lib/fonts/SpaceGrotesk-SemiBold.ttf differ
diff --git a/build/shared/lib/languages/PDE.properties b/build/shared/lib/languages/PDE.properties
index 74fd5027e..00daaa7bc 100644
--- a/build/shared/lib/languages/PDE.properties
+++ b/build/shared/lib/languages/PDE.properties
@@ -614,6 +614,16 @@ update_check.updates_available.core = A new version of Processing is available,\
update_check.updates_available.contributions = There are updates available for some of the installed contributions,\nwould you like to open the the Contribution Manager now?
+# ---------------------------------------
+# Welcome
+welcome.intro.title = Welcome to Processing
+welcome.intro.message = A flexible software sketchbook and a language for learning how to code.
+welcome.intro.suggestion = Is it your first time using Processing? Try one of the examples on the right.
+welcome.action.examples = More examples
+welcome.action.tutorials = Tutorials
+welcome.action.startup = Startup
+welcome.action.go = "Let's go!"
+
# ---------------------------------------
# Beta
beta.window.title = Welcome to Beta