This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import file "news" | |
| news = Framer.Importer.load("imported/news@1x") | |
| # 建立ScrollComponent的寫法一 | |
| #scroll =ScrollComponent.wrap news.content | |
| # 建立ScrollComponent的寫法二 | |
| scroll =new ScrollComponent | |
| #news.article.superLayer=scroll.content | |
| # 這樣寫不行,要設定到article |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import file "news" | |
| news = Framer.Importer.load("imported/news@1x") | |
| # not work | |
| #news.superLayer = scroll.content | |
| # it is ok | |
| scroll =ScrollComponent.wrap news.content | |
| scroll.width=Screen.width |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # deviceType can be either "phone" or "desktop" | |
| Framer.DeviceView.Devices["custom"] = | |
| "deviceType": "tv" | |
| "screenWidth": 1280 | |
| "screenHeight": 720 | |
| "deviceImage": "https://farm6.staticflickr.com/5671/23440590563_40d221e65e_o.jpg" | |
| "deviceImageWidth": 1380 | |
| "deviceImageHeight": 849 | |
| # Set custom device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create vertical scroll component | |
| scroll = new ScrollComponent | |
| width: Screen.width | |
| height: Screen.height | |
| scrollHorizontal: false | |
| # Generate 25 random lines | |
| for number in [0..24] | |
| row = new Layer | |
| width: Screen.width |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for number in [0..24] | |
| row = new Layer | |
| width: Screen.width | |
| height: 100 | |
| y: number * 110 | |
| backgroundColor: Utils.randomColor(0.9) | |
| superLayer: scroll.content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Prototyping with Framer | |
| # by Kenny Chen | |
| # State Exercise Solution | |
| # Map layer | |
| map = new Layer | |
| x:-1000, y:-250, width:2890, height:1859, image:"images/map.jpg" | |
| # Location button | |
| location = new Layer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Prototyping with Framer | |
| # by Kenny Chen | |
| # States | |
| # This imports all the layers for "photo-states" into photos | |
| photos = Framer.Importer.load "imported/photo-states" | |
| # Add layers to largeLayers array | |
| largeLayers = [ | |
| photos.overlay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| btn.states.animationOptions = | |
| curve: "spring(200,20,0)" | |
| delay: delay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| photos.imageA.states.add | |
| large: | |
| y: 800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for layer in largeLayers | |
| layer.visible = true | |
| layer.opacity = 0 | |
| layer.states.add | |
| large: | |
| opacity: 1 |