diff --git a/_config.yml b/_config.yml index 3f72a8ba4..30da41d27 100644 --- a/_config.yml +++ b/_config.yml @@ -36,6 +36,10 @@ defaults: collections: install_tabs: output: false + why_scala_items: + output: false + scala_use_case_items: + output: false scala_carousel_items: output: false scala_items: diff --git a/_data/awesome-scala.yml b/_data/awesome-scala.yml index a99502758..88a06e43d 100644 --- a/_data/awesome-scala.yml +++ b/_data/awesome-scala.yml @@ -1,4 +1,4 @@ -summaryText: Scala is widely used in all these areas and more. +summaryText: Have another use case? Scaladex indexes awesome Scala libraries. Search in the box below. links: - title: Big Data Processing url: https://index.scala-lang.org/awesome#big-data diff --git a/_layouts/frontpage.html b/_layouts/frontpage.html index ee21569e9..896d79a78 100644 --- a/_layouts/frontpage.html +++ b/_layouts/frontpage.html @@ -18,8 +18,12 @@
-
+
-

{{page.headerTitle}}

-

{{page.headerSubtitle}}

- {% for release in site.data.scala-releases %} - {% if release.category == "current_version" %} - - Scala {{ release.version }} - - {% endif %} - {% endfor %} - - All Releases - + +

{{page.headerSubtitle}}

+
+
+ {% for release in site.data.scala-releases %} + {% if release.category == "current_version" %} + + Scala {{ release.version }} + + {% endif %} + {% endfor %} + + All Releases + +
+
@@ -99,68 +107,75 @@

{{page.headerTitle}}

- +
-
-

Scala in a Nutshell

-
-

Click the buttons to see Scala in action, - or visit the Scala Documentation to learn more.

+ +
+
+ {% for scalaItem in site.why_scala_items %} +
+
+

{{scalaItem.shortTitle}}

+

{{scalaItem.shortDescription}}

+
+
+ {% endfor %}
-
-
- {% for scalaItem in site.scala_items %} - {% assign loopIndexMod = forloop.index | minus: 1 | modulo: 3 %} +
- {% if loopIndexMod == 0 %} - {% assign codeSnippets = '' | split: ',' %} -
- {% endif %} - {% assign codeSnippets = codeSnippets | push: scalaItem.content %} -
-

{{scalaItem.shortTitle}}

-

{{scalaItem.shortDescription}}

-
More...
+ +
+
+
+

{{page.useCaseTitle}}

+
+
+
+

{{page.useCaseIntroduction}}

+
+
+
+
+ {% for scalaItem in site.scala_use_case_items %} +
+
+ {{scalaItem.shortTitle}} +

{{scalaItem.shortTitle}}

+

{{scalaItem.shortDescription}}

+
+ {{scalaItem.expandText | default: 'See More...' }}
- {% if loopIndexMod == 2 or forloop.last %} +
+
+
-
- {% for snippet in codeSnippets %} -
{{snippet}}
- {% endfor %} +
+
+ {{scalaItem.content}} + back to top +
- {% endif %} - {% endfor %} +
+ {% endfor %} +
- -
-
-

{{site.data.common.texts.scalaBackendsTitle}}

-
    - {% for backend in page.scalaBackends %} -
  • - - {{backend.description}} - - {% if backend.beta == 1 %}beta{% endif %} -
  • - {% unless forloop.last %}
  • {% endunless %} - {% endfor %} -
-
-
-
+ +
+

{{site.data.awesome-scala.summaryText}}

@@ -169,24 +184,84 @@

{{page.ecosystemTitle}}

- +
Awesome Scala
-
+ + + +
+
+ + +
+
+

{{site.data.common.texts.scalaBackendsTitle}}

+
    + {% for backend in page.scalaBackends %} +
  • + + {{backend.description}} + + {% if backend.beta == 1 %}beta{% endif %} +
  • + {% unless forloop.last %}
  • {% endunless %} + {% endfor %} +
+
+
+ + +
+
+
+ + +

{{site.scala_items[0].shortTitle}}

+
+ + + +
+
+ {% for scalaItem in site.scala_items %} +
+
+ {{scalaItem.shortTitle}} + + +

{{scalaItem.shortDescription}}

