Sha256: 722971686d58abe66ca353cc81e6fa50512897897367ca3baaed1d54607a90a2

Contents?: true

Size: 954 Bytes

Versions: 17

Compression:

Stored size: 954 Bytes

Contents

# frozen_string_literal: true

require 'atome/renderers/html/effect'
require 'atome/renderers/html/event'
require 'atome/renderers/html/geometry'
require 'atome/renderers/html/identity'
require 'atome/renderers/html/spatial'
require 'atome/renderers/html/atome'
require 'atome/renderers/html/utility'

# #html object
class Html
  def initialize
    html = `document.createElement("div")`
    `document.body.appendChild(#{html})`
    `document.body.appendChild(#{html})`
    @html = html
  end

  def add_class(class_to_add)
    `#{@html}.classList.add(#{class_to_add})`
  end

  def attr(attribute, value)
    `#{@html}.setAttribute(#{attribute}, #{value})`
  end

  def style
    # `#{@html}.style`
  end
  def append_shape(parent)
    parent_found = `document.getElementById(#{parent})`
    parent_found
    `#{parent_found}.appendChild(#{@html})`
  end
  def append_color(parent)
     "color : #{parent.class}"
  end
  def append_to(_node)

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
atome-0.5.4.1.9 lib/atome/renderers/html/html.rb
atome-0.5.4.1.7 lib/atome/renderers/html/html.rb
atome-0.5.4.1.3 lib/atome/renderers/html/html.rb
atome-0.5.4.1.2 lib/atome/renderers/html/html.rb
atome-0.5.4.1.1 lib/atome/renderers/html/html.rb
atome-0.5.4.1.0 lib/atome/renderers/html/html.rb
atome-0.5.4.0.9 lib/atome/renderers/html/html.rb
atome-0.5.3.8.8 lib/atome/renderers/html/html.rb
atome-0.5.3.8.1 lib/atome/renderers/html/html.rb
atome-0.5.3.8.0 lib/atome/renderers/html/html.rb
atome-0.5.3.7.8 lib/atome/renderers/html/html.rb
atome-0.5.3.7.3 lib/atome/renderers/html/html.rb
atome-0.5.3.7.2 lib/atome/renderers/html/html.rb
atome-0.5.3.4 lib/atome/renderers/html/html.rb
atome-0.5.3.2 lib/atome/renderers/html/html.rb
atome-0.5.2.8 lib/atome/renderers/html/html.rb
atome-0.5.2.7 lib/atome/renderers/html/html.rb