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

lomo

v4.1.1

Published

用 OOP 的方式开发 HTML5

Downloads

88

Readme

LOMO Build Status

用 OOP 的方式开发 HTML5

Install 安装

npm install lomo

yarn add lomo

Options 可选项

babel-preset-lomo

.babelrc

{
  "presets": [
    "es2015",
    "stage-0",
    "lomo"
  ]
}

Usage 使用方法

  • ES5
<script type="text/javascript" src="path/to/lomo.js"></script>
var app = new lomo.Stage();
app.startup();

var img1 = new lomo.Image();
img1.source = "https://4.bp.blogspot.com/-QxIjKSiGWZU/Vi2iKa-D15I/AAAAAAAGqoo/D-0_NT3zkGo/s1600/%25E6%259D%25BE%25E6%259C%25AC%2B%25E6%25BD%25AE%25E9%2587%258C%2528Shiori%2BMatsumoto%2529-www.kaifineart.com-12.jpg";
app.addElement(img1);

var container = new lomo.DisplayObject();
container.setStyle({backgroundColor: 0xffee99});
app.addElement(container);

var input1 = new lomo.Input();
input1.setStyle({fontSize: '30px', color: 'red'});
input1.text = "但是,";
input1.name = 'input1';
input1.props.set('value', '______________________423er32');
console.log(input1.props.get('value'));
container.addElement(input1);

input1.addEventListener('textChanged', function (event) {
  console.log('input', event.target.text);
});

var label1 = new lomo.Label();
label1.style = {fontSize: '30px', color: 'red'};
label1.className = 'tf1_test';
label1.text = "但是,我们只保护我们的代码不受在其之后执行的代码的干扰,并不能防御先于我们代码执行的代码。";
label1.name = 'label1';
container.addElement(label1);

var video1 = new lomo.Video();
video1.addEventListener('sourceChanged', function (event) {
  console.log('video1', event.target.source);
});
video1.source = 'http://www.w3school.com.cn/i/movie.ogg';
video1.controls = false;
video1.autoplay = false;
video1.loop = true;
video1.width = 600;
video1.setAttribute('height', 600);
video1.name = 'video1';
container.addElement(video1);
  • ES6
import {Application, Image, Label, Video} from "lomo";
var app = new Application();
app.startup();

var img1 = new Image();
img1.source = "https://4.bp.blogspot.com/-QxIjKSiGWZU/Vi2iKa-D15I/AAAAAAAGqoo/D-0_NT3zkGo/s1600/%25E6%259D%25BE%25E6%259C%25AC%2B%25E6%25BD%25AE%25E9%2587%258C%2528Shiori%2BMatsumoto%2529-www.kaifineart.com-12.jpg";
app.addElement(img1);

var label1 = new Label();
label1.setStyle({fontSize: '30px', color: 'red'});
label1.className = 'tf1_test';
label1.text = "但是,我们只保护我们的代码不受在其之后执行的代码的干扰,并不能防御先于我们代码执行的代码。";
app.addElement(label1);

var video1 = new Video();
video1.addEventListener('sourceChanged', function (event) {
  console.log('video1', event.target.source);
});
video1.source = 'http://www.w3school.com.cn/i/movie.ogg';
video1.controls = false;
video1.autoplay = true;
video1.loop = true;
video1.width = 600;
app.addElement(video1);

Event

let event = {type:'myEvent', bubbles: true};
this.dispatchEvent(event);

event.stopsImmediatePropagation = true;
event.stopsPropagation = true;

Shape

import {Shape} from "lomo/lib/addons";