+
+ + {{scalaItem.expandText | default: 'See + More...' + }} +
+
+
+ +
+
+
{{scalaItem.content}}
+
+ {% endfor %}
diff --git a/_sass/base/body.scss b/_sass/base/body.scss index a87c02451..6564f3740 100755 --- a/_sass/base/body.scss +++ b/_sass/base/body.scss @@ -3,6 +3,8 @@ //------------------------------------------------ html { box-sizing: border-box; + scroll-behavior: smooth; + scroll-padding-top: 30vh; } *, diff --git a/_sass/base/helper.scss b/_sass/base/helper.scss index 46c174028..9aa4f3341 100755 --- a/_sass/base/helper.scss +++ b/_sass/base/helper.scss @@ -3,27 +3,74 @@ //------------------------------------------------ .wrap { - @include outer-container; - @include padding(0 20px); + @include outer-container; + @include padding(0 20px); + @include bp(large) { + @include outer-container(880px); + } } .place-inline { // add vertical margin - @include outer-container; - @include margin(20px 0); + @include outer-container; + @include margin(20px 0); } .wrap-inline { // add vertical padding - @include outer-container; - @include padding(20px 0); + @include outer-container; + @include padding(20px 0); + @include bp(large) { + @include outer-container(880px); + } } .wrap-narrow { - @include outer-container; - @include padding(0 10px); + @include outer-container; + @include padding(0 10px); + @include bp(large) { + @include outer-container(880px); + } } .dot { - font-size: 10px; - color: rgba($base-font-color-light, 0.6); - margin: 0 3px; + font-size: 10px; + color: rgba($base-font-color-light, 0.6); + margin: 0 3px; +} + +.hide-lg { + display: block; + + @include bp(large) { + display: none; + } +} + +.show-lg { + display: none; + + @include bp(large) { + display: block; + } +} + +.col-lg-6 { + @include span-columns(6); + + @include bp(large) { + @include span-columns(12); + &:not(:last-child) { + margin-bottom: 25px; + } + } +} + +.flex-row-align-end { + @include display(flex); + @include flex-direction(row); + @include flex-wrap(wrap); + @include align-items(center); +} + +.ta-c { + text-align: center; } diff --git a/_sass/components/buttons.scss b/_sass/components/buttons.scss index a62513b7c..ebef39465 100755 --- a/_sass/components/buttons.scss +++ b/_sass/components/buttons.scss @@ -8,9 +8,12 @@ text-transform: uppercase; color: #fff; background: $brand-secondary; - border-radius: $border-radius-base; + border-radius: $border-radius-bold; display: inline-block; + box-shadow: 0 4px 7px 0 rgba(0, 0, 0, 0.2); + + &:active, &:focus, &:hover { diff --git a/_sass/components/code.scss b/_sass/components/code.scss index c4aed5e9a..4145c7ea5 100755 --- a/_sass/components/code.scss +++ b/_sass/components/code.scss @@ -168,7 +168,7 @@ } pre { - margin-top: 0; + margin: 0; } code { diff --git a/_sass/components/heading-line.scss b/_sass/components/heading-line.scss index 827b1cd96..0f75567d3 100755 --- a/_sass/components/heading-line.scss +++ b/_sass/components/heading-line.scss @@ -3,7 +3,7 @@ //------------------------------------------------ .heading-line { - margin-bottom: $padding-large; + margin-bottom: $padding-small; text-align: center; h2 { @@ -24,9 +24,9 @@ &:before { content: ""; display: block; - height: 1px; + height: 5px; position: absolute; - top: 50%; + top: 45%; width: 100%; background: $base-border-color-white; } diff --git a/_sass/layout/inner-text.scss b/_sass/layout/inner-text.scss index 9c06e0414..f85cfdbc9 100755 --- a/_sass/layout/inner-text.scss +++ b/_sass/layout/inner-text.scss @@ -2,38 +2,50 @@ //------------------------------------------------ //------------------------------------------------ -.col-lg-6 { - @include span-columns(6); - - @include bp(large) { - @include span-columns(12); - padding-bottom: 8px; - } +.hero-logo { + background-image: url('/resources/img/frontpage/scala-logo-white-hero@2x.png'); + background-repeat: no-repeat; + background-size: contain; + height: 100px; + margin-bottom: 15px; } -.inner-text { - h1 { - font-family: $base-font-family; - font-size: min(2.85vw, 2.21rem); - font-weight: $font-black; - color: #fff; - margin: $padding-small 20px $padding-small 0; - } - p { - font-size: 1.25rem; - color: #fff; - margin-bottom: $padding-medium; - } +.col-lg-6 { + .inner-text { - @include bp(large) { - .button { - margin-bottom: 3px; + .button-row__container { + @include display(flex); + @include flex-direction(row); + @include justify-content(flex-start); + + @include bp(large) { + @include justify-content(center); + } } h1 { - font-size: 2.5rem; - margin: ($padding-medium / 2) 0; + margin-bottom: 20px; + font-size: 5.2rem; + } + + h2 { + font-family: $base-font-family; + font-size: min(max(1.6vw, 1.2rem), 1.31rem); + line-height: min(max(1.5vw, 2rem), 2.15rem); + color: #fff; + margin-bottom: $padding-medium; + } + + @include bp(large) { + .button { + margin-bottom: 3px; + } + + h2 { + font-size: 1.4rem; + text-align: center; + } } } } diff --git a/_sass/layout/navigation.scss b/_sass/layout/navigation.scss index 90960f33c..0cd2b7732 100755 --- a/_sass/layout/navigation.scss +++ b/_sass/layout/navigation.scss @@ -14,6 +14,9 @@ height: 43px; } } + .navigation-bdand-vfill-lg { + height: 49px; + } .navigation-panel-button { display: none; font-size: 1.333rem; diff --git a/_sass/layout/nutshell.scss b/_sass/layout/nutshell.scss index 38e4c23fc..005c33408 100755 --- a/_sass/layout/nutshell.scss +++ b/_sass/layout/nutshell.scss @@ -5,6 +5,19 @@ .nutshell { background: $gray-nutshell; + + .scala-item_icon { + width: 100px; + height: 100px; + padding: 10px; + } + + .image-caption { + font-style: italic; + text-align: center; + color: $base-font-color-inverse; + } + .heading-line { h2 { span { @@ -16,24 +29,99 @@ } } - .scala-items-list { + .scala-items-grid { + + .button { + font-size: 0.6rem; + padding: 5px; + margin-top: 5px; + + &.button_call-to-action { + font-size: $font-size-small; + text-align: center; + padding: 5px 15px; + width: 100%; + } + + &.button_return-anchor { + font-family: $base-font-family; + text-transform: none; + // font-weight: normal; + font-size: $font-size-medium; + color: $base-font-color-inverse; + display: block; + position: relative; + text-align: center; + width: 100%; + top: -10px; + background: none; + + box-shadow: none; + + &:active, + &:focus, + &:hover { + background: $brand-primary; + color: #fff; + } + } + } + + + &.g-cols-4 { + .items-menu { + grid-template-columns: repeat(4, 1fr); + @include bp(large) { + grid-template-columns: 1fr; + } + } + } + + &.g-cols-2 { + .items-menu { + grid-template-columns: repeat(2, 1fr); + + @include bp(large) { + grid-template-columns: 1fr; + } + } + } + + &.g-cols-1 { + .items-menu { + grid-template-columns: 1fr; + align-items: center; + justify-items: center; + + .scala-item { + width: 600px; + @include bp(large) { + width: 100%; + } + } + } + } + .items-menu { + @include display(grid); + justify-content: space-between; + grid-template-columns: repeat(3, 1fr); + grid-auto-flow: dense; + @include bp(large) { + grid-template-columns: 1fr; + } .scala-item { - @include span-columns(4); - @include omega(3n); - padding: $padding-small; + @include display(flex); + @include flex-direction(column); + @include justify-content(space-between); + @include align-items(center); + + padding: $padding-xsmall $padding-small; text-align: center; transition: $base-transition; - @include bp(medium) { - @include span-columns(12); - } - - min-height: 165px; - .button { - margin-top: 10px; - font-size: 0.6rem; - padding: 5px; + &:has(+ .items-content:target) { + background: $gray-darker; } h3 { @@ -49,34 +137,96 @@ font-size: $font-size-large; } - - &:active, - &:focus, - &:hover { - cursor: pointer; - background: $gray-dark; - } - - &.active { - background: $gray-dark; + .button { + &.button_call-to-action { + margin-top: $font-size-large; + } } } .items-content { - background: $gray-dark; + grid-column: 1 / -1; + background: $gray-darker; transition: $base-transition; + display: none; + + &:target { + display: block; + } + + .items-content_close { + font-size: $font-size-carousel-arrow; + color: $base-font-color-light; + &:hover { + color: $base-font-color-inverse; + } + } .items-code { - display: none; + // display: none; background: $gray-dark; - padding: 65px 0; + padding: 25px 0 5px 0; + + .scala-row { + @include display(flex); + @include flex-direction(row); + // @include justify-content(space-between); + @include align-items(center); + // margin-bottom: 20px; + + @include bp(large) { + @include flex-direction(column); + } + + &.scala-row_align-start { + @include align-items(start); + } + + &:has(+ .scala-row) { + margin-bottom: 20px; + } + } + + h3 { + font-size: 1.625rem; + color: #fff; + margin-bottom: 10px; + + &:not(:first-child) { + margin-top: 20px; + } + + + @include bp(large) { + text-align: center; + } + } + + .emph { + font-style: oblique; + font-weight: bold; + } + + .code-separator { + border: 1px solid $code-bg-color-dark-highlight; + } .scala-code { - @include span-columns(6); - @include bp(large) { - @include span-columns(12); - } + margin: 0 5px; + width: 50%; + + @include bp(large) { + margin: 0; + width: 100%; + } + + /* set display type of containers of
 elements (see https://stackoverflow.com/a/14406386/561721) */
+                        .code-element {
+                            display: table;
+                            table-layout: fixed;
+                            width: 100%;
+                        }
                     }
 
                     .scala-text {
@@ -87,24 +237,29 @@
                             border-radius: 2px;
                             margin: 0 3px;
                         }
