Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Less Complex Web with Ratchet & Jank

A Less Complex Web with Ratchet & Jank

Jay Hayes

May 10, 2017
Tweet

More Decks by Jay Hayes

Other Decks in Programming

Transcript

  1. @iamvery ♥ <% if [earth, moon, sun].all?(&:aligned?) %> <figure> <%=

    moon.between?(earth..sun) ? sun.eclipsed : moon.eclipsed %> </figure> <% else %> <% if earth.daytime? %> <figure><%= sun.shine %></figure> <% else %> <figure><%= moon.shine %></figure> <% end %> <% end %>
  2. @iamvery ♥ %{ posts: [ %{title: "Interesting Facts”, body: "Cats

    are soft. Dogs are noisy."}, %{title: "Bears", body: "Bears eat beets."}, ] }
  3. @iamvery ♥ <%= for post <- @data.posts %> <article> <h2><%=

    post.title %></h2> <p><%= post.body %></p> </article> <% end %>
  4. @iamvery ♥ <article data-prop="posts"> <h2 data-prop=“title">Interesting Facts</h2> <p data-prop=“body”> Cats

    are soft. Dogs are noisy. </p> </article> <article data-prop="posts"> <h2 data-prop="title">Bears</h2> <p data-prop=“body”> Bears eat beets. </p> </article>
  5. @iamvery ♥ <%= for post <- @data.posts %> <article> <h2><%=

    post.title %></h2> <p><%= post.body %></p> </article> <% end %>
  6. @iamvery ♥ %{ active_user: %{name: "Jay"}, posts: [ %{ title:

    "Cats Facts", body: "Some cats are fuzzy.", comments: ["I like cats.", "I prefer dogs."], edit_link: {"Edit 'Cat Facts'", href: "http://example.com/posts/1"}, }, %{ title: "Sleepy Dog", body: "Dogs sleep a lot.", comments: [], edit_link: {"Edit 'Sleepy Dog'", href: "http://example.com/posts/2"}, }, ], new_post: [disabled: true], }
  7. @iamvery ♥ “A set of pre-defined transformations used to bind

    content to elements” https://github.com/iamvery/ratchet
  8. @iamvery ♥ “It’s a mystery to me why we can’t

    write plain HTML and CSS.” - Designer