Giter Site home page Giter Site logo

montogeek / angular-ux Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mgonto/angular-ux

0.0 3.0 0.0 108 KB

A library that helps you create live, navigable prototypes with the help of AngularJS but without having to learn how to code ;). DESIGNERS, I'm looking at you!

Home Page: http://gon.to/

License: MIT License

CSS 2.94% JavaScript 71.19% HTML 25.87%

angular-ux's Introduction

angular-ux

Angular UX is a library that helps you create live, navigable prototypes with the help of AngularJS but without having to learn how to code ;). DESIGNERS, I'm looking at you!

Key features

  • Helps you create live, navigable prototypes
  • It's intended for designers, not coders
  • No need to code a single line of JS.

Installing it

You have several options:

bower install angular-ux
npm install angular-ux
<script type="text/javascript" src="https://rawgit.com/mgonto/angular-ux/master/dist/angular-ux.js"></script>

Configuring it

Setting up our prototype app

The first thing we need to do is setup a new index.html which will be the point of entry for our app. Besides linking to the specific CSS and JS files we need for our prototype, we always need to reference jQuery, angular.js, angular-animate and angular-ux in that order.

We also need some way of serving the directory where the index.html and the other files will reside. For that, we can use npm command serve or python -M SimpleHTTPServer

Setting up the Angular application

Now, we need to setup the Angular application. This will be the only javascript we need to code to have our prototype running. The good thing is that it’s just copy and paste ;).

<body ng-app=“prototype” ng-ctrl=“MainCtrl”>
</body>
// app.js
angular.module(‘prototype’, [‘ngAnimate’, ‘ux’])
  .controller(‘MainCtrl’, function($scope) {
    $scope.data = {};
  });

Usage / Features

Navigating through different pages

The first thing all prototypes need is the ability to navigate through different pages. For this, we can use the ux-page directive.

<body>
  <ux-page name=“Home” home>
    <ng-include src=“’home.html’”></ng-include>
  </ux-page>
  <ux-page name=“Details”>
    <ng-include src=“’detail.html’”></ng-include>
  </ux-page>
</body>
<!-- home.html -->
<!-- ... -->
<a href=“” ux-go=“Details”>Go to Details page</a>

In this case, we’re creating 2 different pages. The content of each of those pages are in separate files which we’re including using the ng-include directive. Note that we added the home attribute to the ux-page that will be the main one (displayed by default).

Then, in the home.html, we have a link that navigates the user to the Details page. For that, we’re using the ux-go directive with the name of the page that we want to browse to.

Note: It’s important to note that you must put the href=“” in the link so that it’s clickable.

Theming

When you’re prototyping you want to try different themes (colors, typographies, sizes, etc.) at the same time to see which one works better. For that, you can use a the ux-themeable feature from angular-ux:

<div class=“content” ux-themeable>
  <h1>Title</h1>
  <p>This is some text</p>
</div>

First you need to add the ux-themeable directive to the parent HTML element that you want to theme. Then, to change themes, you need to specify the theme name as a query parameter in the prototype URL. For example, if you go to http://localhost:3000/#/?page=Details&uxTheme=option1, the div.content will end up having an additional class named option1 which means we can style it as follows:

div.content.option1 h1 {
  font-size: 38px;
}

div.content.option1 p {
  color: red
}

Alternatively, you can set the query parameter to use for this ux-themeable as follows:

<div class=“content” ux-themeable="contentTheme">
  <h1>Title</h1>
  <p>This is some text</p>
</div>

Then, the URL to add option1 class to div.content would be http://localhost:3000/#/?page=Details&ucontentTheme=option1

Examples

You can see a live example in the example folder.

To start the sample, just run serve or python -M SimpleHTTPServer on the repository root and then go to http://localhost:3000/example/

License

MIT

angular-ux's People

Watchers

 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.