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

es6-dessert

v1.3.0

Published

ES6小点心系列,包括通用弹窗,楼层定位,倒计时等等。

Downloads

22

Readme

ES6 Dessert

ES6小点心系列,包括通用弹窗,楼层定位,倒计时等等。

前端业务逻辑主要分为【交互效果】和【数据展示】两方面。数据展示可使用 MVVM 框架来实现。前端的交互效果常用的也就那么几种,比如弹窗,楼层定位,倒计时,下拉刷新,上拉加载更多等等。这些交互效果完全可以提出来做成通用的模块,以后不必再劳心费神去想怎么实现。就像 Swiper 封装了一个类来专门做轮播图一样,本系列的目的是通过封装一系列类来实现弹窗,楼层定位,倒计时等交互功能。

目标

  1. 易用性,如果自己都觉得难用,那就没有分享的必要了 ̄□ ̄||;
  2. 兼容性,兼容主流浏览器,但并非所有(比如 IE6-8 等低版本);
  3. 移动优先,主要为移动端做更多的考虑;

依赖 jQuery

由于需要操作DOM,果断选择了王者级库——jQuery。但这可能会限制小点心的机动性,毕竟 MVVM 使得越来越多的项目逐渐去 jQuery 化。因此打算在小点心家族成员稳定下来后将对 jQuery 的依赖去掉,就像 Swiper 老哥做的那样^_^

安装

NPM

如果使用了诸如 webpack 或 rollup 之类的模块打包器,可直接通过 npm 安装:

$ npm i -D es6-dessert

在文件中进行引用:

import {NormalPopup} from 'es6-dessert'

直接用 <script> 引入

直接下载并用 <script> 标签引入,es6-dessert.js 会注册一个全局变量 es6Dessert。接下来就可以使用 es6Dessert.NormalPopupes6Dessert.CountDown 等去食用里面的小点心了。

API风格

本系列均效仿 Swiper 的 API 风格,力求 Keep It Simple and Stupid。只需要相对宽松有序的 DOM 结构和一致的实例化风格,That's it,多一点不人性化的东西算俄输。

小点心文件列表

小点心家谱

{
    Popup: {
        NormalPopup,
        SlidePopup
    },
    Floor,
    CountDown,
}

本地构建

本项目使用 rollup 进行打包。

git clone [email protected]:dom-bro/es6-dessert.git
cd es6-dessert
npm i
npm run build