npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lettuce

v0.2.4

Published

Lettuce JS, Mini Mobile Framework for Romantic with DSL.

Downloads

14

Readme

Build Status Version Code Climate Test Coverage Node npm LICENSE

Lettuce

#Lettuce, Mobile Framework for romantic#

Lettuce is a Small & Powerful Framework for Romantic. Online demo http://phodal.github.io/lettuce.

Lettuce 是一个轻巧的移动开发框架。

用途: Romantic前端学习

##Gallery(展示)##

应用场景

##Lettuce Usage(用法)##

###Class(类)###

var L = new lettuce();
var zero = function(){

};
var sub = new L.Class(zero);

###Template(模板)###

var L = new lettuce();
var data = {
    "title": "JavaScript Templates"
};

var result = L.Template.tmpl("<h3>{%=o.title%}</h3>\n!@#$%^&*()-=", data);

###Router(路由)###

var L = new lettuce();

var check = L.Router
            .add(/#about/,log)
            .add(/#what/, log)
            .add(/#why/, log)
            .load();;

###Effect(效果)###

####淡出####

L.FX.fadeOut(document.getElementById('content'), {
    duration: 2000, complete: function () {
    }
});

####淡入####

L.FX.fadeIn(document.getElementById('content'), {
    duration: 2000, complete: function () {
    }
});

###Promise###

function late(n) {
    var L = new lettuce();
    var p = new L.Promise();
    return p;
}

late(100).then(
).then(
).done();

###Ajax###

lettuce.get('/bower.json', function(result){
    equal(result["name"], "lettuce");
    done();
})
lettuce.post("http://127.0.0.1:5000/some", "something", function(data){
    console.log(data)
})

###AMD

RequireJS Config

require.config({
  baseUrl: 'app',
  paths: {
    lettuce: 'lib/lettuce'
  }
});

App.js

define(['lettuce'],
  function (Lettuce) {
    var lettuce = new Lettuce();
  };
});    

##Single Page Application Example(单页面应用)##

1.new a instance

var L = new lettuce();

2.define data

var data = {
    about: "Template",
    what: "This about A Mobile Framework For Romantic",
    why: "Why is a new Framework"
};

3.create function for router

var aboutPage = function(){
    var aboutPage = new L.SimpleView();
    var templates = L.Template.tmpl("<h3>{%=o.about%}</h3>", data);
    return aboutPage.render(templates, "results");
};
var whyPage = function(){
    var whyPage = new L.SimpleView();
    var templates = L.Template.tmpl("<h3>{%=o.why%}</h3>", data);
    return whyPage.render(templates, "results");
};

4.Add router

L.Router
    .add(/#about/, about)
    .add(/#why/, why)
    .load();

##Process##

###Done###

  • Template
  • Router
  • Ajax
  • Class
  • Promise
  • Event
  • Effect

###On Going###

  • View

##License##

© 2015 Phodal Huang. This code is distributed under the MIT license. See LICENSE.txt in this directory.

待我代码编成,娶你为妻可好