├── LICENSE.md
├── README.md
├── appstore-example.framer
├── .gitignore
├── app.coffee
├── framer
│ ├── backups
│ │ ├── backup-1428086792.coffee
│ │ ├── backup-1428531305.coffee
│ │ ├── backup-1428619266.coffee
│ │ ├── backup-1429131125.coffee
│ │ └── backup-1429469976.coffee
│ ├── coffee-script.js
│ ├── config.json
│ ├── framer.generated.js
│ ├── framer.init.js
│ ├── framer.js
│ ├── framer.js.map
│ ├── framer.modules.js
│ ├── images
│ │ ├── background.png
│ │ ├── cursor.png
│ │ ├── cursor@2x.png
│ │ ├── icon-120.png
│ │ ├── icon-152.png
│ │ ├── icon-180.png
│ │ ├── icon-192.png
│ │ ├── icon-76.png
│ │ ├── icon-arrow.png
│ │ ├── icon-arrow@2x.png
│ │ ├── icon-close.png
│ │ ├── icon-close@2x.png
│ │ ├── icon-framer.png
│ │ ├── icon-framer@2x.png
│ │ ├── icon-share.png
│ │ └── icon-share@2x.png
│ ├── mirror.css
│ ├── style.css
│ └── version
├── images
│ ├── explore-icon@2x.png
│ ├── explore-selected@2x.png
│ ├── explore.png
│ ├── featured-icon@2x.png
│ ├── featured-selected@2x.png
│ ├── featured.jpg
│ ├── framer-icon.png
│ ├── search-icon-selected@2x.png
│ ├── search-icon@2x.png
│ ├── search-selected@2x.png
│ ├── search.png
│ ├── top-charts.png
│ ├── topcharts-icon@2x.png
│ ├── topcharts-selected@2x.png
│ ├── updates-icon@2x.png
│ ├── updates-selected@2x.png
│ └── updates.png
├── index.html
└── modules
│ └── tabBarModule.coffee
├── basic-example.framer
├── .gitignore
├── app.coffee
├── framer
│ ├── backups
│ │ ├── backup-1428531305.coffee
│ │ ├── backup-1428619266.coffee
│ │ ├── backup-1429131125.coffee
│ │ ├── backup-1429469976.coffee
│ │ └── backup-1429472422.coffee
│ ├── coffee-script.js
│ ├── config.json
│ ├── framer.generated.js
│ ├── framer.init.js
│ ├── framer.js
│ ├── framer.js.map
│ ├── framer.modules.js
│ ├── images
│ │ ├── background.png
│ │ ├── cursor.png
│ │ ├── cursor@2x.png
│ │ ├── icon-120.png
│ │ ├── icon-152.png
│ │ ├── icon-180.png
│ │ ├── icon-192.png
│ │ ├── icon-76.png
│ │ ├── icon-arrow.png
│ │ ├── icon-arrow@2x.png
│ │ ├── icon-close.png
│ │ ├── icon-close@2x.png
│ │ ├── icon-framer.png
│ │ ├── icon-framer@2x.png
│ │ ├── icon-share.png
│ │ └── icon-share@2x.png
│ ├── mirror.css
│ ├── style.css
│ └── version
├── images
│ ├── explore-icon@2x.png
│ ├── explore-selected@2x.png
│ ├── explore.jpg
│ ├── featured-icon@2x.png
│ ├── featured-selected@2x.png
│ ├── featured.jpg
│ ├── framer-icon.png
│ ├── search-icon@2x.png
│ ├── search-selected@2x.png
│ └── search.jpg
├── index.html
└── modules
│ └── tabBarModule.coffee
├── customized-example.framer
├── .gitignore
├── app.coffee
├── framer
│ ├── backups
│ │ ├── backup-1428086792.coffee
│ │ ├── backup-1428619266.coffee
│ │ ├── backup-1429131125.coffee
│ │ └── backup-1429469976.coffee
│ ├── coffee-script.js
│ ├── config.json
│ ├── framer.generated.js
│ ├── framer.init.js
│ ├── framer.js
│ ├── framer.js.map
│ ├── framer.modules.js
│ ├── images
│ │ ├── background.png
│ │ ├── cursor.png
│ │ ├── cursor@2x.png
│ │ ├── icon-120.png
│ │ ├── icon-152.png
│ │ ├── icon-180.png
│ │ ├── icon-192.png
│ │ ├── icon-76.png
│ │ ├── icon-arrow.png
│ │ ├── icon-arrow@2x.png
│ │ ├── icon-close.png
│ │ ├── icon-close@2x.png
│ │ ├── icon-framer.png
│ │ ├── icon-framer@2x.png
│ │ ├── icon-share.png
│ │ └── icon-share@2x.png
│ ├── mirror.css
│ ├── style.css
│ └── version
├── images
│ ├── activity-icon@2x.png
│ ├── explore-icon@2x.png
│ ├── framer-icon.png
│ ├── music-icon@2x.png
│ └── search-icon@2x.png
├── index.html
└── modules
│ └── tabBarModule.coffee
├── screenshot.png
└── tabBarModule.coffee
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Petter Nilsson
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TabBarModule
2 |
3 | TabBarModule is a module for the prototyping tool Framer. It makes it super easy to set up a tab bar navigation.
4 |
5 | Created by Petter Nilsson
6 | [petter.pro](http://petter.pro) / [@petterheterjag](http://twitter.com/petterheterjag)
7 |
8 | 
9 |
10 | **Features:**
11 |
12 | * It looks just like the default iOS tab bar (with background blur out of the box).
13 | * But it's very easy to customize.
14 | * It automatically shows the view/screen associated with the selected tab.
15 | * It has support for tinting icons (that means you can transform a transparent PNG with a black icon into any color you want by setting a property).
16 | * You can add badges to tab bar items.
17 |
18 | Only works in Framer Studio/Chrome/Safari.
19 |
20 |
21 | ## Examples
22 |
23 | #### [Basic](http://share.framerjs.com/bsaw6yj3090m/)
24 | #### [App store (with scrollComponents)](http://share.framerjs.com/37f8ggj6q01q/)
25 | #### [Customized](http://share.framerjs.com/6kf6f60h816b/)
26 |
27 |
28 | ## Basic usage
29 |
30 | Download tabBarModule.coffee and put it in the /modules folder of your Framer project. Then add this line at the top of your project in Framer Studio.
31 |
32 | ```coffeescript
33 | tabBarModule = require "tabBarModule"
34 | ```
35 |
36 | Then to create the tab bar you do this:
37 |
38 | ```coffeescript
39 | tabBar = tabBarModule.tabBar
40 | Explore: {icon: "images/explore.png", selectedIcon: "images/explore-selected.png", view: exploreView}
41 | Featured: {icon: "images/featured.png", selectedIcon: "images/featured-selected", view: featuredView}
42 | Search: {icon: "images/search.png", selectedIcon: "images/search-selected.png", view: searchView}
43 | ```
44 |
45 | ## Functions
46 |
47 | #### tabBarModule.tabBar(items *object*)
48 | Creates the tab bar.
49 |
50 | `icon` Path to icon *(required)*
51 | `selectedIcon` Path to icon to use when selected *(optional)*
52 | `view` Layer to show when item is selected *(optional)*
53 |
54 | ```coffeescript
55 | tabBar = tabBarModule.tabBar
56 | Explore: {icon: "images/explore.png", selectedIcon: "images/explore-selected.png", view: exploreView}
57 | Featured: {icon: "images/featured.png", selectedIcon: "images/featured-selected", view: featuredView}
58 | Search: {icon: "images/search.png", selectedIcon: "images/search-selected.png", view: searchView}
59 | ```
60 |
61 | #### tabBar.setSelected(name *string*)
62 | Sets selected tab item from the key (name) used when creating it
63 |
64 | ```coffeescript
65 | tabBar.setSelected("Explore")
66 | ```
67 |
68 | #### tabBar.setBadgeValue(name *string*, value *number*)
69 | Adds a badge to the tab item if value is a number > 0 and removes the badge if null
70 |
71 | ```coffeescript
72 | tabBar.setBadgeValue("Explore", 2)
73 | ```
74 |
75 | #### tabBar.getItemFromName(name *string*)
76 | Returns a tab bar item if names matches
77 |
78 | ```coffeescript
79 | tabBar.getItemFromName("Explore")
80 | ```
81 |
82 | ## Events
83 |
84 | #### "tabBarDidSwitch" (name *string*)
85 | Triggers when the tab bar switches selected tab
86 |
87 | ```coffeescript
88 | tabBar.on "tabBarDidSwitch", (name) ->
89 | print name
90 | ```
91 |
92 |
93 | ## Change styling
94 |
95 | To change the default look, change these defaults before you create the tabBar. Like this:
96 |
97 | ```coffeescript
98 | tabBarModule.defaults.tintColor = "#FEC200"
99 | ```
100 |
101 | **defaults.screenWidth** *number*
102 | **defaults.screenHeight** *number*
103 | **defaults.barHeight** *number*
104 | **defaults.labelOffset** *number*
105 | **defaults.iconOffset** *number*
106 | **defaults.tintColor** *string*
107 | **defaults.tintColorUnselected** *string*
108 | **defaults.blur** *number*
109 | **defaults.opacity** *number*
110 | **defaults.borderShadow** *string*
111 | **defaults.backgroundColor** *string*
112 | **defaults.showLabels** *Boolean*
113 | **defaults.labelTextStyle** *object*
114 | **defaults.badgeTextStyle** *object*
115 |
--------------------------------------------------------------------------------
/appstore-example.framer/.gitignore:
--------------------------------------------------------------------------------
1 | # Default Framer gitignore file
2 |
3 | # Mac specific
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | # Icon must end with two \r
9 | Icon
10 |
11 | # Thumbnails
12 | ._*
13 |
14 | # Files that might appear on external disk
15 | .Spotlight-V100
16 | .Trashes
17 |
18 | # Directories potentially created on remote AFP share
19 | .AppleDB
20 | .AppleDesktop
21 | Network Trash Folder
22 | Temporary Items
23 | .apdisk
24 |
25 | # Framer specific
26 | .temp.html
27 | framer/*.old.*
28 | framer/backup.coffee
29 | framer/backup/*
30 | framer/.*.hash
--------------------------------------------------------------------------------
/appstore-example.framer/app.coffee:
--------------------------------------------------------------------------------
1 | # Import module
2 | tabBarModule = require "tabBarModule"
3 |
4 | # Make background white
5 | new BackgroundLayer({backgroundColor:"#fff"})
6 |
7 | # Create scrollComponents for the views that should scroll
8 | featuredScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
9 | topChartsScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
10 | exploreScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
11 | updatesScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
12 |
13 | # Create the views
14 | featuredView = new Layer
15 | width: 750
16 | height: 3800
17 | image: "images/featured.jpg"
18 | superLayer: featuredScroll.content
19 | topChartsView = new Layer
20 | width: 750
21 | height: 4300
22 | image: "images/top-charts.png"
23 | superLayer: topChartsScroll.content
24 | exploreView = new Layer
25 | width: 750
26 | height: 3000
27 | image: "images/explore.png"
28 | superLayer: exploreScroll.content
29 | searchView = new Layer
30 | width: 750
31 | height: 1334
32 | image: "images/search.png"
33 | updatesView = new Layer
34 | width: 750
35 | height: 1334
36 | image: "images/updates.png"
37 | superLayer: updatesScroll.content
38 |
39 | # Create the tab bar
40 | tabBar = new tabBarModule.tabBar
41 | Featured: {icon: "images/featured-icon@2x.png", selectedIcon: "images/featured-selected@2x.png", view: featuredScroll}
42 | "Top Charts": {icon: "images/topcharts-icon@2x.png", selectedIcon: "images/topcharts-selected@2x.png", view: topChartsScroll}
43 | Explore: {icon: "images/explore-icon@2x.png", selectedIcon: "images/explore-selected@2x.png", view: exploreScroll}
44 | Search: {icon: "images/search-icon@2x.png", selectedIcon: "images/search-selected@2x.png", view: searchView}
45 | Updates: {icon: "images/updates-icon@2x.png", selectedIcon: "images/updates-selected@2x.png", view: updatesScroll}
46 |
47 | # Add a badge to the Updates tab
48 | tabBar.setBadgeValue("Updates", 2)
49 |
50 | # Set up events to get the blur layer inside the tab bar to scroll with the scrollComponents
51 | featuredScroll.on Events.Move, ->
52 | tabBar.getItemFromName("Featured").blurView.content.y = -featuredScroll.scrollY
53 | topChartsScroll.on Events.Move, ->
54 | tabBar.getItemFromName("Top Charts").blurView.content.y = -topChartsScroll.scrollY
55 | exploreScroll.on Events.Move, ->
56 | tabBar.getItemFromName("Explore").blurView.content.y = -exploreScroll.scrollY
57 | updatesScroll.on Events.Move, ->
58 | tabBar.getItemFromName("Updates").blurView.content.y = -updatesScroll.scrollY
59 |
60 | # Set Top Charts as the start tab
61 | tabBar.setSelected("Top Charts")
62 |
--------------------------------------------------------------------------------
/appstore-example.framer/framer/backups/backup-1428086792.coffee:
--------------------------------------------------------------------------------
1 | # Import module
2 | tabKit = require "tabbar"
3 |
4 | new BackgroundLayer({backgroundColor:"#fff"})
5 |
6 | featuredScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
7 | topChartsScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
8 | exploreScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
9 | updatesScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
10 |
11 | # Create some views
12 | featuredView = new Layer
13 | width: 750
14 | height: 3800
15 | image: "images/featured.jpg"
16 | superLayer: featuredScroll.content
17 | topChartsView = new Layer
18 | width: 750
19 | height: 4300
20 | image: "images/top-charts.png"
21 | superLayer: topChartsScroll.content
22 | exploreView = new Layer
23 | width: 750
24 | height: 3000
25 | image: "images/explore.png"
26 | superLayer: exploreScroll.content
27 | searchView = new Layer
28 | width: 750
29 | height: 1334
30 | image: "images/search.png"
31 | updatesView = new Layer
32 | width: 750
33 | height: 1334
34 | image: "images/updates.png"
35 | superLayer: updatesScroll.content
36 |
37 | # Create the tab bar
38 | tabBar = new tabKit.tabBar
39 | Featured: {icon: "images/featured-icon@2x.png", selectedIcon: "images/featured-selected@2x.png", view: featuredScroll}
40 | "Top Charts": {icon: "images/topcharts-icon@2x.png", selectedIcon: "images/topcharts-selected@2x.png", view: topChartsScroll}
41 | Explore: {icon: "images/explore-icon@2x.png", selectedIcon: "images/explore-selected@2x.png", view: exploreScroll}
42 | Search: {icon: "images/search-icon@2x.png", selectedIcon: "images/search-selected@2x.png", view: searchView}
43 | Updates: {icon: "images/updates-icon@2x.png", selectedIcon: "images/updates-selected@2x.png", view: updatesScroll}
44 |
45 | tabBar.setBadgeValue("Updates", 2)
46 |
47 | featuredScroll.on Events.Move, ->
48 | tabBar.getItemFromName("Featured").blurView.content.y = -featuredScroll.scrollY
49 | topChartsScroll.on Events.Move, ->
50 | tabBar.getItemFromName("Top Charts").blurView.content.y = -topChartsScroll.scrollY
51 | exploreScroll.on Events.Move, ->
52 | tabBar.getItemFromName("Explore").blurView.content.y = -exploreScroll.scrollY
53 | updatesScroll.on Events.Move, ->
54 | tabBar.getItemFromName("Updates").blurView.content.y = -updatesScroll.scrollY
55 |
56 |
57 |
--------------------------------------------------------------------------------
/appstore-example.framer/framer/backups/backup-1428531305.coffee:
--------------------------------------------------------------------------------
1 | # Import module
2 | tabKit = require "tabbar"
3 |
4 | # Make background white
5 | new BackgroundLayer({backgroundColor:"#fff"})
6 |
7 | # Create scrollComponents for the views that should scroll
8 | featuredScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
9 | topChartsScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
10 | exploreScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
11 | updatesScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
12 |
13 | # Create the views
14 | featuredView = new Layer
15 | width: 750
16 | height: 3800
17 | image: "images/featured.jpg"
18 | superLayer: featuredScroll.content
19 | topChartsView = new Layer
20 | width: 750
21 | height: 4300
22 | image: "images/top-charts.png"
23 | superLayer: topChartsScroll.content
24 | exploreView = new Layer
25 | width: 750
26 | height: 3000
27 | image: "images/explore.png"
28 | superLayer: exploreScroll.content
29 | searchView = new Layer
30 | width: 750
31 | height: 1334
32 | image: "images/search.png"
33 | updatesView = new Layer
34 | width: 750
35 | height: 1334
36 | image: "images/updates.png"
37 | superLayer: updatesScroll.content
38 |
39 | # Create the tab bar
40 | tabBar = new tabKit.tabBar
41 | Featured: {icon: "images/featured-icon@2x.png", selectedIcon: "images/featured-selected@2x.png", view: featuredScroll}
42 | "Top Charts": {icon: "images/topcharts-icon@2x.png", selectedIcon: "images/topcharts-selected@2x.png", view: topChartsScroll}
43 | Explore: {icon: "images/explore-icon@2x.png", selectedIcon: "images/explore-selected@2x.png", view: exploreScroll}
44 | Search: {icon: "images/search-icon@2x.png", selectedIcon: "images/search-selected@2x.png", view: searchView}
45 | Updates: {icon: "images/updates-icon@2x.png", selectedIcon: "images/updates-selected@2x.png", view: updatesScroll}
46 |
47 | # Add a badge to the Updates tab
48 | tabBar.setBadgeValue("Updates", 2)
49 |
50 | # Set up events to get the blur layer inside the tab bar to scroll with the scrollComponents
51 | featuredScroll.on Events.Move, ->
52 | tabBar.getItemFromName("Featured").blurView.content.y = -featuredScroll.scrollY
53 | topChartsScroll.on Events.Move, ->
54 | tabBar.getItemFromName("Top Charts").blurView.content.y = -topChartsScroll.scrollY
55 | exploreScroll.on Events.Move, ->
56 | tabBar.getItemFromName("Explore").blurView.content.y = -exploreScroll.scrollY
57 | updatesScroll.on Events.Move, ->
58 | tabBar.getItemFromName("Updates").blurView.content.y = -updatesScroll.scrollY
59 |
60 | # Set Top Charts as the start tab
61 | tabBar.setSelected("Top Charts")
62 |
--------------------------------------------------------------------------------
/appstore-example.framer/framer/backups/backup-1428619266.coffee:
--------------------------------------------------------------------------------
1 | # Import module
2 | tabKit = require "tabbar"
3 |
4 | # Make background white
5 | new BackgroundLayer({backgroundColor:"#fff"})
6 |
7 | # Create scrollComponents for the views that should scroll
8 | featuredScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
9 | topChartsScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
10 | exploreScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
11 | updatesScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
12 |
13 | # Create the views
14 | featuredView = new Layer
15 | width: 750
16 | height: 3800
17 | image: "images/featured.jpg"
18 | superLayer: featuredScroll.content
19 | topChartsView = new Layer
20 | width: 750
21 | height: 4300
22 | image: "images/top-charts.png"
23 | superLayer: topChartsScroll.content
24 | exploreView = new Layer
25 | width: 750
26 | height: 3000
27 | image: "images/explore.png"
28 | superLayer: exploreScroll.content
29 | searchView = new Layer
30 | width: 750
31 | height: 1334
32 | image: "images/search.png"
33 | updatesView = new Layer
34 | width: 750
35 | height: 1334
36 | image: "images/updates.png"
37 | superLayer: updatesScroll.content
38 |
39 | # Create the tab bar
40 | tabBar = new tabKit.tabBar
41 | Featured: {icon: "images/featured-icon@2x.png", selectedIcon: "images/featured-selected@2x.png", view: featuredScroll}
42 | "Top Charts": {icon: "images/topcharts-icon@2x.png", selectedIcon: "images/topcharts-selected@2x.png", view: topChartsScroll}
43 | Explore: {icon: "images/explore-icon@2x.png", selectedIcon: "images/explore-selected@2x.png", view: exploreScroll}
44 | Search: {icon: "images/search-icon@2x.png", selectedIcon: "images/search-selected@2x.png", view: searchView}
45 | Updates: {icon: "images/updates-icon@2x.png", selectedIcon: "images/updates-selected@2x.png", view: updatesScroll}
46 |
47 | # Add a badge to the Updates tab
48 | tabBar.setBadgeValue("Updates", 2)
49 |
50 | # Set up events to get the blur layer inside the tab bar to scroll with the scrollComponents
51 | featuredScroll.on Events.Move, ->
52 | tabBar.getItemFromName("Featured").blurView.content.y = -featuredScroll.scrollY
53 | topChartsScroll.on Events.Move, ->
54 | tabBar.getItemFromName("Top Charts").blurView.content.y = -topChartsScroll.scrollY
55 | exploreScroll.on Events.Move, ->
56 | tabBar.getItemFromName("Explore").blurView.content.y = -exploreScroll.scrollY
57 | updatesScroll.on Events.Move, ->
58 | tabBar.getItemFromName("Updates").blurView.content.y = -updatesScroll.scrollY
59 |
60 | # Set Top Charts as the start tab
61 | tabBar.setSelected("Top Charts")
62 |
--------------------------------------------------------------------------------
/appstore-example.framer/framer/backups/backup-1429131125.coffee:
--------------------------------------------------------------------------------
1 | # Import module
2 | tabBarModule = require "tabBarModule"
3 |
4 | # Make background white
5 | new BackgroundLayer({backgroundColor:"#fff"})
6 |
7 | # Create scrollComponents for the views that should scroll
8 | featuredScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
9 | topChartsScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
10 | exploreScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
11 | updatesScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
12 |
13 | # Create the views
14 | featuredView = new Layer
15 | width: 750
16 | height: 3800
17 | image: "images/featured.jpg"
18 | superLayer: featuredScroll.content
19 | topChartsView = new Layer
20 | width: 750
21 | height: 4300
22 | image: "images/top-charts.png"
23 | superLayer: topChartsScroll.content
24 | exploreView = new Layer
25 | width: 750
26 | height: 3000
27 | image: "images/explore.png"
28 | superLayer: exploreScroll.content
29 | searchView = new Layer
30 | width: 750
31 | height: 1334
32 | image: "images/search.png"
33 | updatesView = new Layer
34 | width: 750
35 | height: 1334
36 | image: "images/updates.png"
37 | superLayer: updatesScroll.content
38 |
39 | # Create the tab bar
40 | tabBar = new tabBarModule.tabBar
41 | Featured: {icon: "images/featured-icon@2x.png", selectedIcon: "images/featured-selected@2x.png", view: featuredScroll}
42 | "Top Charts": {icon: "images/topcharts-icon@2x.png", selectedIcon: "images/topcharts-selected@2x.png", view: topChartsScroll}
43 | Explore: {icon: "images/explore-icon@2x.png", selectedIcon: "images/explore-selected@2x.png", view: exploreScroll}
44 | Search: {icon: "images/search-icon@2x.png", selectedIcon: "images/search-selected@2x.png", view: searchView}
45 | Updates: {icon: "images/updates-icon@2x.png", selectedIcon: "images/updates-selected@2x.png", view: updatesScroll}
46 |
47 | # Add a badge to the Updates tab
48 | tabBar.setBadgeValue("Updates", 2)
49 |
50 | # Set up events to get the blur layer inside the tab bar to scroll with the scrollComponents
51 | featuredScroll.on Events.Move, ->
52 | tabBar.getItemFromName("Featured").blurView.content.y = -featuredScroll.scrollY
53 | topChartsScroll.on Events.Move, ->
54 | tabBar.getItemFromName("Top Charts").blurView.content.y = -topChartsScroll.scrollY
55 | exploreScroll.on Events.Move, ->
56 | tabBar.getItemFromName("Explore").blurView.content.y = -exploreScroll.scrollY
57 | updatesScroll.on Events.Move, ->
58 | tabBar.getItemFromName("Updates").blurView.content.y = -updatesScroll.scrollY
59 |
60 | # Set Top Charts as the start tab
61 | tabBar.setSelected("Top Charts")
62 |
--------------------------------------------------------------------------------
/appstore-example.framer/framer/backups/backup-1429469976.coffee:
--------------------------------------------------------------------------------
1 | # Import module
2 | tabBarModule = require "tabBarModule"
3 |
4 | # Make background white
5 | new BackgroundLayer({backgroundColor:"#fff"})
6 |
7 | # Create scrollComponents for the views that should scroll
8 | featuredScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
9 | topChartsScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
10 | exploreScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
11 | updatesScroll = new ScrollComponent({width: 750, height: 1334, scrollHorizontal: false})
12 |
13 | # Create the views
14 | featuredView = new Layer
15 | width: 750
16 | height: 3800
17 | image: "images/featured.jpg"
18 | superLayer: featuredScroll.content
19 | topChartsView = new Layer
20 | width: 750
21 | height: 4300
22 | image: "images/top-charts.png"
23 | superLayer: topChartsScroll.content
24 | exploreView = new Layer
25 | width: 750
26 | height: 3000
27 | image: "images/explore.png"
28 | superLayer: exploreScroll.content
29 | searchView = new Layer
30 | width: 750
31 | height: 1334
32 | image: "images/search.png"
33 | updatesView = new Layer
34 | width: 750
35 | height: 1334
36 | image: "images/updates.png"
37 | superLayer: updatesScroll.content
38 |
39 | # Create the tab bar
40 | tabBar = new tabBarModule.tabBar
41 | Featured: {icon: "images/featured-icon@2x.png", selectedIcon: "images/featured-selected@2x.png", view: featuredScroll}
42 | "Top Charts": {icon: "images/topcharts-icon@2x.png", selectedIcon: "images/topcharts-selected@2x.png", view: topChartsScroll}
43 | Explore: {icon: "images/explore-icon@2x.png", selectedIcon: "images/explore-selected@2x.png", view: exploreScroll}
44 | Search: {icon: "images/search-icon@2x.png", selectedIcon: "images/search-selected@2x.png", view: searchView}
45 | Updates: {icon: "images/updates-icon@2x.png", selectedIcon: "images/updates-selected@2x.png", view: updatesScroll}
46 |
47 | # Add a badge to the Updates tab
48 | tabBar.setBadgeValue("Updates", 2)
49 |
50 | # Set up events to get the blur layer inside the tab bar to scroll with the scrollComponents
51 | featuredScroll.on Events.Move, ->
52 | tabBar.getItemFromName("Featured").blurView.content.y = -featuredScroll.scrollY
53 | topChartsScroll.on Events.Move, ->
54 | tabBar.getItemFromName("Top Charts").blurView.content.y = -topChartsScroll.scrollY
55 | exploreScroll.on Events.Move, ->
56 | tabBar.getItemFromName("Explore").blurView.content.y = -exploreScroll.scrollY
57 | updatesScroll.on Events.Move, ->
58 | tabBar.getItemFromName("Updates").blurView.content.y = -updatesScroll.scrollY
59 |
60 | # Set Top Charts as the start tab
61 | tabBar.setSelected("Top Charts")
62 |
--------------------------------------------------------------------------------
/appstore-example.framer/framer/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "device" : "iPhone 5S Space Gray",
3 | "sharedPrototype" : 1,
4 | "deviceOrientation" : 0,
5 | "contentScale" : 1,
6 | "deviceType" : "iphone-6-silver",
7 | "updateDelay" : 0.3,
8 | "deviceScale" : 0.5,
9 | "delay" : 0.3
10 | }
--------------------------------------------------------------------------------
/appstore-example.framer/framer/framer.generated.js:
--------------------------------------------------------------------------------
1 | // This is autogenerated by Framer Studio
2 |
3 |
4 | window.Framer.Defaults.DeviceView = {
5 | "deviceScale" : 0.5,
6 | "orientation" : 0,
7 | "contentScale" : 1,
8 | "deviceType" : "iphone-6-silver"
9 | };
10 |
11 | window.Framer.Defaults.DeviceComponent = {
12 | "deviceScale" : 0.5,
13 | "orientation" : 0,
14 | "contentScale" : 1,
15 | "deviceType" : "iphone-6-silver"
16 | };
17 |
18 | window.FramerStudioInfo = {
19 | "deviceImagesUrl" : "file:\/\/\/Applications\/Framer%20Studio.app\/Contents\/Resources\/DeviceImages\/",
20 | "documentTitle" : "appstore-example.framer"
21 | };
22 |
23 | Framer.Device = new Framer.DeviceView();
24 | Framer.Device.setupContext();
25 | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o errorLineNumber) {
622 | errorLineNumber = loc[0] + 1;
623 | errorColNumber = loc[1];
624 | }
625 | }
626 | return errorLineNumber;
627 | };
628 |
629 | return Runtime;
630 |
631 | })(EventEmitter);
632 |
633 | exports.runtime = new Runtime();
634 |
635 |
636 |
637 | },{"./Bridge":2,"eventemitter3":1}],6:[function(require,module,exports){
638 | var HighlightComponent, setupContext;
639 |
640 | exports.bridge = (require("./Bridge.coffee")).bridge;
641 |
642 | exports.runtime = (require("./Runtime.coffee")).runtime;
643 |
644 | exports.context = require("./Context.coffee");
645 |
646 | HighlightComponent = require("./HighlightComponent.coffee").HighlightComponent;
647 |
648 | if (window.require == null) {
649 | window.require = function(module) {
650 | throw Error("Module " + module + " can't be found");
651 | };
652 | }
653 |
654 | setupContext = function() {
655 | var context, getLayerById, highlighter;
656 | context = new exports.context.ContextListener(Framer.CurrentContext);
657 | highlighter = new HighlightComponent();
658 | exports.bridge.on("ui:highlight", function(info) {
659 | return highlighter.highlight(getLayerById(info.id));
660 | });
661 | exports.bridge.on("ui:unhighlight", function() {
662 | return highlighter.unhighlight();
663 | });
664 | return getLayerById = function(id) {
665 | var i, layer, len, ref;
666 | ref = Framer.CurrentContext._layerList;
667 | for (i = 0, len = ref.length; i < len; i++) {
668 | layer = ref[i];
669 | if (layer.id === id) {
670 | return layer;
671 | }
672 | }
673 | };
674 | };
675 |
676 | if (typeof window !== "undefined" && window !== null) {
677 | window.FramerStudio = exports;
678 | }
679 |
680 |
681 |
682 | },{"./Bridge.coffee":2,"./Context.coffee":3,"./HighlightComponent.coffee":4,"./Runtime.coffee":5}]},{},[6])
--------------------------------------------------------------------------------
/appstore-example.framer/framer/framer.init.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | function isFileLoadingAllowed() {
4 | return (window.location.protocol.indexOf("file") == -1)
5 | }
6 |
7 | function isHomeScreened() {
8 | return ("standalone" in window.navigator) && window.navigator.standalone == true
9 | }
10 |
11 | function isCompatibleBrowser() {
12 | return Utils.isWebKit()
13 | }
14 |
15 | var alertNode;
16 |
17 | function dismissAlert() {
18 | alertNode.parentElement.removeChild(alertNode)
19 | loadProject()
20 | }
21 |
22 | function showAlert(html) {
23 |
24 | alertNode = document.createElement("div")
25 |
26 | alertNode.classList.add("framerAlertBackground")
27 | alertNode.innerHTML = html
28 |
29 | document.addEventListener("DOMContentLoaded", function(event) {
30 | document.body.appendChild(alertNode)
31 | })
32 |
33 | window.dismissAlert = dismissAlert;
34 | }
35 |
36 | function showBrowserAlert() {
37 | var html = ""
38 | html += "
"
39 | html += "Error: Not A WebKit Browser"
40 | html += "Your browser is not supported. Please use Safari or Chrome. "
41 | html += "Try anyway"
42 | html += "
"
43 |
44 | showAlert(html)
45 | }
46 |
47 | function showFileLoadingAlert() {
48 | var html = ""
49 | html += "
"
50 | html += "Error: Local File Restrictions"
51 | html += "Preview this prototype with Framer Mirror or learn more about "
52 | html += "file restrictions. "
53 | html += "Try anyway"
54 | html += "
"
39 | html += "Error: Not A WebKit Browser"
40 | html += "Your browser is not supported. Please use Safari or Chrome. "
41 | html += "Try anyway"
42 | html += "
"
43 |
44 | showAlert(html)
45 | }
46 |
47 | function showFileLoadingAlert() {
48 | var html = ""
49 | html += "
"
50 | html += "Error: Local File Restrictions"
51 | html += "Preview this prototype with Framer Mirror or learn more about "
52 | html += "file restrictions. "
53 | html += "Try anyway"
54 | html += "
"
39 | html += "Error: Not A WebKit Browser"
40 | html += "Your browser is not supported. Please use Safari or Chrome. "
41 | html += "Try anyway"
42 | html += "
"
43 |
44 | showAlert(html)
45 | }
46 |
47 | function showFileLoadingAlert() {
48 | var html = ""
49 | html += "
"
50 | html += "Error: Local File Restrictions"
51 | html += "Preview this prototype with Framer Mirror or learn more about "
52 | html += "file restrictions. "
53 | html += "Try anyway"
54 | html += "