Sha256: a50c38553ca0fe0ec2513dcdec3fc842f8786d514e6e34fbecb4e2278fd5d0d1

Contents?: true

Size: 451 Bytes

Versions: 74

Compression:

Stored size: 451 Bytes

Contents

# frozen_string_literal: true

class Atome
  def html(obj = nil)
    if obj
      @html = obj
    else
      @html
    end
  end

  def to_px(particle)
    ruby_wasm_code = <<-JS
  var div = document.getElementById("#{@id}");
  var style = window.getComputedStyle(div);
  var original_value = style.getPropertyValue("#{particle}");
  var parsed_value = parseInt(original_value);
  return parsed_value;
    JS
    JS.eval(ruby_wasm_code).to_f
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
atome-0.5.7.4.2 lib/renderers/html/atome_html.rb
atome-0.5.7.3.9 lib/renderers/html/atome_html.rb
atome-0.5.7.3.6 lib/renderers/html/atome_html.rb
atome-0.5.7.3.5 lib/renderers/html/atome_html.rb
atome-0.5.7.3.3 lib/renderers/html/atome_html.rb
atome-0.5.7.3.2 lib/renderers/html/atome_html.rb
atome-0.5.7.3.1 lib/renderers/html/atome_html.rb
atome-0.5.7.3.0 lib/renderers/html/atome_html.rb
atome-0.5.7.1.8 lib/renderers/html/atome_html.rb
atome-0.5.7.1.7 lib/renderers/html/atome_html.rb
atome-0.5.7.1.0 lib/renderers/html/atome_html.rb
atome-0.5.7.0.7 lib/renderers/html/atome_html.rb
atome-0.5.7.0.5 lib/renderers/html/atome_html.rb
atome-0.5.7.0.4 lib/renderers/html/atome_html.rb
atome-0.5.7.0.3 lib/renderers/html/atome_html.rb
atome-0.5.7.0.2 lib/renderers/html/atome_html.rb
atome-0.5.6.8.7 lib/renderers/html/atome_html.rb
atome-0.5.6.8.6 lib/renderers/html/atome_html.rb
atome-0.5.6.8.5 lib/renderers/html/atome_html.rb
atome-0.5.6.8.3 lib/renderers/html/atome_html.rb