Skip to content

Commit da3069f

Browse files
Added logo
1 parent b5e8360 commit da3069f

File tree

4 files changed

+111
-1
lines changed

4 files changed

+111
-1
lines changed

src/main/resources/main.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,40 @@
1919
width: 800px;
2020
}
2121

22+
/*Logo*/
23+
24+
@font-face {
25+
font-family: "Forque";
26+
src: url('/fonts/Forque.woff') format('woff'),
27+
url('/fonts/Forque.svg') format('svg'),
28+
url('/fonts/Forque.ttf') format('truetype'),
29+
url('/fonts/Forque.eot') format('embedded-opentype');
30+
}
31+
32+
#logo {
33+
padding-left: 340px;
34+
}
35+
36+
#logo svg {
37+
margin-top: -25px;
38+
margin-bottom: 25px;
39+
}
40+
41+
#logo h1 {
42+
font-family: Forque;
43+
font-size: 80px;
44+
margin-left: 35px;
45+
}
46+
47+
#logo h1 a, #logo h1 a:hover {
48+
color: #333333;
49+
text-decoration: none;
50+
}
51+
52+
#logo path, #logo circle {
53+
cursor: pointer;
54+
}
55+
2256
/* Pie */
2357

2458
#pie svg {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package demo.components
2+
3+
import scala.scalajs.js
4+
import japgolly.scalajs.react._
5+
import japgolly.scalajs.react.vdom.all.{ a, h1, h3, href, div, className }
6+
import japgolly.scalajs.react.vdom.svg.all._
7+
import paths.mid.Bezier
8+
9+
import demo.colors._
10+
11+
12+
object logo {
13+
val Logo = ReactComponentB[Unit]("Paths.js")
14+
.render(_ => {
15+
val line = Bezier(List(
16+
(0, 50),
17+
(50, 70),
18+
(100, 40),
19+
(150, 30),
20+
(200, 60),
21+
(250, 80),
22+
(300, 50)
23+
))
24+
val circles = line.path.points.map(p => circle(
25+
r := 5,
26+
cx := p(0),
27+
cy := p(1),
28+
stroke := "red",
29+
strokeWidth := 2,
30+
fill := "white"
31+
))
32+
33+
div(id := "logo", className := "col-md-12",
34+
h1(a(href := "https://github.com/andreaferretti/paths-scala-js", "Paths.scala.js")),
35+
h3("Generate SVG paths for geometric shapes"),
36+
svg(width := 800, height := 100,
37+
g(transform := "translate(100, 0)",
38+
path(d := line.path.print, stroke := "red", fill := "none"),
39+
circles
40+
)
41+
)
42+
)
43+
})
44+
.build
45+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package demo.components
2+
3+
import scala.scalajs.js
4+
import japgolly.scalajs.react._
5+
import japgolly.scalajs.react.vdom.all._
6+
import paths.high.Pie
7+
8+
import demo.colors._
9+
10+
11+
object panel {
12+
case class PanelContent(id: Option[String], title: String, text: String)
13+
14+
val Panel = ReactComponentB[PanelContent]("Panel")
15+
.render((content, children) => {
16+
div(className := "col-md-6", id := content.id,
17+
div(className := "panel panel-default",
18+
div(className := "panel-heading",
19+
h2(className := "panel-title", content.title)
20+
),
21+
div(className := "panel-body",
22+
p(className := "alert alert-info", content.text),
23+
children
24+
)
25+
)
26+
)
27+
})
28+
.build
29+
}

src/main/scala/demo/components/toplevel.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import japgolly.scalajs.react._
44
import japgolly.scalajs.react.vdom.all._
55

66
import panel._
7+
import logo._
78
import piechart._
89

910

@@ -19,11 +20,12 @@ object toplevel {
1920
val TopLevel = ReactComponentB[Unit]("Top level component")
2021
.render(_ =>
2122
div(className := "container",
23+
div(className := "row", Logo(())),
2224
div(className := "row",
2325
Panel(PanelContent(
2426
id = Some("pie"),
2527
title = "Pie Chart",
26-
text = "Here is a pie chart example. Sectors are clickable"
28+
text = "Here is a pie chart example"
2729
), PieChart(countries))
2830
)
2931
)

0 commit comments

Comments
 (0)