This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Mateiadrielrafael/develop
Release
- Loading branch information
Showing
27 changed files
with
510 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
@import "../theme.scss"; | ||
|
||
.node.selected { | ||
border: 10px solid red; | ||
} | ||
|
||
.node-input { | ||
transition: stroke-width $transition-time; | ||
} | ||
|
||
.node-input:hover { | ||
stroke-width: 9px; | ||
} | ||
|
||
.node-output { | ||
transition: transform $transition-time; | ||
} | ||
|
||
.node-output:hover { | ||
transform: scale(1.3); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,10 @@ | |
overflow: hidden; | ||
text-transform: capitalize; | ||
} | ||
|
||
#node-type { | ||
font-size: 0.85rem; | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Lunarbox.Component.Editor.HighlightedType | ||
( highlightedType | ||
, highlightTypeToHTML | ||
, highlightTypeToSvg | ||
) where | ||
|
||
import Prelude | ||
import Data.Maybe (Maybe(..), fromMaybe) | ||
import Halogen.HTML as HH | ||
import Lunarbox.Capability.Editor.Type (typeToColor) | ||
import Lunarbox.Component.HighlightedText as HT | ||
import Lunarbox.Data.Dataflow.Type (Type(..)) | ||
import Lunarbox.Math.SeededRandom (seededInt) | ||
import Lunarbox.Svg.Element (tspan) | ||
import Svg.Attributes (Color(..)) | ||
import Svg.Attributes as SA | ||
|
||
-- A type which is syntax highlighted | ||
highlightedType :: forall h a. (Array (HH.HTML h a) -> HH.HTML h a) -> (Color -> HH.HTML h a -> HH.HTML h a) -> Color -> Type -> HH.HTML h a | ||
highlightedType container highlight defaultColor = case _ of | ||
TArrow from to -> | ||
container | ||
[ highlightedType container highlight defaultColor from | ||
, HH.text " -> " | ||
, highlightedType container highlight defaultColor to | ||
] | ||
TVarariable name' -> highlight (RGB shade shade shade) $ HH.text $ show name' | ||
where | ||
shade = seededInt (show name') 100 255 | ||
other -> highlight color $ HH.text $ show other | ||
where | ||
color = fromMaybe defaultColor $ typeToColor other | ||
|
||
highlightTypeToHTML :: forall h a. Color -> Type -> HH.HTML h a | ||
highlightTypeToHTML = highlightedType HH.span_ HT.highlight | ||
|
||
highlightTypeToSvg :: forall h a. Color -> Type -> HH.HTML h a | ||
highlightTypeToSvg = | ||
highlightedType (tspan []) \color -> | ||
tspan [ SA.fill $ Just color ] <<< pure |
Oops, something went wrong.