Skip to content
Snippets Groups Projects
Commit b6d79fb3 authored by Sabed Ger's avatar Sabed Ger
Browse files

1. Elm Datei und zugehörigkeiten

parent 202c9e23
No related branches found
No related tags found
1 merge request!1Develop
elm-stuff/*
# WWW20 Projekt ShapePicture Editor
# WWW Projekt ShapePicture Editor
Projektidee:
Website zum Erstellen von Shapes und Export als Json.
Möglichkeit zur Eingabe eigener Bilder und Jsons von Shapes.
Am besten dann wenn Andere die Möglichkeit haben das so entstandene Bild mit shapes in ihrer Website einbinden könenn
elm.json 0 → 100644
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0",
"elm/http": "2.0.0",
"elm/json": "1.1.3",
"elm/svg": "1.0.1",
"elm/url": "1.0.0"
},
"indirect": {
"elm/bytes": "1.0.8",
"elm/file": "1.0.5",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
index.html 0 → 100644
This diff is collapsed.
module ShapePicture_Editor exposing (main)
--Browser
import Browser
import Browser.Navigation as Nav
-- Html
import Html exposing (Html, div, text, node, button, a)
import Html.Attributes
import Html.Events
-- Svg
import Svg
import Svg.Attributes
import Svg.Events
-- Http
import Http
-- Json
import Json.Decode
-- Url
import Url
main = Browser.application
{ init = init
, subscriptions = subscriptions
, update = update
, view = documentView
, onUrlChange = UrlChanged
, onUrlRequest = LinkClicked
}
type alias Model =
{ key : Nav.Key
, url : Url.Url
}
type Msg
-- Url
= LinkClicked Browser.UrlRequest
| UrlChanged Url.Url
init : () -> Url.Url -> Nav.Key-> (Model, Cmd Msg)
init _ url key =
( Model key url
, Cmd.none
)
subscriptions : Model -> Sub Msg
subscriptions model = Sub.none
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case msg of
LinkClicked urlRequest ->
case urlRequest of
Browser.Internal url ->
( model, Nav.pushUrl model.key (Url.toString url) )
Browser.External href ->
( model, Nav.load href )
UrlChanged url ->
( { model | url = url }
, Cmd.none
)
-- VIEW
documentView : Model -> Browser.Document Msg
documentView model = { title = "ShapePicture_Editor"
, body = [view model]
}
view : Model -> Html Msg
view model = div [] [text "Leere Application Vorlage"]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment