Sha256: 965fc145d71881c4465e49dd4829f27a36cffbc532bfe183bd077cfc3775ffbd

Contents?: true

Size: 1.85 KB

Versions: 1607

Compression:

Stored size: 1.85 KB

Contents

<%= pb_rails("flex") do %>
  <%= pb_rails("flex/flex_item", props: {fixed_size: "250px"}) do %>
    <%= pb_rails("select", props: {
    id: "transition-dropdown",
    label: "",
    blank_selection: "Select a Transition...",
    options: [
        {
          value: 'fade',
        },
        {
          value: 'blur',
        },
        {
          value: 'scale',
        },
    ]
    }) %>
  <% end %>
    <%= pb_rails("flex/flex_item") do %>
      <%= pb_rails("button", props: {classname: "button", text: "Load Image", margin_left: "sm", margin_top: "xs", disabled: true }) %>
    <% end %>
<% end %>
<%= pb_rails("image",  props: { classname: "transition-image", alt: "picture of a misty forest", url: "", on_error: "this.style.display = 'none'" }) %>

<script>
    window.addEventListener('DOMContentLoaded', () => {
        const button = document.querySelector(".button")
        const transitionDropdown = document.querySelector("#transition-dropdown")
        var option = ''

        transitionDropdown.addEventListener('change', function() {
          if (this.value === '') {
            button.className = button.className + ' _disabled'
          } else {
            button.removeAttribute("disabled");
            button.className = button.className.replace(/\_disabled/gi, '')
            option = this.value
          }
        });

        const updateTransition = (transition) => {
          const imageTransition = document.querySelector('.transition-image')
            imageTransition.removeAttribute("style")
            imageTransition.classList.remove("fade", "blur", "scale", "lazyloaded")
            imageTransition.classList.add(transition, "lazyload")
            imageTransition.src = "https://unsplash.it/500/400/?image=634"
        }
      
        button.addEventListener('click', function() {
          updateTransition(option)
        })
    });
</script>

Version data entries

1,607 entries across 1,607 versions & 2 rubygems

Version Path
playbook_ui_docs-14.8.0.pre.alpha.PLAY1658tanstackbump4657 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.8.0.pre.alpha.PLAY1658tanstackbump4657 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui_docs-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb
playbook_ui-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb