├── .meteor
├── cordova-plugins
├── .gitignore
├── release
├── platforms
├── .id
├── .finished-upgraders
├── packages
└── versions
├── client
├── views
│ ├── items.js
│ ├── buttons.js
│ ├── blank.js
│ ├── tab2.html
│ ├── tab1.html
│ ├── headers.html
│ ├── app.html
│ ├── blank.html
│ ├── text.html
│ ├── tab4.html
│ ├── utility.html
│ ├── items.html
│ ├── tab3.html
│ └── buttons.html
└── styles
│ └── app.styl
├── packages
├── native-spinner
│ ├── README.md
│ ├── native-spinner.js
│ └── package.js
├── tap-feedback
│ ├── tap-feedback.css
│ ├── tap-feedback.js
│ ├── package.js
│ └── README.md
├── native-transitions-stylus
│ ├── mixins.import.styl
│ ├── README.md
│ ├── package.js
│ ├── images.import.styl
│ ├── reset.import.styl
│ ├── variables.import.styl
│ ├── forms.import.styl
│ └── core.import.styl
├── native-transitions-header
│ ├── README.md
│ ├── native-transitions-header.js
│ └── package.js
├── native-transitions-components
│ ├── ntBackButton.js
│ ├── ntBackButton.html
│ ├── ntElement.html
│ ├── package.js
│ ├── ntModal.css
│ ├── README.md
│ ├── ntSliderZoom.js
│ ├── ntSlide.css
│ └── ntElement.js
├── scroll-history
│ ├── package.js
│ ├── README.md
│ └── scroll-history.js
├── native-transitions-tabs
│ ├── package.js
│ ├── native-transitions-tabs.js
│ ├── native-transitions-tabs.html
│ ├── native-transitions-tabs.css
│ └── README.md
└── native-transitions
│ ├── package.js
│ ├── README.md
│ └── native-transitions.js
├── mobile-config.js
├── lib
├── demo.js
├── statusbar.js
└── router.js
└── README.md
/.meteor/cordova-plugins:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.meteor/.gitignore:
--------------------------------------------------------------------------------
1 | local
2 |
--------------------------------------------------------------------------------
/.meteor/release:
--------------------------------------------------------------------------------
1 | METEOR@1.3-beta.11
--------------------------------------------------------------------------------
/client/views/items.js:
--------------------------------------------------------------------------------
1 | Template.items.transition();
--------------------------------------------------------------------------------
/client/views/buttons.js:
--------------------------------------------------------------------------------
1 | Template.buttons.transition();
2 |
--------------------------------------------------------------------------------
/.meteor/platforms:
--------------------------------------------------------------------------------
1 | android
2 | browser
3 | ios
4 | server
5 |
--------------------------------------------------------------------------------
/packages/native-spinner/README.md:
--------------------------------------------------------------------------------
1 | #A native cordova spinner
2 |
--------------------------------------------------------------------------------
/mobile-config.js:
--------------------------------------------------------------------------------
1 | App.setPreference('CrosswalkAnimatable', 'true');
--------------------------------------------------------------------------------
/client/views/blank.js:
--------------------------------------------------------------------------------
1 | Template.blank.transition({
2 | noHeader: true,
3 | noTabs: true
4 | });
5 |
--------------------------------------------------------------------------------
/packages/tap-feedback/tap-feedback.css:
--------------------------------------------------------------------------------
1 | .tap-feedback-active {
2 | background-color: #E1E1E1 !important;
3 | }
--------------------------------------------------------------------------------
/packages/native-transitions-stylus/mixins.import.styl:
--------------------------------------------------------------------------------
1 | border-radius(n)
2 | -webkit-border-radius n
3 | border-radius n
--------------------------------------------------------------------------------
/packages/native-transitions-header/README.md:
--------------------------------------------------------------------------------
1 | #Native Transitions Header
2 | Headers that work well with the `native-transitions` package.
--------------------------------------------------------------------------------
/lib/demo.js:
--------------------------------------------------------------------------------
1 | if (Meteor.isClient) {
2 |
3 | Template.registerHelper("list", function() {
4 | return _.range(100);
5 | });
6 |
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/packages/native-transitions-components/ntBackButton.js:
--------------------------------------------------------------------------------
1 | Template.registerHelper('ntBackDirection', function () {
2 | return nt.defaults.backDirection;
3 | });
--------------------------------------------------------------------------------
/packages/native-transitions-stylus/README.md:
--------------------------------------------------------------------------------
1 | #Styles to make your app look native
2 | Works really well with the native transitions package
3 |
4 | Need to write documentation for this but take a look at the example app for ideas.
5 |
--------------------------------------------------------------------------------
/packages/native-transitions-components/ntBackButton.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/lib/statusbar.js:
--------------------------------------------------------------------------------
1 | Meteor.startup(function() {
2 | if (Meteor.isCordova) {
3 | //Format the status bar
4 | StatusBar.overlaysWebView(false);
5 | StatusBar.styleLightContent();
6 | StatusBar.backgroundColorByHexString("#2f3339");
7 | }
8 | });
9 |
10 |
--------------------------------------------------------------------------------
/packages/native-transitions-components/ntElement.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This page has a header with the .nt-header class. You'll also need to add the .nt-has-header class to the .nt-content container. This page has a subheader with the .nt-subheader class. You'll also need to add the .nt-has-subheader class to the .nt-content container.Blank Pages
6 | Example Item {{this}}
15 | Example Item tagline
16 |
17 |
18 | {{/each}}
19 |
20 |
21 | Long Lists!
6 |
14 |
Example Person {{this}}
15 | Example profile tagline
16 |
17 |
18 |
19 | {{/each}}
20 |
21 |
22 | Headers
6 | SubHeaders
10 | Headers
15 |
18 |
19 | SubHeaders
20 |
You can choose pages that shouldn't have headers or tabs!
8 | 9 | Back 10 | 11 | 12 |Just set the nt.noHeader = true; flag in onRendered for the template.
16 | 17 | Items 18 | 19 | 20 |Just set the nt.noTabs = true; flag in onRendered for the template.
24 | {{>ntBackButton}} 25 | 26 |p
35 | 36 |nt-large
39 | 40 |nt-small
43 | 44 |nt-text-left
47 | 48 |nt-text-center
51 | 52 |nt-text-right
55 | 56 |I'd be really interested to hear your thoughts and how it works for you!
12 |Follow me on Twitter @JamieLoberman for updates or drop me a line at jamie@waited.com
13 | 14 |I've tested so far on
16 |Let me know what devices you test on!
23 | 24 | 25 |Variables, including standard colors can be altered by adding the declaration just before you import the stylus stylesheet.
12 |e.g. $colorPrimary = #e64b3b
13 | 14 |18 | Add a class of nt-border to any element to add a border. You can also use nt-border-top, nt-border-right, nt-border-bottom and nt-border-left individually. 19 |
20 | 21 |25 | Add a class of nt-padding to any element to add padding. Added to this div. Also commonly used on the nt-content element like it is on this page. 26 |
27 | 28 | 29 |The content on the tabbed pages are kept alive in the background meaning that you'll never lose your place in a long list! Try heading back there now and you'll see you're in the same position.
12 | 13 |The native-transitions package can be dropped in to any existing project using FlowRouter with minimal effort. For new projects I've created the native-transitions-stylus package to help with styling. Tabs, header and components are also in separate packages so can be used as needed.
17 | 18 |Items are great for lists! Just add the .nt-item class.
22 | 23 |Icons can be easily added using the pagebakers:ionicons package. Just add .nt-icon-left and/or .nt-icon-right to a div and they will be placed correctly.
27 | 28 |Just like icons you can add avatars easily!
32 | 33 |
4 |
5 | This is a demo repo for the `native transitions for mobile` packages that I'm building for Meteor 1.3. Everything in here is liable to change without notice so use at your own risk.
6 |
7 | The native transitions package is usable on it's own without any of the other packages and is as simple to use as calling the function inside onRendered:
8 | ```
9 | Template.templateName.onRendered(function() {
10 | nt.transition();
11 | });
12 | ```
13 |
14 | The repo contains several packages:
15 |
16 | ##native-transitions
17 | This is the core transitions package. It implements the [Telerik Cordova plugin](http://plugins.telerik.com/cordova/plugin/native-page-transitions) with a Meteor friendly interface.
18 | > When invoked, the plugin immediately grabs a screenshot of your webview, then waits a little for the new content to load, and then performs the transition by animating out the screenshot and in the view.
19 |
20 | The package and readme can be found [here](packages/native-transitions)
21 |
22 | ##native-transitions-stylus
23 | This package is a set of styles to enable quick app layouts as seen [here](https://twitter.com/JamieLoberman/status/697152622805938177). Package is [here](packages/native-transitions-stylus)
24 |
25 | ##native-transitions-tabs
26 | This is a package to allow tab functionality in your app. It keeps the place of long lists by keeping the tabs "alive" in the background.
27 | Package is [here](packages/native-transitions-tabs)
28 |
29 | ##native-transitions-header
30 | This is a package to allow static header functionality in your app. It keeps the header in place when transitioning between two views that have headers.
31 | Package is [here](packages/native-transitions-header)
32 |
33 | ##native-transitions-components
34 | This package currently just contains a back button helper, but will also contain other componenents that work well with the native transitions, such as modals and slide down menus.
35 | Package is [here](packages/native-transitions-components)
36 |
37 | ##native-spinner
38 | This is a native spinner for iOS and Android. It provide a Meteor interface for [cordova-plugin-spinner](https://www.npmjs.com/package/cordova-plugin-spinner)
39 | Package is [here](packages/native-spinner).
40 |
--------------------------------------------------------------------------------
/.meteor/versions:
--------------------------------------------------------------------------------
1 | allow-deny@1.0.1-beta.11
2 | autopublish@1.0.4
3 | autoupdate@1.2.5-beta.11
4 | babel-compiler@6.4.0-beta.11
5 | babel-runtime@0.1.5-beta.11
6 | base64@1.0.5-beta.11
7 | binary-heap@1.0.5-beta.11
8 | blaze@2.1.4-beta.11
9 | blaze-html-templates@1.0.1
10 | blaze-tools@1.0.5-beta.11
11 | boilerplate-generator@1.0.5-beta.11
12 | caching-compiler@1.0.1-beta.11
13 | caching-html-compiler@1.0.3-beta.11
14 | callback-hook@1.0.5-beta.11
15 | check@1.1.1-beta.11
16 | coffeescript@1.0.12-beta.11
17 | cosmos:browserify@0.9.3
18 | crosswalk@1.4.0-beta.11
19 | ddp@1.2.2
20 | ddp-client@1.2.2-beta.11
21 | ddp-common@1.2.2
22 | ddp-server@1.2.3-beta.11
23 | deps@1.0.9
24 | diff-sequence@1.0.2-beta.11
25 | ecmascript@0.4.0-beta.11
26 | ecmascript-runtime@0.2.7-beta.11
27 | ejson@1.0.8-beta.11
28 | es5-shim@4.3.2-beta.11
29 | fastclick@1.0.8-beta.11
30 | geojson-utils@1.0.5-beta.11
31 | gwendall:body-events@0.1.6
32 | hot-code-push@1.0.1-beta.11
33 | html-tools@1.0.6-beta.11
34 | htmljs@1.0.6-beta.11
35 | http@1.1.2-beta.11
36 | id-map@1.0.4
37 | insecure@1.0.4
38 | jamielob:native-transitions@1.1.0
39 | jamielob:native-transitions-components@1.0.0
40 | jamielob:native-transitions-header@1.0.0
41 | jamielob:native-transitions-stylus@0.5.0
42 | jamielob:native-transitions-tabs@1.0.0
43 | jquery@1.11.5-beta.11
44 | kadira:blaze-layout@2.3.0
45 | kadira:flow-router@2.10.1
46 | launch-screen@1.0.6-beta.11
47 | livedata@1.0.15
48 | logging@1.0.9-beta.11
49 | meteor@1.1.11-beta.11
50 | meteor-base@1.0.1
51 | meteor-env-dev@0.0.1-beta.11
52 | meteor-env-prod@0.0.1-beta.11
53 | minifier-css@1.1.8-beta.11
54 | minifier-js@1.1.8-beta.11
55 | minimongo@1.0.11-beta.11
56 | mobile-experience@1.0.1
57 | mobile-status-bar@1.0.8-beta.11
58 | modules@0.5.0-beta.11
59 | modules-runtime@0.5.0-beta.11
60 | mongo@1.1.4-beta.11
61 | mongo-id@1.0.1
62 | npm-mongo@1.4.40-beta.11
63 | observe-sequence@1.0.8-beta.11
64 | ordered-dict@1.0.4
65 | pagebakers:ionicons@2.0.1_1
66 | promise@0.5.2-beta.11
67 | random@1.0.6-beta.11
68 | reactive-dict@1.1.4-beta.11
69 | reactive-var@1.0.6
70 | reload@1.1.5-beta.11
71 | retry@1.0.4
72 | routepolicy@1.0.7-beta.11
73 | session@1.1.2-beta.11
74 | spacebars@1.0.8-beta.11
75 | spacebars-compiler@1.0.8-beta.11
76 | standard-minifier-css@1.0.3-beta.11
77 | standard-minifier-js@1.0.3-beta.11
78 | standard-minifiers@1.0.3-beta.11
79 | stylus@2.511.2-beta.11
80 | templating@1.1.6-beta.11
81 | templating-tools@1.0.1-beta.11
82 | tracker@1.0.10-beta.11
83 | ui@1.0.8
84 | underscore@1.0.5-beta.11
85 | url@1.0.6-beta.11
86 | velocityjs:velocityjs@1.2.1
87 | webapp@1.2.5-beta.11
88 | webapp-hashing@1.0.6-beta.11
89 |
--------------------------------------------------------------------------------
/packages/native-transitions-components/ntSlide.css:
--------------------------------------------------------------------------------
1 | .nt-slideDown .nt-element {
2 | position: absolute;
3 | z-index: 3;
4 | top:0;
5 | left:0;
6 | width: 100%;
7 | background-color: #FFFFFF;
8 | transform: translate3d(0, -100%, 0);
9 | -webkit-transform: translate3d(0, -100%, 0);
10 | }
11 |
12 |
13 | .nt-slideDown.nt-element-in .nt-element {
14 | -webkit-animation: nt-slideDown-in 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
15 | animation: nt-slideDown-in 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
16 | }
17 | @-webkit-keyframes nt-slideDown-in {
18 | from { -webkit-transform: translate3d(0, -100%, 0); }
19 | to { -webkit-transform: translate3d(0, 0, 0); }
20 | }
21 | @keyframes nt-slideDown-in {
22 | from { transform: translate3d(0, -100%, 0); }
23 | to { transform: translate3d(0, 0, 0); }
24 | }
25 |
26 |
27 | .nt-slideDown.nt-element-out .nt-element {
28 | -webkit-animation: nt-slideDown-out 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
29 | animation: nt-slideDown-out 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
30 | }
31 | @-webkit-keyframes nt-slideDown-out {
32 | from { -webkit-transform: translate3d(0, 0, 0); }
33 | to { -webkit-transform: translate3d(0, -100%, 0); }
34 | }
35 | @keyframes nt-slideDown-out {
36 | from { transform: translate3d(0, 0, 0); }
37 | to { transform: translate3d(0, -100%, 0); }
38 | }
39 |
40 |
41 | .nt-slideUp .nt-element {
42 | position: absolute;
43 | z-index: 3;
44 | bottom:0;
45 | left:0;
46 | width: 100%;
47 | background-color: #FFFFFF;
48 | transform: translate3d(0, 100%, 0);
49 | -webkit-transform: translate3d(0, 100%, 0);
50 | }
51 |
52 | .nt-slideUp.nt-element-in .nt-element {
53 | -webkit-animation: nt-slideUp-in 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
54 | animation: nt-slideUp-in 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
55 | }
56 | @-webkit-keyframes nt-slideUp-in {
57 | from { -webkit-transform: translate3d(0, 100%, 0); }
58 | to { -webkit-transform: translate3d(0, 0, 0); }
59 | }
60 | @keyframes nt-slideUp-in {
61 | from { transform: translate3d(0, 100%, 0); }
62 | to { transform: translate3d(0, 0, 0); }
63 | }
64 |
65 |
66 | .nt-slideUp.nt-element-out .nt-element {
67 | -webkit-animation: nt-slideUp-out 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
68 | animation: nt-slideUp-out 0.35s 0s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
69 | }
70 | @-webkit-keyframes nt-slideUp-out {
71 | from { -webkit-transform: translate3d(0, 0, 0); }
72 | to { -webkit-transform: translate3d(0, 100%, 0); }
73 | }
74 | @keyframes nt-slideUp-out {
75 | from { transform: translate3d(0, 0, 0); }
76 | to { transform: translate3d(0, 100%, 0); }
77 | }
78 |
--------------------------------------------------------------------------------
/packages/native-transitions-components/ntElement.js:
--------------------------------------------------------------------------------
1 | Template.body.events({
2 | 'click [nt-target]': function (event, template) {
3 | //Get the target name
4 | var $ntElement = $(event.currentTarget);
5 | nt.triggerElement($ntElement);
6 | },
7 | });
8 |
9 | nt.triggerElement = function($ntElement) {
10 |
11 | ntTarget = $ntElement.attr('nt-target');
12 |
13 | //Hide any others that are showing
14 | var $ntOtherTargets = $('[nt-element]').not('[nt-element="' + ntTarget + '"]');
15 | if ( $ntOtherTargets.hasClass('nt-element-in') ) {
16 | $ntOtherTargets.removeClass('nt-element-in');
17 | }
18 |
19 | //Get the target element
20 | var $ntTarget = $('[nt-element="' + ntTarget + '"]');
21 | //If it's showing
22 | if ( $ntTarget.hasClass('nt-element-in') ) {
23 |
24 | //If the element has an href, hide it immediately
25 | if( $ntElement.attr("href") ) {
26 | $ntTarget.removeClass('nt-element-in').removeClass('nt-element-out');
27 | } else {
28 |
29 | //Otherwise animate it out of view
30 | $ntTarget.addClass('nt-element-out').removeClass('nt-element-in').on("animationend oAnimationEnd webkitAnimationEnd", function(event) {
31 | //Make sure it's only on the out animation
32 | if (!$(event .currentTarget).hasClass('nt-element-out')) return;
33 | $(this).off("animationend oAnimationEnd webkitAnimationEnd");
34 | //Removing the class onon end so we can hide the overlay easily using css
35 | $(this).removeClass('nt-element-out')
36 | });
37 | }
38 |
39 | //Need to move to using js on mobile because of CSS flicker (reduced using fix already implemented)
40 | //http://stackoverflow.com/questions/17747239/ios-flicker-bug-when-the-css-overflowscroll-is-changed-to-overflowhidden
41 | //But couldn't figure out a way of doing it cleanly, so leaving it as CSS with flicker for now
42 | //Don't implement the same delay below up here, as it takes too long to re-implement scrolling that way.
43 | $('.nt-current .nt-content').not('.nt-element .nt-content').css('overflow-y', '')
44 |
45 |
46 | //Otherwise
47 | } else {
48 | //Animate it in to view
49 | $ntTarget.addClass('nt-element-in').removeClass('nt-element-out').on("animationend oAnimationEnd webkitAnimationEnd", function(event) {
50 | //Make sure it's only on the in animation
51 | if (!$(event.currentTarget).hasClass('nt-element-in')) return;
52 | $(this).off("animationend oAnimationEnd webkitAnimationEnd");
53 | //Disable scrolling underneath - Doing at the end of the animation seems to reduce/remove the flicker mentioned above
54 | $('.nt-current .nt-content').not('.nt-element .nt-content').css('overflow-y', 'hidden');
55 | });
56 |
57 | }
58 |
59 | }
--------------------------------------------------------------------------------
/client/views/buttons.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | You can combine any of the classes above and also add in text helper classes. For example:
28 | 29 |Buttons also support icons from the pagebakers:ionicons package and be placed on the left, right or both.
35 |