• ¶

    Editor template

    - activeIndex = @activeIndex
    - activeTool = @activeTool
    - previousTool = @previousTool
    - editor = this
    - Observable = require "observable"
    
    .editor
  • ¶

    The toolbar holds our tools.

      .toolbar
        .tools
          - each @tools, (tool) ->
            - activeClass = -> "active" if tool is activeTool()
            - activate = -> previousTool(activeTool()); activeTool(tool)
            .tool(style="background-image: url(#{tool.iconUrl})" class=activeClass click=activate)
        .tools
          - symmetryMode = @symmetryMode
          - each ["normal", "flip", "flop", "quad"], (mode) ->
            - activeClass = -> "active" if mode is symmetryMode()
            - activate = -> symmetryMode(mode)
            .tool(class=activeClass click=activate)= mode
  • ¶

    Our layers and preview canvases are placed in the viewport.

      .main
        .viewport
          .overlay
        - swap = (e) -> if ($t = $(e.currentTarget)).css("left") is "auto" then $t.css(left: 0, right: "auto") else $t.css(left: "auto", right: 0)
        .thumbnail(click=swap)
    
      .notifications
        - each @notifications, (notification) ->
          %p
            = notification
  • ¶

    The palette holds our colors.

      .palette
        .color.current
        - each @palette, (color, index) ->
          - activate = -> activeIndex index
          .color(click=activate touchstart=activate style="background-color: #{color}")
    
      .actions
        - each @actions, (action) ->
          .action(click=@perform touchstart=@perform style="background-image: url(#{@iconUrl})")
            .text= @name
            .text= @hotkey
  • ¶

    Modal junk

    #modal