Giter Club home page Giter Club logo

scenic_layout's Introduction

ScenicLayout

This is an experimental library for render layouts using scenic.

Sample

defmodule ScenicLayoutTest.Scene.Test do
  use ScenicLayout

  require Logger

  view_port margin: 10 do
    linear_layout orientation: :horizontal do
      linear_layout height: :fill_parent, orientation: :vertical do
        box(color: :white, margin_right: 20, margin_bottom: 20)

        linear_layout height: :fill_parent, orientation: :horizontal do
          box(color: :red, height: :fill_parent, width: :fill_parent)
          box(color: :cyan, height: :fill_parent, width: :fill_parent)
        end
      end

      linear_layout height: :fill_parent, orientation: :horizontal do
        box(color: :red, padding_right: 10)

        linear_layout height: :fill_parent, orientation: :vertical do
          box(color: :lime, height: :fill_parent, width: :fill_parent)
          box(color: :purple, height: :fill_parent, width: :fill_parent)
          box(color: :lime, height: :fill_parent, width: :fill_parent)
          box(color: :purple, height: :fill_parent, width: :fill_parent)
          box(color: :lime, height: :fill_parent, width: :fill_parent)
          box(color: :purple, height: :fill_parent, width: :fill_parent)
        end
      end
    end
  end

  def handle_input(event, context, state) do
    Logger.info("Received event: #{inspect(event)} from #{inspect(context.id)}")
    {:noreply, state}
  end
end




Rendered scene

Installation

If available in Hex, the package can be installed by adding scenic_layout to your list of dependencies in mix.exs:

def deps do
  [
    {:scenic_layout, "~> 0.1.0"}
  ]
end

scenic_layout's People

Contributors

luisgabrielroldan avatar

Stargazers

Wess Cope avatar Mayeu avatar Ben Wheat avatar Pedro Assunção avatar ChanYub Park avatar Luke Taylor avatar Santiago Ferreira avatar Luis Ferreira avatar Jason Axelson avatar

Watchers

Jason Axelson avatar James Cloos avatar Luis Ferreira avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.