mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-25 18:51:41 +03:00
Improve example visual (a bit)
This commit is contained in:
parent
27225b40fb
commit
c6ab2b4b8a
@ -5,7 +5,7 @@ import Ast
|
||||
import Ast.Expression exposing (..)
|
||||
import Ast.Statement exposing (..)
|
||||
import Html exposing (Html, p, div, li, ul, pre, textarea, text)
|
||||
import Html.Attributes exposing (id)
|
||||
import Html.Attributes exposing (id, class)
|
||||
import Html.Events exposing (..)
|
||||
import Json.Decode as JD
|
||||
import Lint
|
||||
@ -116,14 +116,23 @@ lint source =
|
||||
view : String -> Html Msg
|
||||
view model =
|
||||
div [ id "wrapper" ]
|
||||
[ textarea
|
||||
[ id "left"
|
||||
, on "input" (JD.map Replace targetValue)
|
||||
[ div [ id "left" ]
|
||||
[ p [ class "title" ] [ text "Source code" ]
|
||||
, textarea
|
||||
[ id "input"
|
||||
, on "input" (JD.map Replace targetValue)
|
||||
]
|
||||
[ text model ]
|
||||
, div []
|
||||
[ p [ class "title" ] [ text "Linting errors" ]
|
||||
, div [ id "lint" ]
|
||||
[ lint model
|
||||
]
|
||||
]
|
||||
]
|
||||
[ text model ]
|
||||
, div [ id "right" ]
|
||||
[ p [ id "ast" ] [ tree <| Ast.parse model ]
|
||||
, p [ id "lint" ] [ lint model ]
|
||||
[ p [ class "title" ] [ text "AST" ]
|
||||
, p [ id "ast" ] [ tree <| Ast.parse model ]
|
||||
]
|
||||
]
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>elm-lint</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="description" content="An online Elm linter.">
|
||||
<style>
|
||||
</script>
|
||||
textarea {
|
||||
font-family: monospace;
|
||||
width: 100%;
|
||||
@ -25,6 +29,11 @@
|
||||
#left {
|
||||
flex: 0 0 40%;
|
||||
}
|
||||
#input {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 60%;
|
||||
}
|
||||
#right {
|
||||
flex: 1;
|
||||
}
|
||||
@ -34,5 +43,8 @@
|
||||
#lint {
|
||||
border: solid 1px;
|
||||
}
|
||||
.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user