Sha256: 429cff7f3d8446c0b9b7d330dabc3a2096cb1ff24529976cc3355802b127bce3

Contents?: true

Size: 1.56 KB

Versions: 34

Compression:

Stored size: 1.56 KB

Contents

# frozen_string_literal: true

new({ renderer: :html, method: :smooth, type: :string }) do |value, _user_proc|
  format_params = case value
                  when Array
                    data_collected = []
                    value.each do |param|
                      data_collected << "#{param}px"
                    end
                    data_collected.join(' ')
                  when Integer
                    "#{value}px"
                  else
                    if value.is_a?(String) && value.end_with?('%')
                      value
                    else
                      "#{value}px"
                    end
                  end
  html.style('border-radius', format_params)
end

new({ renderer: :html, method: :blur, type: :integer }) do |params, _user_proc|
    if params[:affect] == :back || params[:affect] == :back
      html.backdropFilter(:blur, "#{params[:value]}px")
    else
      html.filter(:blur, "#{params[:value]}px")
    end
  end


new({ renderer: :html, method: :blur, type: :integer, specific: :shadow }) do |params, _user_proc|
  if params[:affect] == :back
    html.backdropFilter(:blur, "#{params[:value]}px")
  else
    html.filter(:blur, "#{params[:value]}px")
  end
  # now we refresh if needed for dynamic refresh od affected atomes
   affect(affect)
end

# new({ particle: :blur, category: :effect, type: :int , specific: :shadow}) do |params|
#   alert :cool
#   if affect.nil?
#     affect_to = affect
#   else
#     affect_to = [:self]
#   end
#   val= { value: params, affect: affect_to } unless params.instance_of?(Hash)
#   val
# end

Version data entries

34 entries across 34 versions & 1 rubygems

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