All Projects → joakin → Elm Canvas

joakin / Elm Canvas

Licence: bsd-3-clause
A canvas drawing library for Elm

Programming Languages

elm
856 projects

Projects that are alternatives of or similar to Elm Canvas

Custom Elements Ts
Create native custom elements using Typescript
Stars: ✭ 52 (-58.06%)
Mutual labels:  web-components, custom-elements
Use Custom Element
Custom hook to bridge Custom Elements (Web Components) to React.
Stars: ✭ 77 (-37.9%)
Mutual labels:  web-components, custom-elements
File Input
A better <input type="file">
Stars: ✭ 59 (-52.42%)
Mutual labels:  web-components, custom-elements
Emoji Picker Element
A lightweight emoji picker for the modern web
Stars: ✭ 587 (+373.39%)
Mutual labels:  web-components, custom-elements
Dataformsjs
🌟 DataFormsJS 🌟 A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.
Stars: ✭ 95 (-23.39%)
Mutual labels:  web-components, custom-elements
Xy Ui
🎨面向未来的原生 web components UI组件库
Stars: ✭ 603 (+386.29%)
Mutual labels:  web-components, custom-elements
Task Lists Element
Drag and drop task list items.
Stars: ✭ 73 (-41.13%)
Mutual labels:  web-components, custom-elements
Details Menu Element
A menu opened with <details>.
Stars: ✭ 455 (+266.94%)
Mutual labels:  web-components, custom-elements
Aybolit
Lightweight web components library built with LitElement.
Stars: ✭ 90 (-27.42%)
Mutual labels:  web-components, custom-elements
Auto Check Element
An input element that validates its value with a server endpoint.
Stars: ✭ 85 (-31.45%)
Mutual labels:  web-components, custom-elements
Dark Mode Toggle
A custom element that allows you to easily put a Dark Mode 🌒 toggle or switch on your site:
Stars: ✭ 550 (+343.55%)
Mutual labels:  web-components, custom-elements
Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (-10.48%)
Mutual labels:  web-components, custom-elements
Remount
Mount React components to the DOM using custom elements
Stars: ✭ 522 (+320.97%)
Mutual labels:  web-components, custom-elements
Details Dialog Element
A modal dialog that's opened with <details>.
Stars: ✭ 603 (+386.29%)
Mutual labels:  web-components, custom-elements
Vanilla Colorful
A tiny color picker custom element for modern web apps (2.7 KB) 🎨
Stars: ✭ 467 (+276.61%)
Mutual labels:  web-components, custom-elements
Sketches
a starting point for sketches
Stars: ✭ 66 (-46.77%)
Mutual labels:  generative-art, canvas
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+3632.26%)
Mutual labels:  generative-art, canvas
Lume
Create CSS3D/WebGL applications declaratively with HTML. Give regular DOM elements shadow and lighting.
Stars: ✭ 445 (+258.87%)
Mutual labels:  web-components, custom-elements
Watercolor Canvas
Creating watercolor-style canvas art
Stars: ✭ 84 (-32.26%)
Mutual labels:  generative-art, canvas
Vanilla Hamburger
Animated hamburger menu icons for modern web apps (1.8 KB) 🍔
Stars: ✭ 110 (-11.29%)
Mutual labels:  web-components, custom-elements

joakin/elm-canvas

This module exposes a nice drawing API that works on top of the the DOM canvas.

Live examples (example sources)

Usage

To use it, read the docs on the Canvas module, and remember to include the elm-canvas custom element script in your page before you initialize your Elm application.

Then, you can add your HTML element like this:

module Main exposing (main)

import Canvas exposing (..)
import Canvas.Settings exposing (..)
import Color -- elm install avh4/elm-color
import Html exposing (Html)
import Html.Attributes exposing (style)

view : Html msg
view =
    let
        width = 500
        height = 300
    in
        Canvas.toHtml (width, height)
            [ style "border" "1px solid black" ]
            [ shapes [ fill Color.white ] [ rect (0, 0) width height ]
            , renderSquare
            ]

renderSquare =
  shapes [ fill (Color.rgba 0 0 0 1) ]
      [ rect (0, 0) 100 50 ]

main = view

Examples

You can see many examples in the examples/ folder, and experience them live.

Additionally, some of the p5js.org examples were adapted to Elm using this package. They can be found in the Elm discourse thread.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].