Sha256: ed084fed07e06dad246979e97c20b4587750735008be1d77ede0555591db96f7

Contents?: true

Size: 959 Bytes

Versions: 2

Compression:

Stored size: 959 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)
    alert "color : #{parent.class}"
  end
  def append_to(_node)

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
atome-0.5.1.4 lib/atome/renderers/html/html.rb
atome-0.5.1.1 lib/atome/renderers/html/html.rb