Giter VIP home page Giter VIP logo

webapp-28's Introduction

姚姚的UI库指南

架构

  1. director.js 路由
  2. require.js 模块载入框架(text、domready、css)
  3. underscore.js js工具库
  4. jquery2.2.js
  5. hammer.js tap事件

思路

  1. 启动程序
  2. 监听路由
  3. 路由变化,映射到对应的处理逻辑,加载对应的模块
  4. 模块加载完成,修改dom
  5. 页面跳转时,移除上一个模块,加载下一个模块,回到3

步骤

  1. index.htm requirejs引入main.js 1
  2. main.js配置requirejs的依赖,并启动webapp 2
  3. router.js配置路由 3
  4. 各个模块 index.tpl 4 index.js 5

使用

修改main.js中的window.basePath,改为当前项目地址
如果用chrome打开,需要设置chrome支持ajax跨域请求数据
链接地址比如首页链接:当前项目地址#demo/index

参考

HTML5单页面架构

frozenui

HTML5单页面架构参考了(自定义路由 + requirejs + zepto + underscore)的架构,在这个基础上,将zepto改为jquery,引入hammer库

这个项目在样式上参考了frozenui库,在这个库的基础上,做了一些自己的改动。
比如说表单的右侧按钮,作为可点击的按钮,这个区域必须比实际视觉效果更大,才能使用户点击时有更好的体验。

webapp-28's People

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.