Buttons
239 | 240 |Buttons 包含三种状态:正常态、激活态、不可用态
241 | 242 |按钮
245 |246 | 247 | 248 | 249 | 250 |
251 | 252 |块级按钮
253 |254 | 255 | 256 | 257 | 258 |
259 | 260 |├── .gitignore ├── Modfile.js ├── README.md ├── bower.json ├── css └── pro.css ├── demo ├── index.html ├── js │ └── demo.js └── vendor │ └── ionicons │ ├── css │ └── ionicons.css │ └── fonts │ ├── ionicons.eot │ ├── ionicons.svg │ ├── ionicons.ttf │ └── ionicons.woff ├── doc ├── css │ └── doc.css ├── img │ └── iphone.png ├── index.html ├── js │ └── doc.js ├── md │ └── getting-started.md └── vendor │ ├── fingerblast │ └── fingerblast.js │ ├── prettify │ ├── prettify.css │ └── prettify.js │ └── zepto │ └── dimensions.js ├── img └── icon-search.png ├── js ├── ajax.js ├── carousel.js ├── countable.js ├── data.js ├── debounce.js ├── deletable.js ├── dialog.js ├── event.js ├── fixed.js ├── lazyload.js ├── os.js ├── pro.js ├── requestAnimationFrame.js ├── scrollfix.js ├── spinner.js ├── tab.js ├── tmpl.js ├── touch.js ├── transition.js └── zepto.js ├── package.json ├── task └── amdify.js └── vendor └── requirejs └── require.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Files to ignore 2 | .DS_Store 3 | .localized 4 | Thumbs.db 5 | *.log 6 | *.sass-cache 7 | 8 | # Folders to ignore 9 | .idea 10 | .hg 11 | .svn 12 | .CVS 13 | .cache 14 | tmp 15 | node_modules 16 | -------------------------------------------------------------------------------- /Modfile.js: -------------------------------------------------------------------------------- 1 | // More info about Modfile at https://github.com/modulejs/modjs/ 2 | 3 | module.exports = { 4 | version: ">=0.4.3", 5 | plugins: { 6 | amdify: './task/amdify' 7 | }, 8 | tasks: { 9 | server: { 10 | port: 3000 11 | }, 12 | download: { 13 | options: { 14 | dest: "js/" 15 | }, 16 | zepto: { 17 | src: "http://rawgithub.com/madrobby/zepto/master/src/zepto.js" 18 | }, 19 | event: { 20 | src: "http://rawgithub.com/madrobby/zepto/master/src/event.js" 21 | }, 22 | ajax: { 23 | src: "http://rawgithub.com/madrobby/zepto/master/src/ajax.js" 24 | }, 25 | data: { 26 | src: "http://rawgithub.com/madrobby/zepto/master/src/data.js" 27 | }, 28 | touch: { 29 | src: "http://rawgithub.com/madrobby/zepto/master/src/touch.js" 30 | }, 31 | requirejs: { 32 | src: "http://requirejs.org/docs/release/2.1.10/comments/require.js", 33 | dest: 'vendor/requirejs/' 34 | }, 35 | 'requirejs-tmpl': { 36 | src: "http://rawgithub.com/modulejs/requirejs-tmpl/master/tmpl.js" 37 | } 38 | }, 39 | amdify: { 40 | src: "js/{zepto,event,ajax,data,touch}.js" 41 | } 42 | }, 43 | targets: { 44 | vendor: ["download", "amdify"] 45 | } 46 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Pro 2 | === 3 | > Framework for mobile platform. 4 | 5 | ## Features 6 | * Mobile Only 7 | * High performance 8 | * Accessibility Support 9 | * Custom build support 10 | 11 | ## Screenshot 12 | 13 |  14 | 15 |  16 | 17 | ## Demo 18 | 19 | Scan below QR code or visit [http://url.cn/NDKvRr](http://url.cn/NDKvRr) on your handset. 20 | 21 |  22 | 23 | ## Basic template 24 | 25 | Copy the HTML below to begin working with a minimal PRO document. 26 | 27 | ```html 28 | 29 | 30 |
31 | 32 |商家名称: 上海的自来水来自海上上海的自来水来自海上
170 |兑换码: 88888888
171 |2999-03-01
172 |223 | 224 | 225 | 226 | 227 |
228 | 229 |231 | 232 | 233 | 234 | 235 |
236 |241 | 242 | 243 | 244 |
245 |258 | 259 |
260 | 261 |263 | 264 |
265 | 266 |268 | 271 | 272 | 275 |
276 | 277 |商家名称: 上海的自来水来自海上上海的自来水来自海上
327 |兑换码: 88888888
328 |2999-03-01
329 |商家名称: 上海的自来水来自海上上海的自来水来自海上
340 |兑换码: 88888888
341 |2999-03-01
342 |商家名称: 上海的自来水来自海上上海的自来水来自海上
352 |兑换码: 88888888
353 |2999-03-01
354 |394 | 397 |
398 |404 | 407 | 408 | 411 | 412 | 415 | 416 | 419 | 420 | 423 | 424 | 427 |
428 | 429 |434 | 437 |
438 |An overview of Pro, how to download and use, basic templates.
121 |Pro has a few easy ways to quickly get started, each one appealing to a different skill level and use case. Read through to see what suits your particular needs.
126 | 127 |Download Pro Compiled and minified CSS, JavaScript.
130 | 131 |Download Source Source CSS, JavaScript.
132 | 133 |Install and manage Pro’s CSS, JavaScript, using Bower.
136 | 137 |bower install pro
138 |
139 | 3 steps for structuring your Pro application
142 | 143 |viewport
meta<name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
All fixed bars (.ui-top-bar
, .ui-bottom-bar
) should always be the first thing in the body of the page. This is really important!
.ui-page
Anything that’s not a -bar
should be put in a div with the class ui-page
. Put this div after the bars in the body tag.
Start with this basic HTML template, or modify it, adapting them to suit your needs.
161 | 162 |Copy the HTML below to begin working with a minimal Pro document.
163 | 164 |<!DOCTYPE html>
165 | <html>
166 | <head>
167 | <meta charset='utf-8'>
168 | <title>Pro Template</title>
169 | <meta charset="utf-8">
170 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
171 |
172 | <!-- Pro CSS -->
173 | <link rel="stylesheet" type="text/css" href="css/pro.css">
174 | </head>
175 | <body class="ui-app">
176 |
177 | <div class="ui-top-bar js-no-bounce">
178 | PRO Template
179 | </div>
180 |
181 | <div class="ui-bottom-bar js-no-bounce" role="toolbar" tabindex="0">
182 | <button class="ui-bottom-bar-button js-active" data-toggle="tab" data-target="#page1">
183 | <span class="ui-icon"></span>
184 | <span class="ui-label">CSS</span>
185 | </button>
186 | </div>
187 | </div>
188 |
189 | <div id="page1" class="ui-page js-active">
190 | <div class="ui-page-content">
191 | <h1>Hello, world!</h1>
192 | </div>
193 | </div>
194 |
195 | <!-- Pro JS -->
196 | <script src="js/pro.js"></script>
197 | </body>
198 | </html>
199 |
200 | Bring Pro's components to life with over a dozen custom Zepto plugins. Easily include them all, or one by one.
211 |219 | 220 | 221 | 222 | 223 |
224 | 225 |227 | 228 | 229 | 230 | 231 |
232 |Buttons 包含三种状态:正常态、激活态、不可用态
241 | 242 |246 | 247 | 248 | 249 | 250 |
251 | 252 |254 | 255 | 256 | 257 | 258 |
259 | 260 |318 | 321 | 324 |
325 | 326 |商家名称: 上海的自来水来自海上上海的自来水来自海上
390 |兑换码: 88888888
391 |2999-03-01
392 |商家名称: 上海的自来水来自海上上海的自来水来自海上
403 |兑换码: 88888888
404 |2999-03-01
405 |商家名称: 上海的自来水来自海上上海的自来水来自海上
415 |兑换码: 88888888
416 |2999-03-01
417 |456 | 459 |
460 | 461 | 466 | 467 |476 | 479 | 480 | 483 | 484 | 487 | 488 | 491 | 492 | 495 | 496 | 499 |
500 | 501 | 512 | 513 |522 | 525 |
526 | 527 | 536 | 537 |'; 47 | var preEnd = ''; 48 | var preContent = $node.html().replace(/&/g, '&').replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").trim(); 49 | $node.after( preStart + preContent + preEnd); 50 | }); 51 | 52 | prettyPrint(); 53 | } 54 | 55 | function initialize() { 56 | currentActive = 0; 57 | topCache = []; 58 | noticeBanner = $('.notice-banner'); 59 | navComponentLinks = $('.nav-components-link'); 60 | componentsList = $('.components-list'); 61 | contentSection = $('.component'); 62 | topCache = contentSection.map(function () { return $(this).offset().top }); 63 | windowHeight = $(window).height() / 3; 64 | pageHeight = $(document).height(); 65 | contentPadding = parseInt($('.doc-content').css('padding-bottom')); 66 | footerHeight = $('.doc-footer').outerHeight(false); 67 | 68 | $iphone.initialLeft = $iphone.offset().left; 69 | $iphone.initialTop = $iphone.initialTop || $iphone.offset().top; 70 | $iphone.dockingOffset = ($(window).height() + 20 + $('.doc-masthead').height() - $iphone.height())/2; 71 | 72 | checkDesktopContent(); 73 | calculateScroll(); 74 | 75 | if (!eventListeners) addEventListeners(); 76 | } 77 | 78 | function addEventListeners() { 79 | eventListeners = true; 80 | 81 | noticeBanner.on('click', function () { 82 | $(this).hide(); 83 | }); 84 | 85 | // TODO 会导致checkbox无法点击 86 | $iphone.on('click', function (e) { 87 | e.preventDefault(); 88 | }); 89 | 90 | navComponentLinks.click(function(e) { 91 | e.stopPropagation(); 92 | e.preventDefault(); 93 | // componentsList.toggleClass('active'); 94 | componentsList.removeClass('active'); 95 | $(e.target.parentNode.children[1]).toggleClass('active'); 96 | }); 97 | 98 | $doc.on('click', function () { 99 | componentsList.removeClass('active'); 100 | }); 101 | 102 | $win.on('scroll', calculateScroll); 103 | 104 | } 105 | 106 | function checkDesktopContent() { 107 | windowWidth = $(window).width(); 108 | if (windowWidth <= 768) { 109 | var content = $('.content'); 110 | if (content.length > 1) { 111 | $(content[0]).remove() 112 | } 113 | } 114 | } 115 | 116 | function calculateScroll() { 117 | // if small screen don't worry about this 118 | if (windowWidth <= 768) return 119 | 120 | // Save scrollTop value 121 | var contentSectionItem; 122 | var currentTop = $win.scrollTop(); 123 | 124 | // If page is scrolled to bottom near footers 125 | if(pageHeight - currentTop < footerHeight + contentPadding + 1400) { 126 | $iphone[0].className = "iphone iphone-bottom"; 127 | $iphone[0].setAttribute('style','') 128 | } else if(($iphone.initialTop - currentTop) <= $iphone.dockingOffset) { 129 | $iphone[0].className = "iphone iphone-fixed"; 130 | $iphone.css({top: $iphone.dockingOffset}) 131 | } else { 132 | $iphone[0].className = "iphone"; 133 | $iphone[0].setAttribute('style','') 134 | } 135 | 136 | // Injection of components into phone 137 | for (var l = contentSection.length; l--;) { 138 | if ((topCache[l] - currentTop) < windowHeight) { 139 | if (currentActive == l) return; 140 | currentActive = l; 141 | $body.find('.component.active').removeClass('active'); 142 | contentSectionItem = $(contentSection[l]); 143 | contentSectionItem.addClass('active'); 144 | if(contentSectionItem.attr('id')) { 145 | $iphone.attr("id", contentSectionItem.attr('id') + "InPhone"); 146 | } else { 147 | $iphone.attr("id", "") 148 | } 149 | if (!contentSectionItem.hasClass('informational')) { 150 | updateContent(contentSectionItem.find('.prettyprint').not('.js').text()) 151 | } 152 | break 153 | } 154 | } 155 | 156 | function updateContent(content) { 157 | $('#iwindow').html(content); 158 | } 159 | } 160 | 161 | }); 162 | -------------------------------------------------------------------------------- /doc/md/getting-started.md: -------------------------------------------------------------------------------- 1 |
An overview of Pro, how to download and use, basic templates.
4 |Pro has a few easy ways to quickly get started, each one appealing to a different skill level and use case. Read through to see what suits your particular needs.
9 | 10 |Download Pro Compiled and minified CSS, JavaScript.
12 | 13 |Download Source Source CSS, JavaScript.
14 | 15 |Install and manage Pro's CSS, JavaScript, using Bower.
17 | 18 | ```bash 19 | bower install pro 20 | ``` 21 | 22 |viewport
meta<name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
All fixed bars (.ui-top-bar
, .ui-bottom-bar
) should always be the first thing in the body of the page. This is really important!
.ui-page
Anything that's not a -bar
should be put in a div with the class ui-page
. Put this div after the bars in the body tag.