-                        @include span-columns(6);
-                        @include bp(large) {
-                          @include span-columns(12);
-                        }
 
-                        h3 {
-                            font-size: 1.625rem;
-                            color: #fff;
-                            margin-bottom: 20px;
+                        margin: 0 5px;
+                        width: 50%;
+
+                        @include bp(large) {
+                            margin: 0;
+                            width: 100%;
                         }
 
                         p {
                             color: $base-font-color-inverse;
+                            margin-bottom: 8px;
+
+                            @include bp(large) {
+                                text-align: center;
+                            }
                         }
 
                         &.scala-text-large {
-                          @include span-columns(12);
-                          margin-bottom: 30px;
+                            width: 100%;
+                            margin: 0;
+                            // @include span-columns(12);
+                            margin-bottom: 20px;
                         }
                     }
                 }
diff --git a/_sass/layout/runs.scss b/_sass/layout/runs.scss
index e321fa706..f7b9ad837 100755
--- a/_sass/layout/runs.scss
+++ b/_sass/layout/runs.scss
@@ -4,11 +4,12 @@
 
 #site-main {
     .runs {
-        padding: 0;
+        padding-bottom: 20px;
         background: $gray;
 
         h2 {
-            color: #fff;
+            color: $base-font-color-inverse;
+            font-family: $base-font-family;
             text-align: center;
             font-size: $font-size-large;
         }
@@ -17,7 +18,7 @@
             @include display(flex);
             @include align-items(center);
             @include justify-content(center);
-            margin-top: 30px;
+            margin-top: 20px;
             li:nth-child(2),
             li:nth-child(4) {
               height: 100px;
diff --git a/_sass/layout/scala-ecosystem.scss b/_sass/layout/scala-ecosystem.scss
index a7d8bc8a9..3956773ce 100755
--- a/_sass/layout/scala-ecosystem.scss
+++ b/_sass/layout/scala-ecosystem.scss
@@ -7,10 +7,12 @@
         // background: url("../img/frontpage/background-scala-ecosystem.jpg") no-repeat center bottom $gray-li;
         // @include image-size();
         background: $gray;
+        padding-bottom: 20px;
+
 
         .awesome-table {
-            background: $gray-darker;
-            padding: 16px 0;
+            border: 3px solid $gray-dark;
+            padding: 8px 0;
 
             .awesome-summary {
                 margin-bottom: 16px;
@@ -30,38 +32,29 @@
             }
 
             .awesome-items {
-                @include span-columns(8);
-
-                @include bp(large) {
-                    @include span-columns(12);
-                }
+                @include span-columns(12);
 
                 h3 {
                     color: $gray-light;
                     font-family: $base-font-family;
                     text-transform: uppercase;
-                    // border-bottom: $base-border-gray;
-                    font-size: $font-size-large;
+                    font-size: $font-size-medium;
                 }
 
-                float: left;
                 display: block;
 
                 .content-card {
                     float: left;
-                    background: $gray;
-                    padding: 2px;
-                    margin: 5px 3px;
+                    margin: 3px;
                     display: block;
-                    border-radius: $border-radius-base;
-
                 }
 
                 a {
 
                     h3 {
+
+                        font-size: $font-size-small;
                         transition: $base-transition;
-                        padding: 10px;
                         i {
                             margin-right: 6px;
                         }
@@ -72,11 +65,6 @@
                     &:hover {
                         text-decoration: none;
                         box-shadow: $box-shadow-item;
-
-                        h3 {
-                            color: $brand-primary;
-                            background: $gray-dark;
-                        }
                     }
                 }
             }
@@ -147,9 +135,24 @@
 
                     input {
                         padding: 12px 18px 12px 50px;
+                        color: $base-font-color-inverse;
+                        background: $gray-li;
                         border-radius: $border-radius-small;
                         width: 100%;
                         font-weight: $font-bold;
+
+                        &::placeholder {
+                            color: $base-font-color-inverse;
+                        }
+
+                        &:focus,
+                        &:active {
+                            background: #fff;
+                            color: $base-font-color-light;
+                            &::placeholder {
+                                color: $base-font-color-light;
+                            }
+                        }
                     }
                 }
                 @include bp(medium) {
diff --git a/_sass/layout/scala-main-resources.scss b/_sass/layout/scala-main-resources.scss
index 29c6260e0..d8d5de095 100755
--- a/_sass/layout/scala-main-resources.scss
+++ b/_sass/layout/scala-main-resources.scss
@@ -19,8 +19,8 @@
         }
 
         .get-started {
-            @include span-columns(4);
-            @include shift(2);
+            @include span-columns(4.2);
+            @include shift(1.8);
 
             .button {
 
@@ -34,7 +34,7 @@
         }
 
         .learn-scala {
-            @include span-columns(4);
+            @include span-columns(4.2);
 
             .button {
                 text-align: right;
diff --git a/_sass/layout/site-main.scss b/_sass/layout/site-main.scss
index 5d8bed63c..de2637a4d 100755
--- a/_sass/layout/site-main.scss
+++ b/_sass/layout/site-main.scss
@@ -3,9 +3,17 @@
 //------------------------------------------------
 #site-main {
     section {
-        padding: $padding-xlarge 0;
+        padding-bottom: $padding-large;
+
+        .section-text {
+            p {
+                color: $base-font-color-inverse;
+                font-size: $font-size-large;
+                margin-bottom: $padding-xsmall;
+            }
+        }
     }
     section:first-child {
-        padding: 10px 50px;
+        padding-top: $padding-medium;
     }
 }
diff --git a/_sass/utils/_variables.scss b/_sass/utils/_variables.scss
index d50b1f3af..f8d6492c5 100755
--- a/_sass/utils/_variables.scss
+++ b/_sass/utils/_variables.scss
@@ -44,6 +44,7 @@ $base-font-color-inverse: rgba(#fff, 0.70);
 @import url('https://fonts.googleapis.com/css?family=Roboto+Slab:400,700');
 @import url('https://fonts.googleapis.com/css?family=Kalam:300,400,700');
 @import url('https://fonts.googleapis.com/css?family=Caveat');
+
 //------------------------------------------------
 $base-font-family: 'Lato', sans-serif;
 $heading-font-family: 'Roboto Slab', serif;
@@ -60,7 +61,7 @@ $font-size-small: 0.875rem; // 14px
 $font-size-xsmall:  0.75rem; // 12px
 
 $font-size-h2: 1.375rem; // 22px
-$font-size-h3: $font-size-large; // 17px
+$font-size-h3: 1.275rem;
 
 //------------------------------------------------
 $base-line-height: 1.6;
@@ -90,7 +91,9 @@ $padding-large: 40px;
 $padding-mlarge: 35px;
 $padding-medium: 30px;
 $padding-small: 20px;
+$padding-xsmall: 10px;
 //------------------------------------------------
+$border-radius-bold: 5px;
 $border-radius-base: 3px;
 $border-radius-small: 2px;
 $border-radius-medium: 10px;
diff --git a/_scala_items/1-seamless-java-interop.md b/_scala_items/1-seamless-java-interop.md
deleted file mode 100644
index b428e5060..000000000
--- a/_scala_items/1-seamless-java-interop.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-shortTitle: "Seamless Java Interop"
-shortDescription: "Scala runs on the JVM, so Java and Scala stacks can be freely mixed for totally seamless integration."
-scastieUrl:
----
-
-
-
-
Author.scala
-
class Author(val firstName: String,
-    val lastName: String) extends Comparable[Author] {
-
-  override def compareTo(that: Author) = {
-    val lastNameComp = this.lastName compareTo that.lastName
-    if (lastNameComp != 0) lastNameComp
-    else this.firstName compareTo that.firstName
-  }
-}
-
-object Author {
-  def loadAuthorsFromFile(file: java.io.File): List[Author] = ???
-}
-
-
-
App.java
-
import static scala.collection.JavaConversions.asJavaCollection;
-
-public class App {
-    public List<Author> loadAuthorsFromFile(File file) {
-        return new ArrayList<Author>(asJavaCollection(
-            Author.loadAuthorsFromFile(file)));
-    }
-
-    public void sortAuthors(List<Author> authors) {
-        Collections.sort(authors);
-    }
-
-    public void displaySortedAuthors(File file) {
-        List<Author> authors = loadAuthorsFromFile(file);
-        sortAuthors(authors);
-        for (Author author : authors) {
-            System.out.println(
-                author.lastName() + ", " + author.firstName());
-        }
-    }
-}
-
-
-
-

Combine Scala and Java seamlessly

-

Scala classes are ultimately JVM classes. You can create Java objects, call -their methods and inherit from Java classes transparently from Scala. -Similarly, Java code can reference Scala classes and objects.

-
-

-In this example, the Scala class Author implements the Java -interface Comparable<T> and works with Java -Files. The Java code uses a method from the companion object -Author, and accesses fields of the Author class. -It also uses JavaConversions to convert between Scala collections -and Java collections. -

-
-
diff --git a/_scala_items/2-education.md b/_scala_items/2-education.md new file mode 100644 index 000000000..0b6c5d808 --- /dev/null +++ b/_scala_items/2-education.md @@ -0,0 +1,80 @@ +--- +shortTitle: "Ideal for teaching" +shortDescription: "Scala is ideal for teaching programming to beginners as well as for teaching advanced software engineering courses." +expandText: "Why teach Scala?" +anchorTarget: "why-teach-scala" +icon: "icon7.svg" +--- + +
+

Readable and Versatile

+

+ Most of the concepts involved in software design directly map + into Scala constructs. The concise syntax of Scala allows the teachers + and the learners to focus on those interesting concepts without dealing + with tedious low-level implementation issues. +

+

+ The example in file HelloWorld.scala below shows how a “hello + world” program looks like in Scala. In Modeling.scala, we show an + example of structuring the information of a problem domain in Scala. In + Modules.scala, we show how straightforward it is to implement software modules with Scala classes. Last, in Algorithms.scala, we show how the + standard Scala collections can be leveraged to implement algorithms with + few lines of code. +

+

+ Learn more in the dedicated page about + Teaching. +

+
+ +
+
+
+
HelloWorld.scala
+
@main def run() = println("Hello, World!")
+
+
+
Algorithms.scala
+
// Average number of contacts a person has according to age
+  def contactsByAge(people: Seq[Person]): Map[Int, Double] =
+    people
+      .groupMap(
+        person => person.age
+      )(
+        person => person.contacts.size
+      )
+      .map((age, contactCounts) =>
+        val averageContactCount =
+          contactCounts.sum.toDouble / contactCounts.size
+        (age, averageContactCount)
+      )
+
+
+
+
+
Modeling.scala
+
/** A Player can either be a Bot, or a Human.
+    * In case it is a Human, it has a name.
+    */
+  enum Player:
+    case Bot
+    case Human(name: String)
+
+ +
+
Modules.scala
+
// A module that can access the data stored in a database
+  class DatabaseAccess(connection: Connection):
+    def readData(): Seq[Data] = ???
+
+  // An HTTP server, which uses the `DatabaseAccess` module
+  class HttpServer(databaseAccess: DatabaseAccess):
+    // The HTTP server can call `readData`, but it cannot
+    // access the underlying database connection, which is
+    // an implementation detail
+    databaseAccess.readData()
+
+ +
+
diff --git a/_scala_items/2-type-inference.md b/_scala_items/2-type-inference.md deleted file mode 100644 index 25f759f53..000000000 --- a/_scala_items/2-type-inference.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -shortTitle: "Type Inference" -shortDescription: "So the type system doesn’t feel so static. Don’t work for the type system. Let the type system work for you!" -scastieUrl: ---- -
-
-
-
Type inference
-
scala> class Person(val name: String, val age: Int) {
-     |   override def toString = s"$name ($age)"
-     | }
-defined class Person
-
-scala> def underagePeopleNames(persons: List[Person]) = {
-     |   for (person <- persons; if person.age < 18)
-     |     yield person.name
-     | }
-underagePeopleNames: (persons: List[Person])List[String]
-
-scala> def createRandomPeople() = {
-     |   val names = List("Alice", "Bob", "Carol",
-     |       "Dave", "Eve", "Frank")
-     |   for (name <- names) yield {
-     |     val age = (Random.nextGaussian()*8 + 20).toInt
-     |     new Person(name, age)
-     |   }
-     | }
-createRandomPeople: ()List[Person]
-
-scala> val people = createRandomPeople()
-people: List[Person] = List(Alice (16), Bob (16), Carol (19), Dave (18), Eve (26), Frank (11))
-
-scala> underagePeopleNames(people)
-res1: List[String] = List(Alice, Bob, Frank)
-
-
-
-

Let the compiler figure out the types for you

-

The Scala compiler is smart about static types. Most of the time, you need -not tell it the types of your variables. Instead, its powerful type inference -will figure them out for you.

-

-In this interactive REPL session (Read-Eval-Print-Loop), we define a -class and two functions. You can observe that the compiler infers the result -types of the functions automatically, as well as all the intermediate values. -

-
-
diff --git a/_scala_items/3-concurrency-distribution.md b/_scala_items/3-concurrency-distribution.md deleted file mode 100644 index d03a8a269..000000000 --- a/_scala_items/3-concurrency-distribution.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -shortTitle: "Concurrency & Distribution" -shortDescription: "Use data-parallel operations on collections, use actors for concurrency and distribution, or futures for asynchronous programming." -scastieUrl: ---- -
-
-
-
Concurrent/Distributed
-
val x = Future { someExpensiveComputation() }
-val y = Future { someOtherExpensiveComputation() }
-val z = for (a <- x; b <- y) yield a*b
-for (c <- z) println("Result: " + c)
-println("Meanwhile, the main thread goes on!")
-
-
-
-

Go Concurrent or Distributed with Futures & Promises

-

In Scala, futures and promises can be used to process data asynchronously, making it easier to parallelize or even distribute your application.

-

-In this example, the Future{} construct evaluates its argument asynchronously, and returns -a handle to the asynchronous result as a Future[Int]. -For-comprehensions can be used to register new callbacks (to post new things to do) when the future is -completed, i.e., when the computation is finished. -And since all this is executed asynchronously, without blocking, the main -program thread can continue doing other work in the meantime. -

-
-
diff --git a/_scala_items/4-traits.md b/_scala_items/4-traits.md deleted file mode 100644 index fb49e2724..000000000 --- a/_scala_items/4-traits.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -shortTitle: "Traits" -shortDescription: "Combine the flexibility of Java-style interfaces with the power of classes. Think principled multiple-inheritance." -scastieUrl: ---- -{% comment %} -Borrowed from -https://gleichmann.wordpress.com/2009/10/21/scala-in-practice-composing-traits-lego-style/ -{% endcomment %} -
-
-
-
Traits
-
abstract class Spacecraft {
-  def engage(): Unit
-}
-trait CommandoBridge extends Spacecraft {
-  def engage(): Unit = {
-    for (_ <- 1 to 3)
-      speedUp()
-  }
-  def speedUp(): Unit
-}
-trait PulseEngine extends Spacecraft {
-  val maxPulse: Int
-  var currentPulse: Int = 0
-  def speedUp(): Unit = {
-    if (currentPulse < maxPulse)
-      currentPulse += 1
-  }
-}
-class StarCruiser extends Spacecraft
-                     with CommandoBridge
-                     with PulseEngine {
-  val maxPulse = 200
-}
-
-
-
-

Flexibly Combine Interface & Behavior

-

-In Scala, multiple traits can be mixed into a class to combine their interface and their -behavior.

-

Here, a StarCruiser is a Spacecraft with a CommandoBridge that knows how to -engage the ship (provided a means to speed up) and a PulseEngine that -specifies how to speed up. -

-
-
diff --git a/_scala_items/5-pattern-matching.md b/_scala_items/5-pattern-matching.md deleted file mode 100644 index 3b0cb7ccd..000000000 --- a/_scala_items/5-pattern-matching.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -shortTitle: "Pattern Matching" -shortDescription: "Think “switch” on steroids. Match against class hierarchies, sequences, constants and more." -scastieUrl: ---- -
-
-

Switch on the structure of your data

-

In Scala, case classes are used to represent structural data -types. They implicitly equip the class with meaningful toString, -equals and hashCode methods, as well as the -ability to be deconstructed with pattern matching.

-


-In this example, we define a small set of case classes that represent binary -trees of integers (the generic version is omitted for simplicity here). -In inOrder, the match construct chooses the right -branch, depending on the type of t, and at the same time -deconstructs the arguments of a Node. -

-
- -
-
-
Pattern matching
-
// Define a set of case classes for representing binary trees.
-sealed abstract class Tree
-case class Node(elem: Int, left: Tree, right: Tree) extends Tree
-case object Leaf extends Tree
-
-// Return the in-order traversal sequence of a given tree.
-def inOrder(t: Tree): List[Int] = t match {
-  case Node(e, l, r) => inOrder(l) ::: List(e) ::: inOrder(r)
-  case Leaf          => List()
-}
-
-
- -
diff --git a/_scala_items/6-higher-order-functions.md b/_scala_items/6-higher-order-functions.md deleted file mode 100644 index 77f6f5459..000000000 --- a/_scala_items/6-higher-order-functions.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -shortTitle: "Higher-order functions" -shortDescription: "Functions are first-class objects. Compose them with guaranteed type safety. Use them anywhere, pass them to anything." -scastieUrl: ---- -
-
-

Go Functional with Higher-Order Functions

-

In Scala, functions are values, and can be defined as anonymous functions - with a concise syntax.

-
-
-
-
Scala
-
val people: Array[Person]
-
-// Partition `people` into two arrays `minors` and `adults`.
-// Use the anonymous function `(_.age < 18)` as a predicate for partitioning.
-val (minors, adults) = people partition (_.age < 18)
-
-
-
-
-
Java
-
List<Person> people;
-
-List<Person> minors = new ArrayList<Person>(people.size());
-List<Person> adults = new ArrayList<Person>(people.size());
-for (Person person : people) {
-    if (person.getAge() < 18)
-        minors.add(person);
-    else
-        adults.add(person);
-}
-
-
-
diff --git a/_scala_items/7-education.md b/_scala_items/7-education.md deleted file mode 100644 index 310e84dcc..000000000 --- a/_scala_items/7-education.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -shortTitle: "Ideal for teaching" -shortDescription: "Scala is ideal for teaching programming to beginners as well as for teaching advanced software engineering courses." ---- - -
-
-

Readable and Versatile

-

- Most of the concepts involved in software design directly map - into Scala constructs. The concise syntax of Scala allows the teachers - and the learners to focus on those interesting concepts without dealing - with tedious low-level implementation issues. -

-

- The example in file HelloWorld.scala below shows how a “hello - world” program looks like in Scala. In Modeling.scala, we show an - example of structuring the information of a problem domain in Scala. In - Modules.scala, we show how straightforward it is to implement software modules with Scala classes. Last, in Algorithms.scala, we show how the - standard Scala collections can be leveraged to implement algorithms with - few lines of code. -

-

- Learn more in the dedicated page about - Teaching. -

-
- -
- -
-
HelloWorld.scala
-
@main def run() = println("Hello, World!")
-
- -
-
Modules.scala
-
// A module that can access the data stored in a database
-class DatabaseAccess(connection: Connection):
-  def readData(): Seq[Data] = ???
-
-// An HTTP server, which uses the `DatabaseAccess` module
-class HttpServer(databaseAccess: DatabaseAccess):
-  // The HTTP server can call `readData`, but it cannot
-  // access the underlying database connection, which is
-  // an implementation detail
-  databaseAccess.readData()
-
- -
- -
- -
-
Modeling.scala
-
/** A Player can either be a Bot, or a Human.
-  * In case it is a Human, it has a name.
-  */
-enum Player:
-  case Bot
-  case Human(name: String)
-
- -
-
Algorithms.scala
-
// Average number of contacts a person has according to age
-def contactsByAge(people: Seq[Person]): Map[Int, Double] =
-  people
-    .groupMap(
-      person => person.age
-    )(
-      person => person.contacts.size
-    )
-    .map((age, contactCounts) =>
-      val averageContactCount =
-        contactCounts.sum.toDouble / contactCounts.size
-      (age, averageContactCount)
-    )
-
- -
-
diff --git a/_scala_use_case_items/1-backend.md b/_scala_use_case_items/1-backend.md new file mode 100644 index 000000000..0f5cafcf2 --- /dev/null +++ b/_scala_use_case_items/1-backend.md @@ -0,0 +1,96 @@ +--- +shortTitle: "Server-side" +shortDescription: "High-throughput HTTP servers and clients. Safe, scalable, and principled concurrency. Reliable data validation with powerful transformations." +expandText: "Creating Services" +anchorTarget: "creating-services" +icon: "icon5.svg" +--- + +
+
+
+

Principled Concurrency

+

Scala's expressivity and compiler-enforced saftey makes it easier to construct reliable concurrent code.

+

With Scala, your programs take full advantage of multi-core and distributed architectures, ensure safe access to resources, and apply back-pressure to data producers according to your processing rate.

+

One popular open-source option for managing concurrency in Scala is Cats Effect, combined with http4s for defining servers and routing. Click below to see other solutions.

+ libraries for Concurrency and distribution +
+
+
+
+
Express high-level concurrency with http4s and Cats Effect
+
// HTTP server routing definition
+val service = HttpRoutes.of:
+  case GET -> Root / "weather" => // route '/weather'
+    for
+      winner   <- fetch1.race(fetch2).timeout(10.seconds)
+      response <- Ok(WeatherReport.from(winner))
+    yield
+      response
+
+def fetch1 = fetchWeather(server1) // expensive Network IO
+def fetch2 = fetchWeather(server2) // expensive Network IO
+
+
+
+
+
+
+
+

A Mature Ecosystem of Libraries

+

Use the best of Scala, or leverage libraries from the Java and JavaScript ecosystems.

+

Build with monolithic or microservice architectures. Retain resource-efficiency. Persist your data to any kind of database. Transform, validate, and serialize data into any format (JSON, protobuf, Parquet, etc.).

+

Whether you compile for the Node.js or Java platform, Scala's interop with both gives you access to even more widely-proven libraries.

+ Find the right library for your next Scala project +
+
+
+
+
Compute accross distributed nodes with Akka actors
+
def Device(lastTemp: Option[Double]): Behavior[Message] =
+  Behaviors.receiveMessage:
+    case RecordTemperature(id, value, replyTo) =>
+      replyTo ! TemperatureRecorded(id)
+      Device(lastTemp = Some(value))
+
+    case ReadTemperature(id, replyTo) =>
+      replyTo ! RespondTemperature(id, lastTemp)
+      Behaviors.same
+
+
+
+
+
+
+
+

Case Study: Reusable Code with Tapir

+

Harness the “Code as Data” Paradigm: define once, use everywhere.

+

Scala's rich type system and metaprogramming facilities give the power to automatically derive helpful utilities from your code.

+

One such example library is Tapir, letting you use Scala as a declarative language to describe your HTTP endpoints. From this single source of truth, you can automatically derive their server implementation, their client implementation, and both human-readable and machine-readable documentation.

+

Because everything is derived from a type-safe definition, endpoint invocations are checked to be safe at compile-time, across the frontend and backend.

+ Read more in the Tapir docs +
+
+ +
+
+
Describe service endpoints as data with Tapir
+
// type-safe endpoint definition
+val reportEndpoint =
+  endpoint
+    .in("api" / "report" / path[String]("reportId"))
+    .out(jsonBody[Report])
+
+// derived Docs, Server and Client
+val apiDocs = docsReader
+  .toOpenAPI(reportEndpoint, "Fetch Report", "1.0.0")
+val server = serverBuilder(port = "8080")
+  .addEndpoint(reportEndpoint.handle(fetchReport))
+  .start()
+val client = clientReader
+  .toRequest(reportEndpoint, "http://localhost:8080")
+val report: Future[Report] =
+  client("5ca1a-78fc8d6") // call like any function
+
+
+
diff --git a/_scala_use_case_items/2-data.md b/_scala_use_case_items/2-data.md new file mode 100644 index 000000000..b52626441 --- /dev/null +++ b/_scala_use_case_items/2-data.md @@ -0,0 +1,49 @@ +--- +shortTitle: "Data Processing" +shortDescription: "Pick your favorite notebook. Run massively distributed big data pipelines; train NLP or ML models; perform numerical analysis; visualize data and more." +expandText: "Processing data" +anchorTarget: "processing-data" +icon: "icon11.svg" +--- + +
+
+
+

Big Data Analysis

+

Analyse petabytes of data in parallel on single-node machines or on clusters.

+

Compute either in batches or in real-time. Execute fast, distributed relational operations on your data, or train machine learning algorithms.

+

Work with popular storage and computation engines such as Spark, Kafka Hadoop, Flink, Cassandra, Delta Lake and more.

+ Libraries for processing big data +
+
+
+
+
Analyse data across a cluster with Spark
+
// Count the number of words in a text source
+val textFile = spark.textFile("hdfs://...")
+val counts = textFile
+  .flatMap(line => line.split(" "))
+  .map(word => (word, 1))
+  .reduceByKey(_ + _)
+counts.saveAsTextFile("hdfs://...")
+
+
+
+
+
+
+

Notebooks

+

Explore data in web-based notebooks and produce rich, interactive output.

+

Combine code, data, and visualizations in a single document. Make changes and instantly see results. Share and collaborate with others.

+

Along many cloud-hosted solutions, open-source notebooks for Scala include the almond Jupyter kernel, Zeppelin and Polynote.

+ Libraries for big data and visualisation +
+
+
+
+

Notebook

+ + +
+
+
diff --git a/_scala_use_case_items/3-cli.md b/_scala_use_case_items/3-cli.md new file mode 100644 index 000000000..5a82aaaf2 --- /dev/null +++ b/_scala_use_case_items/3-cli.md @@ -0,0 +1,83 @@ +--- +shortTitle: "Command Line" +shortDescription: "Superpower your scripts with the Scala command. Get hands-on with the Scala Toolkit. Easily add libraries. Build CLI apps with instant startup." +expandText: "Scripting Utilities" +anchorTarget: "build-scala-tools" +icon: "icon4.svg" +--- + +
+
+
+

The power of Scala in one file

+

Scala CLI gives all the tools you need to create simple Scala projects.

+

Import your favorite libraries, write your code, run it, create unit tests, share it as a gist, or publish it to Maven Central.

+

Scala CLI is fast, low-config, works with IDEs, and follows well-known conventions.

+ read more on the Scala CLI website +
+
+
+
+
Create simple scripts and utilities with Scala CLI
+
//> using dependency com.lihaoyi::os-lib:0.9.1
+
+// Sort all the files by size in the working directory
+os.list(os.pwd).sortBy(os.size).foreach(println)
+
+
$ scala-cli list_files.sc
+/home/user/example/list_files.sc
+...
+
+
+
+ +
+
+
+

Get productive with the Scala Toolkit

+

The Scala Toolkit is a good fit for writing a script, prototyping, or bootstrapping a new application.

+

Including a selection of approachable libraries to perform everyday tasks, the Scala Toolkit helps you work with files and processes, parse JSON, send HTTP requests and unit test code.

+

Toolkit libraries work great on the JVM, JS and Native platforms, all while leveraging a simple code style.

+ find useful snippets in the Toolkit Tutorials +
+
+
+
+
Make web-requests, encode JSON and write to file
+
//> using toolkit latest
+
+// A JSON object
+val json = ujson.Obj("name" -> "Peter", "age" -> 23)
+
+// Send an HTTP request
+import sttp.client4.quick.*
+val response = quickRequest
+  .put(uri"https://httpbin.org/put")
+  .body(ujson.write(json))
+  .send()
+
+// Write the response to a file
+os.write(os.pwd / "response.json", response.body)
+
+
+
+
+
+
+

Package to native, deploy easily

+

Package your apps to native binaries for instant startup time.

+

Deploy to Docker images, JS scripts, Spark or Hadoop jobs, and more.

+ other ways to package applications +
+
+
+
+
Compile natively for instant startup
+
$ scala-cli --power package \
+    --native-image \
+    --output my-tool \
+    my-tool.sc
+Wrote /home/user/example/my-tool, run it with ./my-tool
+
+
+
diff --git a/_scala_use_case_items/4-frontend.md b/_scala_use_case_items/4-frontend.md new file mode 100644 index 000000000..8f9475aa7 --- /dev/null +++ b/_scala_use_case_items/4-frontend.md @@ -0,0 +1,80 @@ +--- +shortTitle: "Frontend Web" +shortDescription: "Reactive UI's backed by types. Use the same Scala libraries across the stack. Integrate with the JavaScript library and tooling ecosystem." +expandText: "building frontend" +anchorTarget: "explore-scalajs" +icon: "icon8.svg" +--- + +
+
+
+

Portable Code and Libraries

+

Write the code once and have it run on the frontend as well as on the backend.

+

Reuse the same libraries and testing frameworks on both sides. Write API endpoints that are typechecked across the stack.

+

For example: define your data model in a shared module. Then use sttp to send data to the backend, all while upickle handles seamless conversion to JSON, and also reads JSON back into your model on the backend.

+ More Scala.js libraries and frameworks +
+
+
+
+
Share your model code with frontend and backend
+
enum Pet derives upickle.ReadWriter:
+  case Dog(id: UUID, name: String, owner: String)
+  case Cat(id: UUID, name: String, owner: String)
+
+
// Send an HTTP request to the backend with sttp
+val dog = Dog(uuid, name, owner)
+val response = quickRequest
+  .patch(uri"${site.root}/petstore/$uuid")
+  .body(dog)
+  .send()
+response.onComplete { resp => println(s"updated $dog") }
+
+
+
+
+
+
+

Interoperability with JavaScript

+

Call into JS libraries from the npm ecosystem, or export your Scala.js code to other JS modules. Integrate with Vite for instant live-reloading.

+

Leverage the JavaScript ecosystem of libraries. Use ScalablyTyped to generate types for JavaScript libraries from TypeScript definitions.

+ Scala.js facades for popular JavaScript libraries +
+
+
+
+
React component written with Slinky
+
val Counter = FunctionalComponent[Int] { initial =>
+  val (count, setCount) = useState(initial)
+  button(onClick := { event => setCount(count + 1) },
+    s"You pressed me ${count} times"
+  )
+}
+ReactDOM.render(Counter(0), mountNode)
+
+
+
+
+
+
+

Poweful User Interface Libraries

+

Write robust UIs with the Scala.js UI libraries.

+

Pick your preferred style: Laminar for a pure Scala solution, Slinky for the React experience, or Tyrian or scalajs-react for the pure FP-minded developers.

+ See more Scala.js libraries for frontend and UI +
+
+
+
+
Manage state with Tyrian using the Elm architecture
+
def view(count: Int): Html[Msg] =
+  button(onClick(Msg.Increment))(
+    s"You pressed me ${count} times"
+  )
+
+def update(count: Int): Update[Msg, Int] =
+  case Msg.Increment => (count + 1, Cmd.None)
+  case _             => (count,     Cmd.None)
+
+
+
diff --git a/_why_scala_items/1-expressive.md b/_why_scala_items/1-expressive.md new file mode 100644 index 000000000..e3ed54748 --- /dev/null +++ b/_why_scala_items/1-expressive.md @@ -0,0 +1,4 @@ +--- +shortTitle: "Expressive" +shortDescription: "Scala lets you write less to do more. As a high-level language, its modern features increase productivity and lead to more readable code. With Scala, you can combine both functional and object-oriented programming styles to help structure programs." +--- diff --git a/_why_scala_items/2-versatile.md b/_why_scala_items/2-versatile.md new file mode 100644 index 000000000..6a3fa29a5 --- /dev/null +++ b/_why_scala_items/2-versatile.md @@ -0,0 +1,4 @@ +--- +shortTitle: "Scalable" +shortDescription: "Scala is well suited to building fast, concurrent, and distributed systems with its JVM, JavaScript and Native runtimes. Scala prioritises interoperability, giving easy access to many ecosystems of industry-proven libraries." +--- diff --git a/_why_scala_items/3-safe.md b/_why_scala_items/3-safe.md new file mode 100644 index 000000000..edc94d07f --- /dev/null +++ b/_why_scala_items/3-safe.md @@ -0,0 +1,4 @@ +--- +shortTitle: "Safe" +shortDescription: "Scala's static types help you to build safe systems by default. Smart built-in checks and actionable error messages, combined with thread-safe data structures and collections, prevent many tricky bugs before the program first runs." +--- diff --git a/index.md b/index.md index da3a77fd0..092aa3b78 100644 --- a/index.md +++ b/index.md @@ -4,8 +4,8 @@ layout: frontpage darkmodeCode: true # Header texts -headerTitle: "The Scala Programming Language" -headerSubtitle: "Scala combines object-oriented and functional programming in one concise, high-level language. Scala's static types help avoid bugs in complex applications, and its JVM and JavaScript runtimes let you build high-performance systems with easy access to huge ecosystems of libraries." +headerTitle: "Scala" +headerSubtitle: "A programming language that scales with you: from small scripts to large multiplatform applications." headerButtonTitle: "Learn More" headerButtonUrl: "/what-is-scala/" @@ -13,21 +13,21 @@ headerButtonUrl: "/what-is-scala/" gettingStarted: mainTitle: "Get Started" mainUrl: "https://docs.scala-lang.org/getting-started.html" + subtitle: "Overview" + subtitleLink: "https://docs.scala-lang.org/tour/tour-of-scala.html" + links: + - title: "Guide" + url: "https://docs.scala-lang.org/scala3/book/introduction.html" + - title: "Courses" + url: "https://docs.scala-lang.org/online-courses.html" +apiDocs: + mainTitle: "Documentation" + mainUrl: "https://docs.scala-lang.org" subtitle: "API Docs" subtitleLink: "https://docs.scala-lang.org/api/all.html" links: - title: "Migrate to Scala 3" url: "https://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html" -apiDocs: - mainTitle: "Learn Scala" - mainUrl: "https://docs.scala-lang.org" - subtitle: "Scala Book" - subtitleLink: "https://docs.scala-lang.org/scala3/book/introduction.html" - links: - - title: "Tour" - url: "https://docs.scala-lang.org/tour/tour-of-scala.html" - - title: "Courses" - url: "https://docs.scala-lang.org/online-courses.html" # Scala backends @@ -64,6 +64,18 @@ scalaIDEs: icon: /resources/img/frontpage/sublime.png metals: true url: "https://scalameta.org/metals/docs/editors/sublime.html" + +# Why Scala +whyScalaTitle: "Why Scala?" + +# Scala use cases +useCaseTitle: "Proven Use Cases" +useCaseIntroduction: "People around the world trust Scala to build useful software, some of the most popular domains include:" + # Scala ecosystem ecosystemTitle: "Scala's libraries unlock your potential" + +# Scala users +scalaUsersTitle: "Users of Scala" +scalaUsersIntroduction: "Scala is used by thousands of developers, students, hobbyists and teachers around the world. See why you should try it." --- diff --git a/resources/img/frontpage/notebook.png b/resources/img/frontpage/notebook.png new file mode 100644 index 000000000..5995bf22a Binary files /dev/null and b/resources/img/frontpage/notebook.png differ diff --git a/resources/img/frontpage/scala-language-brand.png b/resources/img/frontpage/scala-language-brand.png new file mode 100644 index 000000000..719a7573f Binary files /dev/null and b/resources/img/frontpage/scala-language-brand.png differ diff --git a/resources/img/frontpage/scala-logo-solo-white.png b/resources/img/frontpage/scala-logo-solo-white.png new file mode 100644 index 000000000..0f0815cf5 Binary files /dev/null and b/resources/img/frontpage/scala-logo-solo-white.png differ diff --git a/resources/img/frontpage/scala-logo-solo-white.svg b/resources/img/frontpage/scala-logo-solo-white.svg new file mode 100644 index 000000000..3ff1d09fc --- /dev/null +++ b/resources/img/frontpage/scala-logo-solo-white.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/frontpage/scala-logo-solo-white@2x.png b/resources/img/frontpage/scala-logo-solo-white@2x.png new file mode 100644 index 000000000..b1d20a396 Binary files /dev/null and b/resources/img/frontpage/scala-logo-solo-white@2x.png differ diff --git a/resources/img/frontpage/scala-logo-white-hero.png b/resources/img/frontpage/scala-logo-white-hero.png new file mode 100644 index 000000000..0c548d91f Binary files /dev/null and b/resources/img/frontpage/scala-logo-white-hero.png differ diff --git a/resources/img/frontpage/scala-logo-white-hero@2x.png b/resources/img/frontpage/scala-logo-white-hero@2x.png new file mode 100644 index 000000000..4eafb479f Binary files /dev/null and b/resources/img/frontpage/scala-logo-white-hero@2x.png differ diff --git a/resources/img/icons/icon1.svg b/resources/img/icons/icon1.svg new file mode 100644 index 000000000..75d659bdb --- /dev/null +++ b/resources/img/icons/icon1.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon10.svg b/resources/img/icons/icon10.svg new file mode 100644 index 000000000..47e495dca --- /dev/null +++ b/resources/img/icons/icon10.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon11.svg b/resources/img/icons/icon11.svg new file mode 100644 index 000000000..54c62250e --- /dev/null +++ b/resources/img/icons/icon11.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon12.svg b/resources/img/icons/icon12.svg new file mode 100644 index 000000000..f29ee52eb --- /dev/null +++ b/resources/img/icons/icon12.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon13.svg b/resources/img/icons/icon13.svg new file mode 100644 index 000000000..962b4e937 --- /dev/null +++ b/resources/img/icons/icon13.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon14.svg b/resources/img/icons/icon14.svg new file mode 100644 index 000000000..9d9667dc0 --- /dev/null +++ b/resources/img/icons/icon14.svg @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon15.svg b/resources/img/icons/icon15.svg new file mode 100644 index 000000000..6c873407a --- /dev/null +++ b/resources/img/icons/icon15.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon2.svg b/resources/img/icons/icon2.svg new file mode 100644 index 000000000..a6faf4653 --- /dev/null +++ b/resources/img/icons/icon2.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon3.svg b/resources/img/icons/icon3.svg new file mode 100644 index 000000000..56cdb3d74 --- /dev/null +++ b/resources/img/icons/icon3.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon4.svg b/resources/img/icons/icon4.svg new file mode 100644 index 000000000..a312fb1b0 --- /dev/null +++ b/resources/img/icons/icon4.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon5.svg b/resources/img/icons/icon5.svg new file mode 100644 index 000000000..d60285637 --- /dev/null +++ b/resources/img/icons/icon5.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon6.svg b/resources/img/icons/icon6.svg new file mode 100644 index 000000000..04323ebab --- /dev/null +++ b/resources/img/icons/icon6.svg @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon7.svg b/resources/img/icons/icon7.svg new file mode 100644 index 000000000..646d1dfa3 --- /dev/null +++ b/resources/img/icons/icon7.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon8.svg b/resources/img/icons/icon8.svg new file mode 100644 index 000000000..0376e3400 --- /dev/null +++ b/resources/img/icons/icon8.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/icons/icon9.svg b/resources/img/icons/icon9.svg new file mode 100644 index 000000000..d8aa2ad01 --- /dev/null +++ b/resources/img/icons/icon9.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/js/functions.js b/resources/js/functions.js index 7f9c64df3..c50a30be3 100644 --- a/resources/js/functions.js +++ b/resources/js/functions.js @@ -1,7 +1,7 @@ --- --- -// Sliding Panel and scala in a nutshell +// Sliding Panel $(document).ready(function() { $('.navigation-panel-button,.navigation-fade-screen,.navigation-panel-close').on('click touchstart', function(e) { $('.navigation-menu,.navigation-fade-screen').toggleClass('is-visible'); @@ -22,8 +22,7 @@ $(document).ready(function() { var jButton = $(button); var expandButton = jButton.children('.button-more'); if (expandButton.length > 0) { - var target = jButton.is('.scala-item__governance') ? expandButton : jButton; - target.click(function(event) { + expandButton.click(function(event) { var activeCode = contents.eq(index2); var others = allContents.not(activeCode); allButtons.removeClass('active');