├── .DS_Store ├── InputField-example.framer ├── .temp.html ├── Icon ├── Icon ├── app.coffee ├── app.js ├── framer │ ├── .framer.modules.js.hash │ ├── backups │ │ ├── backup-2016-06-23 14.43.35.coffee │ │ ├── backup-2016-06-23 14.44.35.coffee │ │ ├── backup-2016-06-23 14.46.35.coffee │ │ ├── backup-2016-06-23 16.08.43.coffee │ │ ├── backup-2016-06-23 16.23.39.coffee │ │ ├── backup-2016-06-23 16.24.39.coffee │ │ ├── backup-2016-06-23 16.25.39.coffee │ │ ├── backup-2016-06-23 16.26.39.coffee │ │ ├── backup-2016-06-23 16.27.39.coffee │ │ ├── backup-2016-06-23 16.28.39.coffee │ │ ├── backup-2016-06-23 16.29.39.coffee │ │ ├── backup-2016-06-23 16.30.39.coffee │ │ ├── backup-2016-06-23 16.31.39.coffee │ │ ├── backup-2016-06-23 16.32.39.coffee │ │ ├── backup-2016-06-23 16.33.39.coffee │ │ ├── backup-2016-06-23 16.34.39.coffee │ │ ├── backup-2016-06-23 16.35.39.coffee │ │ ├── backup-2016-06-23 16.36.39.coffee │ │ ├── backup-2016-06-23 16.37.39.coffee │ │ ├── backup-2016-06-23 16.56.39.coffee │ │ └── backup-2016-06-23 17.03.13.coffee │ ├── coffee-script.js │ ├── config.json │ ├── framer.generated.js │ ├── framer.init.js │ ├── framer.js │ ├── framer.js.map │ ├── framer.modules.js │ ├── images │ │ ├── background.png │ │ ├── cursor-active.png │ │ ├── cursor-active@2x.png │ │ ├── cursor.png │ │ ├── cursor@2x.png │ │ ├── icon-120.png │ │ ├── icon-152.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 │ ├── manifest.txt │ ├── mirror.css │ ├── preview.png │ ├── style.css │ └── version ├── images │ └── .gitkeep ├── index.html └── modules │ └── InputField.coffee ├── LICENSE └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordandobson/framer-InputField/79559f3ff7df74e6a5c93cc827dd9d1655a328b6/.DS_Store -------------------------------------------------------------------------------- /InputField-example.framer/.temp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /InputField-example.framer/Icon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordandobson/framer-InputField/79559f3ff7df74e6a5c93cc827dd9d1655a328b6/InputField-example.framer/Icon -------------------------------------------------------------------------------- /InputField-example.framer/Icon : -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordandobson/framer-InputField/79559f3ff7df74e6a5c93cc827dd9d1655a328b6/InputField-example.framer/Icon -------------------------------------------------------------------------------- /InputField-example.framer/app.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | # TO DO - Textarea or Content Editable 8 | # TO DO - Post to Github 9 | 10 | ################################################################################ 11 | 12 | Screen.backgroundColor = "#808080" 13 | 14 | ################################################################################ 15 | # Build the text inputs 16 | # 17 | # Valid & Tested InputField Types: 18 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 19 | # "time", "month", "date", "datetime-local" 20 | # 21 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 22 | # 23 | # Here's a few examples to use for the value: property when you create them. 24 | # * time: "12:38" 25 | # * month: "2016-01" 26 | # * date: "2016-01-04" 27 | # * datetime-local: "2016-01-04T12:44:31.192" 28 | # 29 | # NOTES / 30 | # Some types work better than others on mobile or display differently than desktop. 31 | # All properties will work with input type "text" but may not work with other types. Ask for help if needed. 32 | # Some events won't fire if you enter incorrect content for the field type: i.e. "foo" for input type "number". 33 | # Find more patterns for the Valid and Invalid events at http://html5pattern.com 34 | # 35 | ################################################################################ 36 | # SIMPLE EXAMPLE 37 | # myInput = new InputField 38 | # width: 300 39 | # height: 88 40 | # backgroundColor: "white" 41 | # 42 | ################################################################################ 43 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 44 | 45 | # InputField Instance: text 46 | 47 | colorInput = new InputField 48 | name: "colorInput" 49 | type: "text" 50 | width: Screen.width 51 | height: 132 52 | y: 0 53 | color: "#696969" 54 | backgroundColor: "#f5f5f5" 55 | indent: 48 56 | fontSize: 48 57 | fontWeight: 600 58 | fontFamily: "Georgia, serif" 59 | placeHolder: "Enter Hexadecimal Color" 60 | placeHolderFocus: "#_ _ _ _ _ _" 61 | placeHolderColor: "silver" 62 | autoCapitalize: false 63 | autoComplete: false 64 | autoCorrect: false 65 | maxLength: 7 66 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 67 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 68 | value: "" 69 | # lineHeight: 30 70 | 71 | # InputField Instance: text - Events 72 | 73 | colorInput.on Events.Input, (value, layer) -> 74 | setDefault @ if @.isEmpty 75 | 76 | colorInput.on Events.Focus, (value, layer) -> 77 | @.color = @.originalTextColor 78 | 79 | colorInput.on Events.Blur, (value, layer) -> 80 | @.color = "limeGreen" if @.isValid 81 | 82 | colorInput.on Events.Valid, (value, layer) -> 83 | setValid @, value 84 | 85 | colorInput.on Events.Invalid, (value, layer) -> 86 | setInvalid @, value 87 | 88 | colorInput.on Events.Match, (value, layer) -> 89 | setDefault @, value 90 | @.animate properties: 91 | backgroundColor: value 92 | color: "#fff" 93 | Utils.delay 3, => 94 | @.animate properties: 95 | backgroundColor: "#f5f5f5" 96 | color: @.originalTextColor 97 | 98 | ################################################################################ 99 | 100 | # InputField Instance: file-image 101 | 102 | imagePlaceholder = new Layer 103 | width: Screen.width 104 | height: Screen.height/2 105 | image: "" 106 | maxY: Screen.height 107 | backgroundColor: "black" 108 | html: "Add Image" 109 | style: 110 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 111 | textAlign: "center" 112 | 113 | fileInput = new InputField 114 | name: "fileInput" 115 | type: "file-image" 116 | width: Screen.width 117 | parent: imagePlaceholder 118 | 119 | 120 | 121 | # InputField Instance: file-image - Events 122 | 123 | fileInput.on Events.FileData, (value, layer) -> 124 | @.parent.image = value 125 | @.parent.html = "" 126 | 127 | ################################################################################ 128 | # DEMO HELPER FUNCTIONS 129 | 130 | # Text Input Validation Functions 131 | 132 | setDefault = (input, value) -> 133 | check.states.switch "invalid" 134 | input.color = input.originalTextColor 135 | input.backgroundColor = "#f5f5f5" 136 | Screen.backgroundColor = "#808080" 137 | 138 | setValid = (input, value) -> 139 | check.states.switch "valid" 140 | input.color = input.originalTextColor 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | 144 | setInvalid = (input, value) -> 145 | check.states.switch "invalid" 146 | input.backgroundColor = "#f5f5f5" 147 | Screen.backgroundColor = value 148 | Utils.delay 1.5, => 149 | unless input.isValid 150 | input.color = "red" unless input.isEmpty 151 | check.states.switch "invalid" 152 | Screen.backgroundColor = value 153 | 154 | ################################################################################ 155 | # DEMO HELPER CODE FOR CHECKMARK 156 | 157 | # Checkmark for Valid Answer 158 | 159 | check = new Layer 160 | width: 20 161 | height: 40 162 | rotation: 45 163 | backgroundColor: "" 164 | style: boxShadow: "inset -8px -8px 0 limeGreen" 165 | 166 | check.states.add 167 | valid: opacity: 1, scale: 1 168 | invalid: opacity: 0, scale: .25 169 | check.states.animationOptions = curve: "spring(1000,30,0)" 170 | check.states.switchInstant "invalid" 171 | check.center() 172 | 173 | check.bringToFront() 174 | check.props = 175 | midY: colorInput.midY - 8 176 | maxX: colorInput.maxX - 48 177 | 178 | ################################################################################ 179 | # DEMO FOR CLASS FUNCTIONS 180 | 181 | # Print button 182 | 183 | buttton_read = new Layer 184 | width: Screen.width/3 185 | height: 88 186 | y: 132 + (Screen.width/3)/3 187 | x: (Screen.width/3)/3 188 | borderRadius: 132/2 189 | backgroundColor: "rgba(0,0,0,.25)" 190 | html: "Print Value" 191 | style: 192 | font: "400 32px/88px -apple-system, sans-serif" 193 | textAlign: "center" 194 | boxShadow: "inset 0 0 0 2px #fff" 195 | 196 | buttton_read.onClick -> 197 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 198 | print colorInput.value 199 | 200 | # Clear button 201 | 202 | buttton_clear = new Layer 203 | width: Screen.width/3 204 | height: 88 205 | y: 132 + (Screen.width/3)/3 206 | maxX: Screen.width - (Screen.width/3)/3 207 | borderRadius: 132/2 208 | backgroundColor: "rgba(0,0,0,.25)" 209 | html: "Clear Value" 210 | style: 211 | font: "400 32px/88px -apple-system, sans-serif" 212 | textAlign: "center" 213 | boxShadow: "inset 0 0 0 2px #fff" 214 | 215 | buttton_clear.onClick -> 216 | colorInput.clear() 217 | setDefault(colorInput) 218 | -------------------------------------------------------------------------------- /InputField-example.framer/app.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.9.3 2 | 3 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/.framer.modules.js.hash: -------------------------------------------------------------------------------- 1 | 5f8d63f377e8cd6ccdc2a8cf4571dbd4:/Users/jordan/_Framer/_Modules/github/framer-InputField/InputField-example.framer/modules/InputField.coffee -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 14.43.35.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | 54 | fileInput = new InputField 55 | name: "fileInput" 56 | type: "file-image" 57 | width: Screen.width 58 | parent: photoSpot 59 | 60 | fileInput.on Events.FileData, (value, layer) -> 61 | @.parent.image = value 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | colorInput.on Events.Input, (value, layer) -> 88 | setDefault @ if @.isEmpty 89 | # print "INPUT", value, layer, @.isEmpty 90 | 91 | colorInput.on Events.Focus, (value, layer) -> 92 | @.color = @.originalTextColor 93 | # print "Blur", value, layer 94 | 95 | colorInput.on Events.Blur, (value, layer) -> 96 | @.color = "limeGreen" if @.isValid 97 | # print "Blur", value, layer 98 | 99 | colorInput.on Events.Valid, (value, layer) -> 100 | setValid @, value 101 | # print "Valid", value, layer 102 | 103 | colorInput.on Events.Invalid, (value, layer) -> 104 | setInvalid @, value 105 | 106 | colorInput.on Events.Invalid, (value, layer) -> 107 | setInvalid @, value 108 | # print "Invalid", value, layer 109 | 110 | colorInput.on Events.Match, (value, layer) -> 111 | setDefault @, value 112 | @.animate properties: 113 | backgroundColor: value 114 | color: "#fff" 115 | Utils.delay 3, => 116 | @.animate properties: 117 | backgroundColor: "#f5f5f5" 118 | color: @.originalTextColor 119 | 120 | ################################################################################ 121 | # DEMO HELPER FUNCTIONS 122 | 123 | setDefault = (input, value) -> 124 | check.states.switch "invalid" 125 | input.color = input.originalTextColor 126 | input.backgroundColor = "#f5f5f5" 127 | Screen.backgroundColor = "#808080" 128 | 129 | setValid = (input, value) -> 130 | check.states.switch "valid" 131 | input.color = input.originalTextColor 132 | input.backgroundColor = "#f5f5f5" 133 | Screen.backgroundColor = value 134 | 135 | setInvalid = (input, value) -> 136 | check.states.switch "invalid" 137 | input.backgroundColor = "#f5f5f5" 138 | Screen.backgroundColor = value 139 | Utils.delay 1.5, => 140 | unless input.isValid 141 | input.color = "red" unless input.isEmpty 142 | check.states.switch "invalid" 143 | Screen.backgroundColor = value 144 | 145 | ################################################################################ 146 | # DEMO HELPER CODE FOR CHECKMARK 147 | 148 | check = new Layer 149 | width: 20 150 | height: 40 151 | rotation: 45 152 | backgroundColor: "" 153 | style: boxShadow: "inset -8px -8px 0 limeGreen" 154 | 155 | check.states.add 156 | valid: opacity: 1, scale: 1 157 | invalid: opacity: 0, scale: .25 158 | check.states.animationOptions = curve: "spring(1000,30,0)" 159 | check.states.switchInstant "invalid" 160 | check.center() 161 | 162 | check.bringToFront() 163 | check.props = 164 | midY: colorInput.midY - 8 165 | maxX: colorInput.maxX - 48 166 | 167 | ################################################################################ 168 | # DEMO FOR CLASS FUNCTIONS 169 | 170 | buttton_read = new Layer 171 | width: Screen.width/3 172 | height: 88 173 | y: 132 + (Screen.width/3)/3 174 | x: (Screen.width/3)/3 175 | borderRadius: 132/2 176 | backgroundColor: "rgba(0,0,0,.25)" 177 | html: "Print Value" 178 | style: 179 | font: "400 32px/88px -apple-system, sans-serif" 180 | textAlign: "center" 181 | boxShadow: "inset 0 0 0 2px #fff" 182 | 183 | buttton_read.onClick -> 184 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 185 | print colorInput.value 186 | 187 | buttton_clear = new Layer 188 | width: Screen.width/3 189 | height: 88 190 | y: 132 + (Screen.width/3)/3 191 | maxX: Screen.width - (Screen.width/3)/3 192 | borderRadius: 132/2 193 | backgroundColor: "rgba(0,0,0,.25)" 194 | html: "Clear Value" 195 | style: 196 | font: "400 32px/88px -apple-system, sans-serif" 197 | textAlign: "center" 198 | boxShadow: "inset 0 0 0 2px #fff" 199 | 200 | buttton_clear.onClick -> 201 | colorInput.clear() 202 | setDefault(colorInput) 203 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 14.44.35.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | 54 | fileInput = new InputField 55 | name: "fileInput" 56 | type: "file-image" 57 | width: Screen.width 58 | parent: photoSpot 59 | 60 | fileInput.on Events.FileData, (value, layer) -> 61 | @.parent.image = value 62 | @.parent.html = "" 63 | 64 | colorInput = new InputField 65 | name: "colorInput" 66 | type: "text" 67 | width: Screen.width 68 | height: 132 69 | y: 0 70 | color: "#696969" 71 | backgroundColor: "#f5f5f5" 72 | indent: 48 73 | fontSize: 48 74 | fontWeight: 600 75 | fontFamily: "Georgia, serif" 76 | placeHolder: "Enter Hexadecimal Color" 77 | placeHolderFocus: "#_ _ _ _ _ _" 78 | placeHolderColor: "silver" 79 | autoCapitalize: false 80 | autoComplete: false 81 | autoCorrect: false 82 | maxLength: 7 83 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 84 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 85 | value: "" 86 | # lineHeight: 30 87 | 88 | colorInput.on Events.Input, (value, layer) -> 89 | setDefault @ if @.isEmpty 90 | # print "INPUT", value, layer, @.isEmpty 91 | 92 | colorInput.on Events.Focus, (value, layer) -> 93 | @.color = @.originalTextColor 94 | # print "Blur", value, layer 95 | 96 | colorInput.on Events.Blur, (value, layer) -> 97 | @.color = "limeGreen" if @.isValid 98 | # print "Blur", value, layer 99 | 100 | colorInput.on Events.Valid, (value, layer) -> 101 | setValid @, value 102 | # print "Valid", value, layer 103 | 104 | colorInput.on Events.Invalid, (value, layer) -> 105 | setInvalid @, value 106 | 107 | colorInput.on Events.Invalid, (value, layer) -> 108 | setInvalid @, value 109 | # print "Invalid", value, layer 110 | 111 | colorInput.on Events.Match, (value, layer) -> 112 | setDefault @, value 113 | @.animate properties: 114 | backgroundColor: value 115 | color: "#fff" 116 | Utils.delay 3, => 117 | @.animate properties: 118 | backgroundColor: "#f5f5f5" 119 | color: @.originalTextColor 120 | 121 | ################################################################################ 122 | # DEMO HELPER FUNCTIONS 123 | 124 | setDefault = (input, value) -> 125 | check.states.switch "invalid" 126 | input.color = input.originalTextColor 127 | input.backgroundColor = "#f5f5f5" 128 | Screen.backgroundColor = "#808080" 129 | 130 | setValid = (input, value) -> 131 | check.states.switch "valid" 132 | input.color = input.originalTextColor 133 | input.backgroundColor = "#f5f5f5" 134 | Screen.backgroundColor = value 135 | 136 | setInvalid = (input, value) -> 137 | check.states.switch "invalid" 138 | input.backgroundColor = "#f5f5f5" 139 | Screen.backgroundColor = value 140 | Utils.delay 1.5, => 141 | unless input.isValid 142 | input.color = "red" unless input.isEmpty 143 | check.states.switch "invalid" 144 | Screen.backgroundColor = value 145 | 146 | ################################################################################ 147 | # DEMO HELPER CODE FOR CHECKMARK 148 | 149 | check = new Layer 150 | width: 20 151 | height: 40 152 | rotation: 45 153 | backgroundColor: "" 154 | style: boxShadow: "inset -8px -8px 0 limeGreen" 155 | 156 | check.states.add 157 | valid: opacity: 1, scale: 1 158 | invalid: opacity: 0, scale: .25 159 | check.states.animationOptions = curve: "spring(1000,30,0)" 160 | check.states.switchInstant "invalid" 161 | check.center() 162 | 163 | check.bringToFront() 164 | check.props = 165 | midY: colorInput.midY - 8 166 | maxX: colorInput.maxX - 48 167 | 168 | ################################################################################ 169 | # DEMO FOR CLASS FUNCTIONS 170 | 171 | buttton_read = new Layer 172 | width: Screen.width/3 173 | height: 88 174 | y: 132 + (Screen.width/3)/3 175 | x: (Screen.width/3)/3 176 | borderRadius: 132/2 177 | backgroundColor: "rgba(0,0,0,.25)" 178 | html: "Print Value" 179 | style: 180 | font: "400 32px/88px -apple-system, sans-serif" 181 | textAlign: "center" 182 | boxShadow: "inset 0 0 0 2px #fff" 183 | 184 | buttton_read.onClick -> 185 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 186 | print colorInput.value 187 | 188 | buttton_clear = new Layer 189 | width: Screen.width/3 190 | height: 88 191 | y: 132 + (Screen.width/3)/3 192 | maxX: Screen.width - (Screen.width/3)/3 193 | borderRadius: 132/2 194 | backgroundColor: "rgba(0,0,0,.25)" 195 | html: "Clear Value" 196 | style: 197 | font: "400 32px/88px -apple-system, sans-serif" 198 | textAlign: "center" 199 | boxShadow: "inset 0 0 0 2px #fff" 200 | 201 | buttton_clear.onClick -> 202 | colorInput.clear() 203 | setDefault(colorInput) 204 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 14.46.35.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | fileInput = new InputField 54 | name: "fileInput" 55 | type: "file-image" 56 | width: Screen.width 57 | parent: photoSpot 58 | 59 | fileInput.on Events.FileData, (value, layer) -> 60 | @.parent.image = value 61 | @.parent.html = "" 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | colorInput.on Events.Input, (value, layer) -> 88 | setDefault @ if @.isEmpty 89 | # print "INPUT", value, layer, @.isEmpty 90 | 91 | colorInput.on Events.Focus, (value, layer) -> 92 | @.color = @.originalTextColor 93 | # print "Blur", value, layer 94 | 95 | colorInput.on Events.Blur, (value, layer) -> 96 | @.color = "limeGreen" if @.isValid 97 | # print "Blur", value, layer 98 | 99 | colorInput.on Events.Valid, (value, layer) -> 100 | setValid @, value 101 | # print "Valid", value, layer 102 | 103 | colorInput.on Events.Invalid, (value, layer) -> 104 | setInvalid @, value 105 | 106 | colorInput.on Events.Invalid, (value, layer) -> 107 | setInvalid @, value 108 | # print "Invalid", value, layer 109 | 110 | colorInput.on Events.Match, (value, layer) -> 111 | setDefault @, value 112 | @.animate properties: 113 | backgroundColor: value 114 | color: "#fff" 115 | Utils.delay 3, => 116 | @.animate properties: 117 | backgroundColor: "#f5f5f5" 118 | color: @.originalTextColor 119 | 120 | ################################################################################ 121 | # DEMO HELPER FUNCTIONS 122 | 123 | setDefault = (input, value) -> 124 | check.states.switch "invalid" 125 | input.color = input.originalTextColor 126 | input.backgroundColor = "#f5f5f5" 127 | Screen.backgroundColor = "#808080" 128 | 129 | setValid = (input, value) -> 130 | check.states.switch "valid" 131 | input.color = input.originalTextColor 132 | input.backgroundColor = "#f5f5f5" 133 | Screen.backgroundColor = value 134 | 135 | setInvalid = (input, value) -> 136 | check.states.switch "invalid" 137 | input.backgroundColor = "#f5f5f5" 138 | Screen.backgroundColor = value 139 | Utils.delay 1.5, => 140 | unless input.isValid 141 | input.color = "red" unless input.isEmpty 142 | check.states.switch "invalid" 143 | Screen.backgroundColor = value 144 | 145 | ################################################################################ 146 | # DEMO HELPER CODE FOR CHECKMARK 147 | 148 | check = new Layer 149 | width: 20 150 | height: 40 151 | rotation: 45 152 | backgroundColor: "" 153 | style: boxShadow: "inset -8px -8px 0 limeGreen" 154 | 155 | check.states.add 156 | valid: opacity: 1, scale: 1 157 | invalid: opacity: 0, scale: .25 158 | check.states.animationOptions = curve: "spring(1000,30,0)" 159 | check.states.switchInstant "invalid" 160 | check.center() 161 | 162 | check.bringToFront() 163 | check.props = 164 | midY: colorInput.midY - 8 165 | maxX: colorInput.maxX - 48 166 | 167 | ################################################################################ 168 | # DEMO FOR CLASS FUNCTIONS 169 | 170 | buttton_read = new Layer 171 | width: Screen.width/3 172 | height: 88 173 | y: 132 + (Screen.width/3)/3 174 | x: (Screen.width/3)/3 175 | borderRadius: 132/2 176 | backgroundColor: "rgba(0,0,0,.25)" 177 | html: "Print Value" 178 | style: 179 | font: "400 32px/88px -apple-system, sans-serif" 180 | textAlign: "center" 181 | boxShadow: "inset 0 0 0 2px #fff" 182 | 183 | buttton_read.onClick -> 184 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 185 | print colorInput.value 186 | 187 | buttton_clear = new Layer 188 | width: Screen.width/3 189 | height: 88 190 | y: 132 + (Screen.width/3)/3 191 | maxX: Screen.width - (Screen.width/3)/3 192 | borderRadius: 132/2 193 | backgroundColor: "rgba(0,0,0,.25)" 194 | html: "Clear Value" 195 | style: 196 | font: "400 32px/88px -apple-system, sans-serif" 197 | textAlign: "center" 198 | boxShadow: "inset 0 0 0 2px #fff" 199 | 200 | buttton_clear.onClick -> 201 | colorInput.clear() 202 | setDefault(colorInput) 203 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.08.43.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | fileInput = new InputField 54 | name: "fileInput" 55 | type: "file-image" 56 | width: Screen.width 57 | parent: photoSpot 58 | 59 | fileInput.on Events.FileData, (value, layer) -> 60 | @.parent.image = value 61 | @.parent.html = "" 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | colorInput.on Events.Input, (value, layer) -> 88 | setDefault @ if @.isEmpty 89 | # print "INPUT", value, layer, @.isEmpty 90 | 91 | colorInput.on Events.Focus, (value, layer) -> 92 | @.color = @.originalTextColor 93 | # print "Blur", value, layer 94 | 95 | colorInput.on Events.Blur, (value, layer) -> 96 | @.color = "limeGreen" if @.isValid 97 | # print "Blur", value, layer 98 | 99 | colorInput.on Events.Valid, (value, layer) -> 100 | setValid @, value 101 | # print "Valid", value, layer 102 | 103 | colorInput.on Events.Invalid, (value, layer) -> 104 | setInvalid @, value 105 | 106 | colorInput.on Events.Invalid, (value, layer) -> 107 | setInvalid @, value 108 | # print "Invalid", value, layer 109 | 110 | colorInput.on Events.Match, (value, layer) -> 111 | setDefault @, value 112 | @.animate properties: 113 | backgroundColor: value 114 | color: "#fff" 115 | Utils.delay 3, => 116 | @.animate properties: 117 | backgroundColor: "#f5f5f5" 118 | color: @.originalTextColor 119 | 120 | ################################################################################ 121 | # DEMO HELPER FUNCTIONS 122 | 123 | setDefault = (input, value) -> 124 | check.states.switch "invalid" 125 | input.color = input.originalTextColor 126 | input.backgroundColor = "#f5f5f5" 127 | Screen.backgroundColor = "#808080" 128 | 129 | setValid = (input, value) -> 130 | check.states.switch "valid" 131 | input.color = input.originalTextColor 132 | input.backgroundColor = "#f5f5f5" 133 | Screen.backgroundColor = value 134 | 135 | setInvalid = (input, value) -> 136 | check.states.switch "invalid" 137 | input.backgroundColor = "#f5f5f5" 138 | Screen.backgroundColor = value 139 | Utils.delay 1.5, => 140 | unless input.isValid 141 | input.color = "red" unless input.isEmpty 142 | check.states.switch "invalid" 143 | Screen.backgroundColor = value 144 | 145 | ################################################################################ 146 | # DEMO HELPER CODE FOR CHECKMARK 147 | 148 | check = new Layer 149 | width: 20 150 | height: 40 151 | rotation: 45 152 | backgroundColor: "" 153 | style: boxShadow: "inset -8px -8px 0 limeGreen" 154 | 155 | check.states.add 156 | valid: opacity: 1, scale: 1 157 | invalid: opacity: 0, scale: .25 158 | check.states.animationOptions = curve: "spring(1000,30,0)" 159 | check.states.switchInstant "invalid" 160 | check.center() 161 | 162 | check.bringToFront() 163 | check.props = 164 | midY: colorInput.midY - 8 165 | maxX: colorInput.maxX - 48 166 | 167 | ################################################################################ 168 | # DEMO FOR CLASS FUNCTIONS 169 | 170 | buttton_read = new Layer 171 | width: Screen.width/3 172 | height: 88 173 | y: 132 + (Screen.width/3)/3 174 | x: (Screen.width/3)/3 175 | borderRadius: 132/2 176 | backgroundColor: "rgba(0,0,0,.25)" 177 | html: "Print Value" 178 | style: 179 | font: "400 32px/88px -apple-system, sans-serif" 180 | textAlign: "center" 181 | boxShadow: "inset 0 0 0 2px #fff" 182 | 183 | buttton_read.onClick -> 184 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 185 | print colorInput.value 186 | 187 | buttton_clear = new Layer 188 | width: Screen.width/3 189 | height: 88 190 | y: 132 + (Screen.width/3)/3 191 | maxX: Screen.width - (Screen.width/3)/3 192 | borderRadius: 132/2 193 | backgroundColor: "rgba(0,0,0,.25)" 194 | html: "Clear Value" 195 | style: 196 | font: "400 32px/88px -apple-system, sans-serif" 197 | textAlign: "center" 198 | boxShadow: "inset 0 0 0 2px #fff" 199 | 200 | buttton_clear.onClick -> 201 | colorInput.clear() 202 | setDefault(colorInput) 203 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.23.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | fileInput = new InputField 54 | name: "fileInput" 55 | type: "file-image" 56 | width: Screen.width 57 | parent: photoSpot 58 | 59 | fileInput.on Events.FileData, (value, layer) -> 60 | @.parent.image = value 61 | @.parent.html = "" 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | colorInput.on Events.Input, (value, layer) -> 88 | setDefault @ if @.isEmpty 89 | # print "INPUT", value, layer, @.isEmpty 90 | 91 | colorInput.on Events.Focus, (value, layer) -> 92 | @.color = @.originalTextColor 93 | # print "Blur", value, layer 94 | 95 | colorInput.on Events.Blur, (value, layer) -> 96 | @.color = "limeGreen" if @.isValid 97 | # print "Blur", value, layer 98 | 99 | colorInput.on Events.Valid, (value, layer) -> 100 | setValid @, value 101 | # print "Valid", value, layer 102 | 103 | colorInput.on Events.Invalid, (value, layer) -> 104 | setInvalid @, value 105 | 106 | colorInput.on Events.Invalid, (value, layer) -> 107 | setInvalid @, value 108 | # print "Invalid", value, layer 109 | 110 | colorInput.on Events.Match, (value, layer) -> 111 | setDefault @, value 112 | @.animate properties: 113 | backgroundColor: value 114 | color: "#fff" 115 | Utils.delay 3, => 116 | @.animate properties: 117 | backgroundColor: "#f5f5f5" 118 | color: @.originalTextColor 119 | 120 | ################################################################################ 121 | # DEMO HELPER FUNCTIONS 122 | 123 | setDefault = (input, value) -> 124 | check.states.switch "invalid" 125 | input.color = input.originalTextColor 126 | input.backgroundColor = "#f5f5f5" 127 | Screen.backgroundColor = "#808080" 128 | 129 | setValid = (input, value) -> 130 | check.states.switch "valid" 131 | input.color = input.originalTextColor 132 | input.backgroundColor = "#f5f5f5" 133 | Screen.backgroundColor = value 134 | 135 | setInvalid = (input, value) -> 136 | check.states.switch "invalid" 137 | input.backgroundColor = "#f5f5f5" 138 | Screen.backgroundColor = value 139 | Utils.delay 1.5, => 140 | unless input.isValid 141 | input.color = "red" unless input.isEmpty 142 | check.states.switch "invalid" 143 | Screen.backgroundColor = value 144 | 145 | ################################################################################ 146 | # DEMO HELPER CODE FOR CHECKMARK 147 | 148 | # Checkmark for Valid Answer 149 | 150 | check = new Layer 151 | width: 20 152 | height: 40 153 | rotation: 45 154 | backgroundColor: "" 155 | style: boxShadow: "inset -8px -8px 0 limeGreen" 156 | 157 | check.states.add 158 | valid: opacity: 1, scale: 1 159 | invalid: opacity: 0, scale: .25 160 | check.states.animationOptions = curve: "spring(1000,30,0)" 161 | check.states.switchInstant "invalid" 162 | check.center() 163 | 164 | check.bringToFront() 165 | check.props = 166 | midY: colorInput.midY - 8 167 | maxX: colorInput.maxX - 48 168 | 169 | ################################################################################ 170 | # DEMO FOR CLASS FUNCTIONS 171 | 172 | # Print button 173 | 174 | buttton_read = new Layer 175 | width: Screen.width/3 176 | height: 88 177 | y: 132 + (Screen.width/3)/3 178 | x: (Screen.width/3)/3 179 | borderRadius: 132/2 180 | backgroundColor: "rgba(0,0,0,.25)" 181 | html: "Print Value" 182 | style: 183 | font: "400 32px/88px -apple-system, sans-serif" 184 | textAlign: "center" 185 | boxShadow: "inset 0 0 0 2px #fff" 186 | 187 | buttton_read.onClick -> 188 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 189 | print colorInput.value 190 | 191 | # Clear button 192 | 193 | buttton_clear = new Layer 194 | width: Screen.width/3 195 | height: 88 196 | y: 132 + (Screen.width/3)/3 197 | maxX: Screen.width - (Screen.width/3)/3 198 | borderRadius: 132/2 199 | backgroundColor: "rgba(0,0,0,.25)" 200 | html: "Clear Value" 201 | style: 202 | font: "400 32px/88px -apple-system, sans-serif" 203 | textAlign: "center" 204 | boxShadow: "inset 0 0 0 2px #fff" 205 | 206 | buttton_clear.onClick -> 207 | colorInput.clear() 208 | setDefault(colorInput) 209 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.24.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | fileInput = new InputField 54 | name: "fileInput" 55 | type: "file-image" 56 | width: Screen.width 57 | parent: photoSpot 58 | 59 | fileInput.on Events.FileData, (value, layer) -> 60 | @.parent.image = value 61 | @.parent.html = "" 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | colorInput.on Events.Input, (value, layer) -> 88 | setDefault @ if @.isEmpty 89 | # print "INPUT", value, layer, @.isEmpty 90 | 91 | colorInput.on Events.Focus, (value, layer) -> 92 | @.color = @.originalTextColor 93 | # print "Blur", value, layer 94 | 95 | colorInput.on Events.Blur, (value, layer) -> 96 | @.color = "limeGreen" if @.isValid 97 | # print "Blur", value, layer 98 | 99 | colorInput.on Events.Valid, (value, layer) -> 100 | setValid @, value 101 | # print "Valid", value, layer 102 | 103 | colorInput.on Events.Invalid, (value, layer) -> 104 | setInvalid @, value 105 | 106 | colorInput.on Events.Invalid, (value, layer) -> 107 | setInvalid @, value 108 | # print "Invalid", value, layer 109 | 110 | colorInput.on Events.Match, (value, layer) -> 111 | setDefault @, value 112 | @.animate properties: 113 | backgroundColor: value 114 | color: "#fff" 115 | Utils.delay 3, => 116 | @.animate properties: 117 | backgroundColor: "#f5f5f5" 118 | color: @.originalTextColor 119 | 120 | ################################################################################ 121 | # DEMO HELPER FUNCTIONS 122 | 123 | # Text Input Validation Functions 124 | 125 | setDefault = (input, value) -> 126 | check.states.switch "invalid" 127 | input.color = input.originalTextColor 128 | input.backgroundColor = "#f5f5f5" 129 | Screen.backgroundColor = "#808080" 130 | 131 | setValid = (input, value) -> 132 | check.states.switch "valid" 133 | input.color = input.originalTextColor 134 | input.backgroundColor = "#f5f5f5" 135 | Screen.backgroundColor = value 136 | 137 | setInvalid = (input, value) -> 138 | check.states.switch "invalid" 139 | input.backgroundColor = "#f5f5f5" 140 | Screen.backgroundColor = value 141 | Utils.delay 1.5, => 142 | unless input.isValid 143 | input.color = "red" unless input.isEmpty 144 | check.states.switch "invalid" 145 | Screen.backgroundColor = value 146 | 147 | ################################################################################ 148 | # DEMO HELPER CODE FOR CHECKMARK 149 | 150 | # Checkmark for Valid Answer 151 | 152 | check = new Layer 153 | width: 20 154 | height: 40 155 | rotation: 45 156 | backgroundColor: "" 157 | style: boxShadow: "inset -8px -8px 0 limeGreen" 158 | 159 | check.states.add 160 | valid: opacity: 1, scale: 1 161 | invalid: opacity: 0, scale: .25 162 | check.states.animationOptions = curve: "spring(1000,30,0)" 163 | check.states.switchInstant "invalid" 164 | check.center() 165 | 166 | check.bringToFront() 167 | check.props = 168 | midY: colorInput.midY - 8 169 | maxX: colorInput.maxX - 48 170 | 171 | ################################################################################ 172 | # DEMO FOR CLASS FUNCTIONS 173 | 174 | # Print button 175 | 176 | buttton_read = new Layer 177 | width: Screen.width/3 178 | height: 88 179 | y: 132 + (Screen.width/3)/3 180 | x: (Screen.width/3)/3 181 | borderRadius: 132/2 182 | backgroundColor: "rgba(0,0,0,.25)" 183 | html: "Print Value" 184 | style: 185 | font: "400 32px/88px -apple-system, sans-serif" 186 | textAlign: "center" 187 | boxShadow: "inset 0 0 0 2px #fff" 188 | 189 | buttton_read.onClick -> 190 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 191 | print colorInput.value 192 | 193 | # Clear button 194 | 195 | buttton_clear = new Layer 196 | width: Screen.width/3 197 | height: 88 198 | y: 132 + (Screen.width/3)/3 199 | maxX: Screen.width - (Screen.width/3)/3 200 | borderRadius: 132/2 201 | backgroundColor: "rgba(0,0,0,.25)" 202 | html: "Clear Value" 203 | style: 204 | font: "400 32px/88px -apple-system, sans-serif" 205 | textAlign: "center" 206 | boxShadow: "inset 0 0 0 2px #fff" 207 | 208 | buttton_clear.onClick -> 209 | colorInput.clear() 210 | setDefault(colorInput) 211 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.25.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | fileInput = new InputField 54 | name: "fileInput" 55 | type: "file-image" 56 | width: Screen.width 57 | parent: photoSpot 58 | 59 | fileInput.on Events.FileData, (value, layer) -> 60 | @.parent.image = value 61 | @.parent.html = "" 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | # InputField Events 88 | 89 | colorInput.on Events.Input, (value, layer) -> 90 | setDefault @ if @.isEmpty 91 | # print "INPUT", value, layer, @.isEmpty 92 | 93 | colorInput.on Events.Focus, (value, layer) -> 94 | @.color = @.originalTextColor 95 | # print "Blur", value, layer 96 | 97 | colorInput.on Events.Blur, (value, layer) -> 98 | @.color = "limeGreen" if @.isValid 99 | # print "Blur", value, layer 100 | 101 | colorInput.on Events.Valid, (value, layer) -> 102 | setValid @, value 103 | # print "Valid", value, layer 104 | 105 | colorInput.on Events.Invalid, (value, layer) -> 106 | setInvalid @, value 107 | 108 | colorInput.on Events.Invalid, (value, layer) -> 109 | setInvalid @, value 110 | # print "Invalid", value, layer 111 | 112 | colorInput.on Events.Match, (value, layer) -> 113 | setDefault @, value 114 | @.animate properties: 115 | backgroundColor: value 116 | color: "#fff" 117 | Utils.delay 3, => 118 | @.animate properties: 119 | backgroundColor: "#f5f5f5" 120 | color: @.originalTextColor 121 | 122 | ################################################################################ 123 | # DEMO HELPER FUNCTIONS 124 | 125 | # Text Input Validation Functions 126 | 127 | setDefault = (input, value) -> 128 | check.states.switch "invalid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = "#808080" 132 | 133 | setValid = (input, value) -> 134 | check.states.switch "valid" 135 | input.color = input.originalTextColor 136 | input.backgroundColor = "#f5f5f5" 137 | Screen.backgroundColor = value 138 | 139 | setInvalid = (input, value) -> 140 | check.states.switch "invalid" 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | Utils.delay 1.5, => 144 | unless input.isValid 145 | input.color = "red" unless input.isEmpty 146 | check.states.switch "invalid" 147 | Screen.backgroundColor = value 148 | 149 | ################################################################################ 150 | # DEMO HELPER CODE FOR CHECKMARK 151 | 152 | # Checkmark for Valid Answer 153 | 154 | check = new Layer 155 | width: 20 156 | height: 40 157 | rotation: 45 158 | backgroundColor: "" 159 | style: boxShadow: "inset -8px -8px 0 limeGreen" 160 | 161 | check.states.add 162 | valid: opacity: 1, scale: 1 163 | invalid: opacity: 0, scale: .25 164 | check.states.animationOptions = curve: "spring(1000,30,0)" 165 | check.states.switchInstant "invalid" 166 | check.center() 167 | 168 | check.bringToFront() 169 | check.props = 170 | midY: colorInput.midY - 8 171 | maxX: colorInput.maxX - 48 172 | 173 | ################################################################################ 174 | # DEMO FOR CLASS FUNCTIONS 175 | 176 | # Print button 177 | 178 | buttton_read = new Layer 179 | width: Screen.width/3 180 | height: 88 181 | y: 132 + (Screen.width/3)/3 182 | x: (Screen.width/3)/3 183 | borderRadius: 132/2 184 | backgroundColor: "rgba(0,0,0,.25)" 185 | html: "Print Value" 186 | style: 187 | font: "400 32px/88px -apple-system, sans-serif" 188 | textAlign: "center" 189 | boxShadow: "inset 0 0 0 2px #fff" 190 | 191 | buttton_read.onClick -> 192 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 193 | print colorInput.value 194 | 195 | # Clear button 196 | 197 | buttton_clear = new Layer 198 | width: Screen.width/3 199 | height: 88 200 | y: 132 + (Screen.width/3)/3 201 | maxX: Screen.width - (Screen.width/3)/3 202 | borderRadius: 132/2 203 | backgroundColor: "rgba(0,0,0,.25)" 204 | html: "Clear Value" 205 | style: 206 | font: "400 32px/88px -apple-system, sans-serif" 207 | textAlign: "center" 208 | boxShadow: "inset 0 0 0 2px #fff" 209 | 210 | buttton_clear.onClick -> 211 | colorInput.clear() 212 | setDefault(colorInput) 213 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.26.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | photoSpot = new Layer 43 | width: Screen.width 44 | height: Screen.height/2 45 | image: "" 46 | maxY: Screen.height 47 | backgroundColor: "black" 48 | html: "Add Image" 49 | style: 50 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 51 | textAlign: "center" 52 | 53 | fileInput = new InputField 54 | name: "fileInput" 55 | type: "file-image" 56 | width: Screen.width 57 | parent: photoSpot 58 | 59 | fileInput.on Events.FileData, (value, layer) -> 60 | @.parent.image = value 61 | @.parent.html = "" 62 | 63 | colorInput = new InputField 64 | name: "colorInput" 65 | type: "text" 66 | width: Screen.width 67 | height: 132 68 | y: 0 69 | color: "#696969" 70 | backgroundColor: "#f5f5f5" 71 | indent: 48 72 | fontSize: 48 73 | fontWeight: 600 74 | fontFamily: "Georgia, serif" 75 | placeHolder: "Enter Hexadecimal Color" 76 | placeHolderFocus: "#_ _ _ _ _ _" 77 | placeHolderColor: "silver" 78 | autoCapitalize: false 79 | autoComplete: false 80 | autoCorrect: false 81 | maxLength: 7 82 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 83 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 84 | value: "" 85 | # lineHeight: 30 86 | 87 | # InputField Events 88 | 89 | colorInput.on Events.Input, (value, layer) -> 90 | setDefault @ if @.isEmpty 91 | 92 | colorInput.on Events.Focus, (value, layer) -> 93 | @.color = @.originalTextColor 94 | 95 | colorInput.on Events.Blur, (value, layer) -> 96 | @.color = "limeGreen" if @.isValid 97 | 98 | colorInput.on Events.Valid, (value, layer) -> 99 | setValid @, value 100 | 101 | colorInput.on Events.Invalid, (value, layer) -> 102 | setInvalid @, value 103 | 104 | colorInput.on Events.Match, (value, layer) -> 105 | setDefault @, value 106 | @.animate properties: 107 | backgroundColor: value 108 | color: "#fff" 109 | Utils.delay 3, => 110 | @.animate properties: 111 | backgroundColor: "#f5f5f5" 112 | color: @.originalTextColor 113 | 114 | ################################################################################ 115 | # DEMO HELPER FUNCTIONS 116 | 117 | # Text Input Validation Functions 118 | 119 | setDefault = (input, value) -> 120 | check.states.switch "invalid" 121 | input.color = input.originalTextColor 122 | input.backgroundColor = "#f5f5f5" 123 | Screen.backgroundColor = "#808080" 124 | 125 | setValid = (input, value) -> 126 | check.states.switch "valid" 127 | input.color = input.originalTextColor 128 | input.backgroundColor = "#f5f5f5" 129 | Screen.backgroundColor = value 130 | 131 | setInvalid = (input, value) -> 132 | check.states.switch "invalid" 133 | input.backgroundColor = "#f5f5f5" 134 | Screen.backgroundColor = value 135 | Utils.delay 1.5, => 136 | unless input.isValid 137 | input.color = "red" unless input.isEmpty 138 | check.states.switch "invalid" 139 | Screen.backgroundColor = value 140 | 141 | ################################################################################ 142 | # DEMO HELPER CODE FOR CHECKMARK 143 | 144 | # Checkmark for Valid Answer 145 | 146 | check = new Layer 147 | width: 20 148 | height: 40 149 | rotation: 45 150 | backgroundColor: "" 151 | style: boxShadow: "inset -8px -8px 0 limeGreen" 152 | 153 | check.states.add 154 | valid: opacity: 1, scale: 1 155 | invalid: opacity: 0, scale: .25 156 | check.states.animationOptions = curve: "spring(1000,30,0)" 157 | check.states.switchInstant "invalid" 158 | check.center() 159 | 160 | check.bringToFront() 161 | check.props = 162 | midY: colorInput.midY - 8 163 | maxX: colorInput.maxX - 48 164 | 165 | ################################################################################ 166 | # DEMO FOR CLASS FUNCTIONS 167 | 168 | # Print button 169 | 170 | buttton_read = new Layer 171 | width: Screen.width/3 172 | height: 88 173 | y: 132 + (Screen.width/3)/3 174 | x: (Screen.width/3)/3 175 | borderRadius: 132/2 176 | backgroundColor: "rgba(0,0,0,.25)" 177 | html: "Print Value" 178 | style: 179 | font: "400 32px/88px -apple-system, sans-serif" 180 | textAlign: "center" 181 | boxShadow: "inset 0 0 0 2px #fff" 182 | 183 | buttton_read.onClick -> 184 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 185 | print colorInput.value 186 | 187 | # Clear button 188 | 189 | buttton_clear = new Layer 190 | width: Screen.width/3 191 | height: 88 192 | y: 132 + (Screen.width/3)/3 193 | maxX: Screen.width - (Screen.width/3)/3 194 | borderRadius: 132/2 195 | backgroundColor: "rgba(0,0,0,.25)" 196 | html: "Clear Value" 197 | style: 198 | font: "400 32px/88px -apple-system, sans-serif" 199 | textAlign: "center" 200 | boxShadow: "inset 0 0 0 2px #fff" 201 | 202 | buttton_clear.onClick -> 203 | colorInput.clear() 204 | setDefault(colorInput) 205 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.27.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | ################################################################################ 96 | # DEMO HELPER FUNCTIONS 97 | 98 | # Text Input Validation Functions 99 | 100 | setDefault = (input, value) -> 101 | check.states.switch "invalid" 102 | input.color = input.originalTextColor 103 | input.backgroundColor = "#f5f5f5" 104 | Screen.backgroundColor = "#808080" 105 | 106 | setValid = (input, value) -> 107 | check.states.switch "valid" 108 | input.color = input.originalTextColor 109 | input.backgroundColor = "#f5f5f5" 110 | Screen.backgroundColor = value 111 | 112 | setInvalid = (input, value) -> 113 | check.states.switch "invalid" 114 | input.backgroundColor = "#f5f5f5" 115 | Screen.backgroundColor = value 116 | Utils.delay 1.5, => 117 | unless input.isValid 118 | input.color = "red" unless input.isEmpty 119 | check.states.switch "invalid" 120 | Screen.backgroundColor = value 121 | 122 | ################################################################################ 123 | # DEMO HELPER CODE FOR CHECKMARK 124 | 125 | # Checkmark for Valid Answer 126 | 127 | check = new Layer 128 | width: 20 129 | height: 40 130 | rotation: 45 131 | backgroundColor: "" 132 | style: boxShadow: "inset -8px -8px 0 limeGreen" 133 | 134 | check.states.add 135 | valid: opacity: 1, scale: 1 136 | invalid: opacity: 0, scale: .25 137 | check.states.animationOptions = curve: "spring(1000,30,0)" 138 | check.states.switchInstant "invalid" 139 | check.center() 140 | 141 | check.bringToFront() 142 | check.props = 143 | midY: colorInput.midY - 8 144 | maxX: colorInput.maxX - 48 145 | 146 | ################################################################################ 147 | # DEMO FOR CLASS FUNCTIONS 148 | 149 | # Print button 150 | 151 | buttton_read = new Layer 152 | width: Screen.width/3 153 | height: 88 154 | y: 132 + (Screen.width/3)/3 155 | x: (Screen.width/3)/3 156 | borderRadius: 132/2 157 | backgroundColor: "rgba(0,0,0,.25)" 158 | html: "Print Value" 159 | style: 160 | font: "400 32px/88px -apple-system, sans-serif" 161 | textAlign: "center" 162 | boxShadow: "inset 0 0 0 2px #fff" 163 | 164 | buttton_read.onClick -> 165 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 166 | print colorInput.value 167 | 168 | # Clear button 169 | 170 | buttton_clear = new Layer 171 | width: Screen.width/3 172 | height: 88 173 | y: 132 + (Screen.width/3)/3 174 | maxX: Screen.width - (Screen.width/3)/3 175 | borderRadius: 132/2 176 | backgroundColor: "rgba(0,0,0,.25)" 177 | html: "Clear Value" 178 | style: 179 | font: "400 32px/88px -apple-system, sans-serif" 180 | textAlign: "center" 181 | boxShadow: "inset 0 0 0 2px #fff" 182 | 183 | buttton_clear.onClick -> 184 | colorInput.clear() 185 | setDefault(colorInput) 186 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.28.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | imagePlaceholde = new Layer 96 | width: Screen.width 97 | height: Screen.height/2 98 | image: "" 99 | maxY: Screen.height 100 | backgroundColor: "black" 101 | html: "Add Image" 102 | style: 103 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 104 | textAlign: "center" 105 | 106 | fileInput = new InputField 107 | name: "fileInput" 108 | type: "file-image" 109 | width: Screen.width 110 | parent: photoSpot 111 | 112 | fileInput.on Events.FileData, (value, layer) -> 113 | @.parent.image = value 114 | @.parent.html = "" 115 | 116 | ################################################################################ 117 | # DEMO HELPER FUNCTIONS 118 | 119 | # Text Input Validation Functions 120 | 121 | setDefault = (input, value) -> 122 | check.states.switch "invalid" 123 | input.color = input.originalTextColor 124 | input.backgroundColor = "#f5f5f5" 125 | Screen.backgroundColor = "#808080" 126 | 127 | setValid = (input, value) -> 128 | check.states.switch "valid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = value 132 | 133 | setInvalid = (input, value) -> 134 | check.states.switch "invalid" 135 | input.backgroundColor = "#f5f5f5" 136 | Screen.backgroundColor = value 137 | Utils.delay 1.5, => 138 | unless input.isValid 139 | input.color = "red" unless input.isEmpty 140 | check.states.switch "invalid" 141 | Screen.backgroundColor = value 142 | 143 | ################################################################################ 144 | # DEMO HELPER CODE FOR CHECKMARK 145 | 146 | # Checkmark for Valid Answer 147 | 148 | check = new Layer 149 | width: 20 150 | height: 40 151 | rotation: 45 152 | backgroundColor: "" 153 | style: boxShadow: "inset -8px -8px 0 limeGreen" 154 | 155 | check.states.add 156 | valid: opacity: 1, scale: 1 157 | invalid: opacity: 0, scale: .25 158 | check.states.animationOptions = curve: "spring(1000,30,0)" 159 | check.states.switchInstant "invalid" 160 | check.center() 161 | 162 | check.bringToFront() 163 | check.props = 164 | midY: colorInput.midY - 8 165 | maxX: colorInput.maxX - 48 166 | 167 | ################################################################################ 168 | # DEMO FOR CLASS FUNCTIONS 169 | 170 | # Print button 171 | 172 | buttton_read = new Layer 173 | width: Screen.width/3 174 | height: 88 175 | y: 132 + (Screen.width/3)/3 176 | x: (Screen.width/3)/3 177 | borderRadius: 132/2 178 | backgroundColor: "rgba(0,0,0,.25)" 179 | html: "Print Value" 180 | style: 181 | font: "400 32px/88px -apple-system, sans-serif" 182 | textAlign: "center" 183 | boxShadow: "inset 0 0 0 2px #fff" 184 | 185 | buttton_read.onClick -> 186 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 187 | print colorInput.value 188 | 189 | # Clear button 190 | 191 | buttton_clear = new Layer 192 | width: Screen.width/3 193 | height: 88 194 | y: 132 + (Screen.width/3)/3 195 | maxX: Screen.width - (Screen.width/3)/3 196 | borderRadius: 132/2 197 | backgroundColor: "rgba(0,0,0,.25)" 198 | html: "Clear Value" 199 | style: 200 | font: "400 32px/88px -apple-system, sans-serif" 201 | textAlign: "center" 202 | boxShadow: "inset 0 0 0 2px #fff" 203 | 204 | buttton_clear.onClick -> 205 | colorInput.clear() 206 | setDefault(colorInput) 207 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.29.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | fileInput.on Events.FileData, (value, layer) -> 115 | @.parent.image = value 116 | @.parent.html = "" 117 | 118 | ################################################################################ 119 | # DEMO HELPER FUNCTIONS 120 | 121 | # Text Input Validation Functions 122 | 123 | setDefault = (input, value) -> 124 | check.states.switch "invalid" 125 | input.color = input.originalTextColor 126 | input.backgroundColor = "#f5f5f5" 127 | Screen.backgroundColor = "#808080" 128 | 129 | setValid = (input, value) -> 130 | check.states.switch "valid" 131 | input.color = input.originalTextColor 132 | input.backgroundColor = "#f5f5f5" 133 | Screen.backgroundColor = value 134 | 135 | setInvalid = (input, value) -> 136 | check.states.switch "invalid" 137 | input.backgroundColor = "#f5f5f5" 138 | Screen.backgroundColor = value 139 | Utils.delay 1.5, => 140 | unless input.isValid 141 | input.color = "red" unless input.isEmpty 142 | check.states.switch "invalid" 143 | Screen.backgroundColor = value 144 | 145 | ################################################################################ 146 | # DEMO HELPER CODE FOR CHECKMARK 147 | 148 | # Checkmark for Valid Answer 149 | 150 | check = new Layer 151 | width: 20 152 | height: 40 153 | rotation: 45 154 | backgroundColor: "" 155 | style: boxShadow: "inset -8px -8px 0 limeGreen" 156 | 157 | check.states.add 158 | valid: opacity: 1, scale: 1 159 | invalid: opacity: 0, scale: .25 160 | check.states.animationOptions = curve: "spring(1000,30,0)" 161 | check.states.switchInstant "invalid" 162 | check.center() 163 | 164 | check.bringToFront() 165 | check.props = 166 | midY: colorInput.midY - 8 167 | maxX: colorInput.maxX - 48 168 | 169 | ################################################################################ 170 | # DEMO FOR CLASS FUNCTIONS 171 | 172 | # Print button 173 | 174 | buttton_read = new Layer 175 | width: Screen.width/3 176 | height: 88 177 | y: 132 + (Screen.width/3)/3 178 | x: (Screen.width/3)/3 179 | borderRadius: 132/2 180 | backgroundColor: "rgba(0,0,0,.25)" 181 | html: "Print Value" 182 | style: 183 | font: "400 32px/88px -apple-system, sans-serif" 184 | textAlign: "center" 185 | boxShadow: "inset 0 0 0 2px #fff" 186 | 187 | buttton_read.onClick -> 188 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 189 | print colorInput.value 190 | 191 | # Clear button 192 | 193 | buttton_clear = new Layer 194 | width: Screen.width/3 195 | height: 88 196 | y: 132 + (Screen.width/3)/3 197 | maxX: Screen.width - (Screen.width/3)/3 198 | borderRadius: 132/2 199 | backgroundColor: "rgba(0,0,0,.25)" 200 | html: "Clear Value" 201 | style: 202 | font: "400 32px/88px -apple-system, sans-serif" 203 | textAlign: "center" 204 | boxShadow: "inset 0 0 0 2px #fff" 205 | 206 | buttton_clear.onClick -> 207 | colorInput.clear() 208 | setDefault(colorInput) 209 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.30.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Instance - file-image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | fileInput.on Events.FileData, (value, layer) -> 115 | @.parent.image = value 116 | @.parent.html = "" 117 | 118 | ################################################################################ 119 | # DEMO HELPER FUNCTIONS 120 | 121 | # Text Input Validation Functions 122 | 123 | setDefault = (input, value) -> 124 | check.states.switch "invalid" 125 | input.color = input.originalTextColor 126 | input.backgroundColor = "#f5f5f5" 127 | Screen.backgroundColor = "#808080" 128 | 129 | setValid = (input, value) -> 130 | check.states.switch "valid" 131 | input.color = input.originalTextColor 132 | input.backgroundColor = "#f5f5f5" 133 | Screen.backgroundColor = value 134 | 135 | setInvalid = (input, value) -> 136 | check.states.switch "invalid" 137 | input.backgroundColor = "#f5f5f5" 138 | Screen.backgroundColor = value 139 | Utils.delay 1.5, => 140 | unless input.isValid 141 | input.color = "red" unless input.isEmpty 142 | check.states.switch "invalid" 143 | Screen.backgroundColor = value 144 | 145 | ################################################################################ 146 | # DEMO HELPER CODE FOR CHECKMARK 147 | 148 | # Checkmark for Valid Answer 149 | 150 | check = new Layer 151 | width: 20 152 | height: 40 153 | rotation: 45 154 | backgroundColor: "" 155 | style: boxShadow: "inset -8px -8px 0 limeGreen" 156 | 157 | check.states.add 158 | valid: opacity: 1, scale: 1 159 | invalid: opacity: 0, scale: .25 160 | check.states.animationOptions = curve: "spring(1000,30,0)" 161 | check.states.switchInstant "invalid" 162 | check.center() 163 | 164 | check.bringToFront() 165 | check.props = 166 | midY: colorInput.midY - 8 167 | maxX: colorInput.maxX - 48 168 | 169 | ################################################################################ 170 | # DEMO FOR CLASS FUNCTIONS 171 | 172 | # Print button 173 | 174 | buttton_read = new Layer 175 | width: Screen.width/3 176 | height: 88 177 | y: 132 + (Screen.width/3)/3 178 | x: (Screen.width/3)/3 179 | borderRadius: 132/2 180 | backgroundColor: "rgba(0,0,0,.25)" 181 | html: "Print Value" 182 | style: 183 | font: "400 32px/88px -apple-system, sans-serif" 184 | textAlign: "center" 185 | boxShadow: "inset 0 0 0 2px #fff" 186 | 187 | buttton_read.onClick -> 188 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 189 | print colorInput.value 190 | 191 | # Clear button 192 | 193 | buttton_clear = new Layer 194 | width: Screen.width/3 195 | height: 88 196 | y: 132 + (Screen.width/3)/3 197 | maxX: Screen.width - (Screen.width/3)/3 198 | borderRadius: 132/2 199 | backgroundColor: "rgba(0,0,0,.25)" 200 | html: "Clear Value" 201 | style: 202 | font: "400 32px/88px -apple-system, sans-serif" 203 | textAlign: "center" 204 | boxShadow: "inset 0 0 0 2px #fff" 205 | 206 | buttton_clear.onClick -> 207 | colorInput.clear() 208 | setDefault(colorInput) 209 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.31.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Instance of file-image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | 115 | 116 | # InputField Instance of file-image - Events 117 | 118 | fileInput.on Events.FileData, (value, layer) -> 119 | @.parent.image = value 120 | @.parent.html = "" 121 | 122 | ################################################################################ 123 | # DEMO HELPER FUNCTIONS 124 | 125 | # Text Input Validation Functions 126 | 127 | setDefault = (input, value) -> 128 | check.states.switch "invalid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = "#808080" 132 | 133 | setValid = (input, value) -> 134 | check.states.switch "valid" 135 | input.color = input.originalTextColor 136 | input.backgroundColor = "#f5f5f5" 137 | Screen.backgroundColor = value 138 | 139 | setInvalid = (input, value) -> 140 | check.states.switch "invalid" 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | Utils.delay 1.5, => 144 | unless input.isValid 145 | input.color = "red" unless input.isEmpty 146 | check.states.switch "invalid" 147 | Screen.backgroundColor = value 148 | 149 | ################################################################################ 150 | # DEMO HELPER CODE FOR CHECKMARK 151 | 152 | # Checkmark for Valid Answer 153 | 154 | check = new Layer 155 | width: 20 156 | height: 40 157 | rotation: 45 158 | backgroundColor: "" 159 | style: boxShadow: "inset -8px -8px 0 limeGreen" 160 | 161 | check.states.add 162 | valid: opacity: 1, scale: 1 163 | invalid: opacity: 0, scale: .25 164 | check.states.animationOptions = curve: "spring(1000,30,0)" 165 | check.states.switchInstant "invalid" 166 | check.center() 167 | 168 | check.bringToFront() 169 | check.props = 170 | midY: colorInput.midY - 8 171 | maxX: colorInput.maxX - 48 172 | 173 | ################################################################################ 174 | # DEMO FOR CLASS FUNCTIONS 175 | 176 | # Print button 177 | 178 | buttton_read = new Layer 179 | width: Screen.width/3 180 | height: 88 181 | y: 132 + (Screen.width/3)/3 182 | x: (Screen.width/3)/3 183 | borderRadius: 132/2 184 | backgroundColor: "rgba(0,0,0,.25)" 185 | html: "Print Value" 186 | style: 187 | font: "400 32px/88px -apple-system, sans-serif" 188 | textAlign: "center" 189 | boxShadow: "inset 0 0 0 2px #fff" 190 | 191 | buttton_read.onClick -> 192 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 193 | print colorInput.value 194 | 195 | # Clear button 196 | 197 | buttton_clear = new Layer 198 | width: Screen.width/3 199 | height: 88 200 | y: 132 + (Screen.width/3)/3 201 | maxX: Screen.width - (Screen.width/3)/3 202 | borderRadius: 132/2 203 | backgroundColor: "rgba(0,0,0,.25)" 204 | html: "Clear Value" 205 | style: 206 | font: "400 32px/88px -apple-system, sans-serif" 207 | textAlign: "center" 208 | boxShadow: "inset 0 0 0 2px #fff" 209 | 210 | buttton_clear.onClick -> 211 | colorInput.clear() 212 | setDefault(colorInput) 213 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.32.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance - text 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance - text - Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Instance file-image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | 115 | 116 | # InputField Instance of file-image - Events 117 | 118 | fileInput.on Events.FileData, (value, layer) -> 119 | @.parent.image = value 120 | @.parent.html = "" 121 | 122 | ################################################################################ 123 | # DEMO HELPER FUNCTIONS 124 | 125 | # Text Input Validation Functions 126 | 127 | setDefault = (input, value) -> 128 | check.states.switch "invalid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = "#808080" 132 | 133 | setValid = (input, value) -> 134 | check.states.switch "valid" 135 | input.color = input.originalTextColor 136 | input.backgroundColor = "#f5f5f5" 137 | Screen.backgroundColor = value 138 | 139 | setInvalid = (input, value) -> 140 | check.states.switch "invalid" 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | Utils.delay 1.5, => 144 | unless input.isValid 145 | input.color = "red" unless input.isEmpty 146 | check.states.switch "invalid" 147 | Screen.backgroundColor = value 148 | 149 | ################################################################################ 150 | # DEMO HELPER CODE FOR CHECKMARK 151 | 152 | # Checkmark for Valid Answer 153 | 154 | check = new Layer 155 | width: 20 156 | height: 40 157 | rotation: 45 158 | backgroundColor: "" 159 | style: boxShadow: "inset -8px -8px 0 limeGreen" 160 | 161 | check.states.add 162 | valid: opacity: 1, scale: 1 163 | invalid: opacity: 0, scale: .25 164 | check.states.animationOptions = curve: "spring(1000,30,0)" 165 | check.states.switchInstant "invalid" 166 | check.center() 167 | 168 | check.bringToFront() 169 | check.props = 170 | midY: colorInput.midY - 8 171 | maxX: colorInput.maxX - 48 172 | 173 | ################################################################################ 174 | # DEMO FOR CLASS FUNCTIONS 175 | 176 | # Print button 177 | 178 | buttton_read = new Layer 179 | width: Screen.width/3 180 | height: 88 181 | y: 132 + (Screen.width/3)/3 182 | x: (Screen.width/3)/3 183 | borderRadius: 132/2 184 | backgroundColor: "rgba(0,0,0,.25)" 185 | html: "Print Value" 186 | style: 187 | font: "400 32px/88px -apple-system, sans-serif" 188 | textAlign: "center" 189 | boxShadow: "inset 0 0 0 2px #fff" 190 | 191 | buttton_read.onClick -> 192 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 193 | print colorInput.value 194 | 195 | # Clear button 196 | 197 | buttton_clear = new Layer 198 | width: Screen.width/3 199 | height: 88 200 | y: 132 + (Screen.width/3)/3 201 | maxX: Screen.width - (Screen.width/3)/3 202 | borderRadius: 132/2 203 | backgroundColor: "rgba(0,0,0,.25)" 204 | html: "Clear Value" 205 | style: 206 | font: "400 32px/88px -apple-system, sans-serif" 207 | textAlign: "center" 208 | boxShadow: "inset 0 0 0 2px #fff" 209 | 210 | buttton_clear.onClick -> 211 | colorInput.clear() 212 | setDefault(colorInput) 213 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.33.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORE the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance: text 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance: text - Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Instance: file-image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | 115 | 116 | # InputField Instance: file-image - Events 117 | 118 | fileInput.on Events.FileData, (value, layer) -> 119 | @.parent.image = value 120 | @.parent.html = "" 121 | 122 | ################################################################################ 123 | # DEMO HELPER FUNCTIONS 124 | 125 | # Text Input Validation Functions 126 | 127 | setDefault = (input, value) -> 128 | check.states.switch "invalid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = "#808080" 132 | 133 | setValid = (input, value) -> 134 | check.states.switch "valid" 135 | input.color = input.originalTextColor 136 | input.backgroundColor = "#f5f5f5" 137 | Screen.backgroundColor = value 138 | 139 | setInvalid = (input, value) -> 140 | check.states.switch "invalid" 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | Utils.delay 1.5, => 144 | unless input.isValid 145 | input.color = "red" unless input.isEmpty 146 | check.states.switch "invalid" 147 | Screen.backgroundColor = value 148 | 149 | ################################################################################ 150 | # DEMO HELPER CODE FOR CHECKMARK 151 | 152 | # Checkmark for Valid Answer 153 | 154 | check = new Layer 155 | width: 20 156 | height: 40 157 | rotation: 45 158 | backgroundColor: "" 159 | style: boxShadow: "inset -8px -8px 0 limeGreen" 160 | 161 | check.states.add 162 | valid: opacity: 1, scale: 1 163 | invalid: opacity: 0, scale: .25 164 | check.states.animationOptions = curve: "spring(1000,30,0)" 165 | check.states.switchInstant "invalid" 166 | check.center() 167 | 168 | check.bringToFront() 169 | check.props = 170 | midY: colorInput.midY - 8 171 | maxX: colorInput.maxX - 48 172 | 173 | ################################################################################ 174 | # DEMO FOR CLASS FUNCTIONS 175 | 176 | # Print button 177 | 178 | buttton_read = new Layer 179 | width: Screen.width/3 180 | height: 88 181 | y: 132 + (Screen.width/3)/3 182 | x: (Screen.width/3)/3 183 | borderRadius: 132/2 184 | backgroundColor: "rgba(0,0,0,.25)" 185 | html: "Print Value" 186 | style: 187 | font: "400 32px/88px -apple-system, sans-serif" 188 | textAlign: "center" 189 | boxShadow: "inset 0 0 0 2px #fff" 190 | 191 | buttton_read.onClick -> 192 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 193 | print colorInput.value 194 | 195 | # Clear button 196 | 197 | buttton_clear = new Layer 198 | width: Screen.width/3 199 | height: 88 200 | y: 132 + (Screen.width/3)/3 201 | maxX: Screen.width - (Screen.width/3)/3 202 | borderRadius: 132/2 203 | backgroundColor: "rgba(0,0,0,.25)" 204 | html: "Clear Value" 205 | style: 206 | font: "400 32px/88px -apple-system, sans-serif" 207 | textAlign: "center" 208 | boxShadow: "inset 0 0 0 2px #fff" 209 | 210 | buttton_clear.onClick -> 211 | colorInput.clear() 212 | setDefault(colorInput) 213 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.34.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. Ask 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "hello" for input type "number". 28 | # Find more patterns for Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance: text 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance: text - Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Instance: file-image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | 115 | 116 | # InputField Instance: file-image - Events 117 | 118 | fileInput.on Events.FileData, (value, layer) -> 119 | @.parent.image = value 120 | @.parent.html = "" 121 | 122 | ################################################################################ 123 | # DEMO HELPER FUNCTIONS 124 | 125 | # Text Input Validation Functions 126 | 127 | setDefault = (input, value) -> 128 | check.states.switch "invalid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = "#808080" 132 | 133 | setValid = (input, value) -> 134 | check.states.switch "valid" 135 | input.color = input.originalTextColor 136 | input.backgroundColor = "#f5f5f5" 137 | Screen.backgroundColor = value 138 | 139 | setInvalid = (input, value) -> 140 | check.states.switch "invalid" 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | Utils.delay 1.5, => 144 | unless input.isValid 145 | input.color = "red" unless input.isEmpty 146 | check.states.switch "invalid" 147 | Screen.backgroundColor = value 148 | 149 | ################################################################################ 150 | # DEMO HELPER CODE FOR CHECKMARK 151 | 152 | # Checkmark for Valid Answer 153 | 154 | check = new Layer 155 | width: 20 156 | height: 40 157 | rotation: 45 158 | backgroundColor: "" 159 | style: boxShadow: "inset -8px -8px 0 limeGreen" 160 | 161 | check.states.add 162 | valid: opacity: 1, scale: 1 163 | invalid: opacity: 0, scale: .25 164 | check.states.animationOptions = curve: "spring(1000,30,0)" 165 | check.states.switchInstant "invalid" 166 | check.center() 167 | 168 | check.bringToFront() 169 | check.props = 170 | midY: colorInput.midY - 8 171 | maxX: colorInput.maxX - 48 172 | 173 | ################################################################################ 174 | # DEMO FOR CLASS FUNCTIONS 175 | 176 | # Print button 177 | 178 | buttton_read = new Layer 179 | width: Screen.width/3 180 | height: 88 181 | y: 132 + (Screen.width/3)/3 182 | x: (Screen.width/3)/3 183 | borderRadius: 132/2 184 | backgroundColor: "rgba(0,0,0,.25)" 185 | html: "Print Value" 186 | style: 187 | font: "400 32px/88px -apple-system, sans-serif" 188 | textAlign: "center" 189 | boxShadow: "inset 0 0 0 2px #fff" 190 | 191 | buttton_read.onClick -> 192 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 193 | print colorInput.value 194 | 195 | # Clear button 196 | 197 | buttton_clear = new Layer 198 | width: Screen.width/3 199 | height: 88 200 | y: 132 + (Screen.width/3)/3 201 | maxX: Screen.width - (Screen.width/3)/3 202 | borderRadius: 132/2 203 | backgroundColor: "rgba(0,0,0,.25)" 204 | html: "Clear Value" 205 | style: 206 | font: "400 32px/88px -apple-system, sans-serif" 207 | textAlign: "center" 208 | boxShadow: "inset 0 0 0 2px #fff" 209 | 210 | buttton_clear.onClick -> 211 | colorInput.clear() 212 | setDefault(colorInput) 213 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.35.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | Screen.backgroundColor = "#808080" 8 | 9 | ################################################################################ 10 | # Build the text inputs 11 | # 12 | # Valid & Tested InputField Types: 13 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 14 | # "time", "month", "date", "datetime-local" 15 | # 16 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 17 | # 18 | # Here's a few examples to use for the value: property when you create them. 19 | # * time: "12:38" 20 | # * month: "2016-01" 21 | # * date: "2016-01-04" 22 | # * datetime-local: "2016-01-04T12:44:31.192" 23 | # 24 | # NOTES / 25 | # Some types work better than others on mobile or display differently than desktop. 26 | # All properties will work with input type "text" but may not work with other types. Ask for help if needed. 27 | # Some events won't fire if you enter incorrect content for the field type: i.e. "foo" for input type "number". 28 | # Find more patterns for the Valid and Invalid events at http://html5pattern.com 29 | # 30 | # TO DO - Textarea or Content Editable 31 | # 32 | ################################################################################ 33 | # SIMPLE EXAMPLE 34 | # myInput = new InputField 35 | # width: 300 36 | # height: 88 37 | # backgroundColor: "white" 38 | 39 | ################################################################################ 40 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 41 | 42 | # InputField Instance: text 43 | 44 | colorInput = new InputField 45 | name: "colorInput" 46 | type: "text" 47 | width: Screen.width 48 | height: 132 49 | y: 0 50 | color: "#696969" 51 | backgroundColor: "#f5f5f5" 52 | indent: 48 53 | fontSize: 48 54 | fontWeight: 600 55 | fontFamily: "Georgia, serif" 56 | placeHolder: "Enter Hexadecimal Color" 57 | placeHolderFocus: "#_ _ _ _ _ _" 58 | placeHolderColor: "silver" 59 | autoCapitalize: false 60 | autoComplete: false 61 | autoCorrect: false 62 | maxLength: 7 63 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 64 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 65 | value: "" 66 | # lineHeight: 30 67 | 68 | # InputField Instance: text - Events 69 | 70 | colorInput.on Events.Input, (value, layer) -> 71 | setDefault @ if @.isEmpty 72 | 73 | colorInput.on Events.Focus, (value, layer) -> 74 | @.color = @.originalTextColor 75 | 76 | colorInput.on Events.Blur, (value, layer) -> 77 | @.color = "limeGreen" if @.isValid 78 | 79 | colorInput.on Events.Valid, (value, layer) -> 80 | setValid @, value 81 | 82 | colorInput.on Events.Invalid, (value, layer) -> 83 | setInvalid @, value 84 | 85 | colorInput.on Events.Match, (value, layer) -> 86 | setDefault @, value 87 | @.animate properties: 88 | backgroundColor: value 89 | color: "#fff" 90 | Utils.delay 3, => 91 | @.animate properties: 92 | backgroundColor: "#f5f5f5" 93 | color: @.originalTextColor 94 | 95 | # InputField Instance: file-image 96 | 97 | imagePlaceholder = new Layer 98 | width: Screen.width 99 | height: Screen.height/2 100 | image: "" 101 | maxY: Screen.height 102 | backgroundColor: "black" 103 | html: "Add Image" 104 | style: 105 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 106 | textAlign: "center" 107 | 108 | fileInput = new InputField 109 | name: "fileInput" 110 | type: "file-image" 111 | width: Screen.width 112 | parent: imagePlaceholder 113 | 114 | 115 | 116 | # InputField Instance: file-image - Events 117 | 118 | fileInput.on Events.FileData, (value, layer) -> 119 | @.parent.image = value 120 | @.parent.html = "" 121 | 122 | ################################################################################ 123 | # DEMO HELPER FUNCTIONS 124 | 125 | # Text Input Validation Functions 126 | 127 | setDefault = (input, value) -> 128 | check.states.switch "invalid" 129 | input.color = input.originalTextColor 130 | input.backgroundColor = "#f5f5f5" 131 | Screen.backgroundColor = "#808080" 132 | 133 | setValid = (input, value) -> 134 | check.states.switch "valid" 135 | input.color = input.originalTextColor 136 | input.backgroundColor = "#f5f5f5" 137 | Screen.backgroundColor = value 138 | 139 | setInvalid = (input, value) -> 140 | check.states.switch "invalid" 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | Utils.delay 1.5, => 144 | unless input.isValid 145 | input.color = "red" unless input.isEmpty 146 | check.states.switch "invalid" 147 | Screen.backgroundColor = value 148 | 149 | ################################################################################ 150 | # DEMO HELPER CODE FOR CHECKMARK 151 | 152 | # Checkmark for Valid Answer 153 | 154 | check = new Layer 155 | width: 20 156 | height: 40 157 | rotation: 45 158 | backgroundColor: "" 159 | style: boxShadow: "inset -8px -8px 0 limeGreen" 160 | 161 | check.states.add 162 | valid: opacity: 1, scale: 1 163 | invalid: opacity: 0, scale: .25 164 | check.states.animationOptions = curve: "spring(1000,30,0)" 165 | check.states.switchInstant "invalid" 166 | check.center() 167 | 168 | check.bringToFront() 169 | check.props = 170 | midY: colorInput.midY - 8 171 | maxX: colorInput.maxX - 48 172 | 173 | ################################################################################ 174 | # DEMO FOR CLASS FUNCTIONS 175 | 176 | # Print button 177 | 178 | buttton_read = new Layer 179 | width: Screen.width/3 180 | height: 88 181 | y: 132 + (Screen.width/3)/3 182 | x: (Screen.width/3)/3 183 | borderRadius: 132/2 184 | backgroundColor: "rgba(0,0,0,.25)" 185 | html: "Print Value" 186 | style: 187 | font: "400 32px/88px -apple-system, sans-serif" 188 | textAlign: "center" 189 | boxShadow: "inset 0 0 0 2px #fff" 190 | 191 | buttton_read.onClick -> 192 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 193 | print colorInput.value 194 | 195 | # Clear button 196 | 197 | buttton_clear = new Layer 198 | width: Screen.width/3 199 | height: 88 200 | y: 132 + (Screen.width/3)/3 201 | maxX: Screen.width - (Screen.width/3)/3 202 | borderRadius: 132/2 203 | backgroundColor: "rgba(0,0,0,.25)" 204 | html: "Clear Value" 205 | style: 206 | font: "400 32px/88px -apple-system, sans-serif" 207 | textAlign: "center" 208 | boxShadow: "inset 0 0 0 2px #fff" 209 | 210 | buttton_clear.onClick -> 211 | colorInput.clear() 212 | setDefault(colorInput) 213 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.36.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | # TO DO - Textarea or Content Editable 8 | # TO DO - Post to Github 9 | 10 | ################################################################################ 11 | 12 | Screen.backgroundColor = "#808080" 13 | 14 | ################################################################################ 15 | # Build the text inputs 16 | # 17 | # Valid & Tested InputField Types: 18 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 19 | # "time", "month", "date", "datetime-local" 20 | # 21 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 22 | # 23 | # Here's a few examples to use for the value: property when you create them. 24 | # * time: "12:38" 25 | # * month: "2016-01" 26 | # * date: "2016-01-04" 27 | # * datetime-local: "2016-01-04T12:44:31.192" 28 | # 29 | # NOTES / 30 | # Some types work better than others on mobile or display differently than desktop. 31 | # All properties will work with input type "text" but may not work with other types. Ask for help if needed. 32 | # Some events won't fire if you enter incorrect content for the field type: i.e. "foo" for input type "number". 33 | # Find more patterns for the Valid and Invalid events at http://html5pattern.com 34 | # 35 | ################################################################################ 36 | # SIMPLE EXAMPLE 37 | # myInput = new InputField 38 | # width: 300 39 | # height: 88 40 | # backgroundColor: "white" 41 | 42 | ################################################################################ 43 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 44 | 45 | # InputField Instance: text 46 | 47 | colorInput = new InputField 48 | name: "colorInput" 49 | type: "text" 50 | width: Screen.width 51 | height: 132 52 | y: 0 53 | color: "#696969" 54 | backgroundColor: "#f5f5f5" 55 | indent: 48 56 | fontSize: 48 57 | fontWeight: 600 58 | fontFamily: "Georgia, serif" 59 | placeHolder: "Enter Hexadecimal Color" 60 | placeHolderFocus: "#_ _ _ _ _ _" 61 | placeHolderColor: "silver" 62 | autoCapitalize: false 63 | autoComplete: false 64 | autoCorrect: false 65 | maxLength: 7 66 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 67 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 68 | value: "" 69 | # lineHeight: 30 70 | 71 | # InputField Instance: text - Events 72 | 73 | colorInput.on Events.Input, (value, layer) -> 74 | setDefault @ if @.isEmpty 75 | 76 | colorInput.on Events.Focus, (value, layer) -> 77 | @.color = @.originalTextColor 78 | 79 | colorInput.on Events.Blur, (value, layer) -> 80 | @.color = "limeGreen" if @.isValid 81 | 82 | colorInput.on Events.Valid, (value, layer) -> 83 | setValid @, value 84 | 85 | colorInput.on Events.Invalid, (value, layer) -> 86 | setInvalid @, value 87 | 88 | colorInput.on Events.Match, (value, layer) -> 89 | setDefault @, value 90 | @.animate properties: 91 | backgroundColor: value 92 | color: "#fff" 93 | Utils.delay 3, => 94 | @.animate properties: 95 | backgroundColor: "#f5f5f5" 96 | color: @.originalTextColor 97 | 98 | # InputField Instance: file-image 99 | 100 | imagePlaceholder = new Layer 101 | width: Screen.width 102 | height: Screen.height/2 103 | image: "" 104 | maxY: Screen.height 105 | backgroundColor: "black" 106 | html: "Add Image" 107 | style: 108 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 109 | textAlign: "center" 110 | 111 | fileInput = new InputField 112 | name: "fileInput" 113 | type: "file-image" 114 | width: Screen.width 115 | parent: imagePlaceholder 116 | 117 | 118 | 119 | # InputField Instance: file-image - Events 120 | 121 | fileInput.on Events.FileData, (value, layer) -> 122 | @.parent.image = value 123 | @.parent.html = "" 124 | 125 | ################################################################################ 126 | # DEMO HELPER FUNCTIONS 127 | 128 | # Text Input Validation Functions 129 | 130 | setDefault = (input, value) -> 131 | check.states.switch "invalid" 132 | input.color = input.originalTextColor 133 | input.backgroundColor = "#f5f5f5" 134 | Screen.backgroundColor = "#808080" 135 | 136 | setValid = (input, value) -> 137 | check.states.switch "valid" 138 | input.color = input.originalTextColor 139 | input.backgroundColor = "#f5f5f5" 140 | Screen.backgroundColor = value 141 | 142 | setInvalid = (input, value) -> 143 | check.states.switch "invalid" 144 | input.backgroundColor = "#f5f5f5" 145 | Screen.backgroundColor = value 146 | Utils.delay 1.5, => 147 | unless input.isValid 148 | input.color = "red" unless input.isEmpty 149 | check.states.switch "invalid" 150 | Screen.backgroundColor = value 151 | 152 | ################################################################################ 153 | # DEMO HELPER CODE FOR CHECKMARK 154 | 155 | # Checkmark for Valid Answer 156 | 157 | check = new Layer 158 | width: 20 159 | height: 40 160 | rotation: 45 161 | backgroundColor: "" 162 | style: boxShadow: "inset -8px -8px 0 limeGreen" 163 | 164 | check.states.add 165 | valid: opacity: 1, scale: 1 166 | invalid: opacity: 0, scale: .25 167 | check.states.animationOptions = curve: "spring(1000,30,0)" 168 | check.states.switchInstant "invalid" 169 | check.center() 170 | 171 | check.bringToFront() 172 | check.props = 173 | midY: colorInput.midY - 8 174 | maxX: colorInput.maxX - 48 175 | 176 | ################################################################################ 177 | # DEMO FOR CLASS FUNCTIONS 178 | 179 | # Print button 180 | 181 | buttton_read = new Layer 182 | width: Screen.width/3 183 | height: 88 184 | y: 132 + (Screen.width/3)/3 185 | x: (Screen.width/3)/3 186 | borderRadius: 132/2 187 | backgroundColor: "rgba(0,0,0,.25)" 188 | html: "Print Value" 189 | style: 190 | font: "400 32px/88px -apple-system, sans-serif" 191 | textAlign: "center" 192 | boxShadow: "inset 0 0 0 2px #fff" 193 | 194 | buttton_read.onClick -> 195 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 196 | print colorInput.value 197 | 198 | # Clear button 199 | 200 | buttton_clear = new Layer 201 | width: Screen.width/3 202 | height: 88 203 | y: 132 + (Screen.width/3)/3 204 | maxX: Screen.width - (Screen.width/3)/3 205 | borderRadius: 132/2 206 | backgroundColor: "rgba(0,0,0,.25)" 207 | html: "Clear Value" 208 | style: 209 | font: "400 32px/88px -apple-system, sans-serif" 210 | textAlign: "center" 211 | boxShadow: "inset 0 0 0 2px #fff" 212 | 213 | buttton_clear.onClick -> 214 | colorInput.clear() 215 | setDefault(colorInput) 216 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.37.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | # TO DO - Textarea or Content Editable 8 | # TO DO - Post to Github 9 | 10 | ################################################################################ 11 | 12 | Screen.backgroundColor = "#808080" 13 | 14 | ################################################################################ 15 | # Build the text inputs 16 | # 17 | # Valid & Tested InputField Types: 18 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 19 | # "time", "month", "date", "datetime-local" 20 | # 21 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 22 | # 23 | # Here's a few examples to use for the value: property when you create them. 24 | # * time: "12:38" 25 | # * month: "2016-01" 26 | # * date: "2016-01-04" 27 | # * datetime-local: "2016-01-04T12:44:31.192" 28 | # 29 | # NOTES / 30 | # Some types work better than others on mobile or display differently than desktop. 31 | # All properties will work with input type "text" but may not work with other types. Ask for help if needed. 32 | # Some events won't fire if you enter incorrect content for the field type: i.e. "foo" for input type "number". 33 | # Find more patterns for the Valid and Invalid events at http://html5pattern.com 34 | # 35 | ################################################################################ 36 | # SIMPLE EXAMPLE 37 | # myInput = new InputField 38 | # width: 300 39 | # height: 88 40 | # backgroundColor: "white" 41 | # 42 | ################################################################################ 43 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 44 | 45 | # InputField Instance: text 46 | 47 | colorInput = new InputField 48 | name: "colorInput" 49 | type: "text" 50 | width: Screen.width 51 | height: 132 52 | y: 0 53 | color: "#696969" 54 | backgroundColor: "#f5f5f5" 55 | indent: 48 56 | fontSize: 48 57 | fontWeight: 600 58 | fontFamily: "Georgia, serif" 59 | placeHolder: "Enter Hexadecimal Color" 60 | placeHolderFocus: "#_ _ _ _ _ _" 61 | placeHolderColor: "silver" 62 | autoCapitalize: false 63 | autoComplete: false 64 | autoCorrect: false 65 | maxLength: 7 66 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 67 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 68 | value: "" 69 | # lineHeight: 30 70 | 71 | # InputField Instance: text - Events 72 | 73 | colorInput.on Events.Input, (value, layer) -> 74 | setDefault @ if @.isEmpty 75 | 76 | colorInput.on Events.Focus, (value, layer) -> 77 | @.color = @.originalTextColor 78 | 79 | colorInput.on Events.Blur, (value, layer) -> 80 | @.color = "limeGreen" if @.isValid 81 | 82 | colorInput.on Events.Valid, (value, layer) -> 83 | setValid @, value 84 | 85 | colorInput.on Events.Invalid, (value, layer) -> 86 | setInvalid @, value 87 | 88 | colorInput.on Events.Match, (value, layer) -> 89 | setDefault @, value 90 | @.animate properties: 91 | backgroundColor: value 92 | color: "#fff" 93 | Utils.delay 3, => 94 | @.animate properties: 95 | backgroundColor: "#f5f5f5" 96 | color: @.originalTextColor 97 | 98 | # InputField Instance: file-image 99 | 100 | imagePlaceholder = new Layer 101 | width: Screen.width 102 | height: Screen.height/2 103 | image: "" 104 | maxY: Screen.height 105 | backgroundColor: "black" 106 | html: "Add Image" 107 | style: 108 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 109 | textAlign: "center" 110 | 111 | fileInput = new InputField 112 | name: "fileInput" 113 | type: "file-image" 114 | width: Screen.width 115 | parent: imagePlaceholder 116 | 117 | 118 | 119 | # InputField Instance: file-image - Events 120 | 121 | fileInput.on Events.FileData, (value, layer) -> 122 | @.parent.image = value 123 | @.parent.html = "" 124 | 125 | ################################################################################ 126 | # DEMO HELPER FUNCTIONS 127 | 128 | # Text Input Validation Functions 129 | 130 | setDefault = (input, value) -> 131 | check.states.switch "invalid" 132 | input.color = input.originalTextColor 133 | input.backgroundColor = "#f5f5f5" 134 | Screen.backgroundColor = "#808080" 135 | 136 | setValid = (input, value) -> 137 | check.states.switch "valid" 138 | input.color = input.originalTextColor 139 | input.backgroundColor = "#f5f5f5" 140 | Screen.backgroundColor = value 141 | 142 | setInvalid = (input, value) -> 143 | check.states.switch "invalid" 144 | input.backgroundColor = "#f5f5f5" 145 | Screen.backgroundColor = value 146 | Utils.delay 1.5, => 147 | unless input.isValid 148 | input.color = "red" unless input.isEmpty 149 | check.states.switch "invalid" 150 | Screen.backgroundColor = value 151 | 152 | ################################################################################ 153 | # DEMO HELPER CODE FOR CHECKMARK 154 | 155 | # Checkmark for Valid Answer 156 | 157 | check = new Layer 158 | width: 20 159 | height: 40 160 | rotation: 45 161 | backgroundColor: "" 162 | style: boxShadow: "inset -8px -8px 0 limeGreen" 163 | 164 | check.states.add 165 | valid: opacity: 1, scale: 1 166 | invalid: opacity: 0, scale: .25 167 | check.states.animationOptions = curve: "spring(1000,30,0)" 168 | check.states.switchInstant "invalid" 169 | check.center() 170 | 171 | check.bringToFront() 172 | check.props = 173 | midY: colorInput.midY - 8 174 | maxX: colorInput.maxX - 48 175 | 176 | ################################################################################ 177 | # DEMO FOR CLASS FUNCTIONS 178 | 179 | # Print button 180 | 181 | buttton_read = new Layer 182 | width: Screen.width/3 183 | height: 88 184 | y: 132 + (Screen.width/3)/3 185 | x: (Screen.width/3)/3 186 | borderRadius: 132/2 187 | backgroundColor: "rgba(0,0,0,.25)" 188 | html: "Print Value" 189 | style: 190 | font: "400 32px/88px -apple-system, sans-serif" 191 | textAlign: "center" 192 | boxShadow: "inset 0 0 0 2px #fff" 193 | 194 | buttton_read.onClick -> 195 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 196 | print colorInput.value 197 | 198 | # Clear button 199 | 200 | buttton_clear = new Layer 201 | width: Screen.width/3 202 | height: 88 203 | y: 132 + (Screen.width/3)/3 204 | maxX: Screen.width - (Screen.width/3)/3 205 | borderRadius: 132/2 206 | backgroundColor: "rgba(0,0,0,.25)" 207 | html: "Clear Value" 208 | style: 209 | font: "400 32px/88px -apple-system, sans-serif" 210 | textAlign: "center" 211 | boxShadow: "inset 0 0 0 2px #fff" 212 | 213 | buttton_clear.onClick -> 214 | colorInput.clear() 215 | setDefault(colorInput) 216 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 16.56.39.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | # TO DO - Textarea or Content Editable 8 | # TO DO - Post to Github 9 | 10 | ################################################################################ 11 | 12 | Screen.backgroundColor = "#808080" 13 | 14 | ################################################################################ 15 | # Build the text inputs 16 | # 17 | # Valid & Tested InputField Types: 18 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 19 | # "time", "month", "date", "datetime-local" 20 | # 21 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 22 | # 23 | # Here's a few examples to use for the value: property when you create them. 24 | # * time: "12:38" 25 | # * month: "2016-01" 26 | # * date: "2016-01-04" 27 | # * datetime-local: "2016-01-04T12:44:31.192" 28 | # 29 | # NOTES / 30 | # Some types work better than others on mobile or display differently than desktop. 31 | # All properties will work with input type "text" but may not work with other types. Ask for help if needed. 32 | # Some events won't fire if you enter incorrect content for the field type: i.e. "foo" for input type "number". 33 | # Find more patterns for the Valid and Invalid events at http://html5pattern.com 34 | # 35 | ################################################################################ 36 | # SIMPLE EXAMPLE 37 | # myInput = new InputField 38 | # width: 300 39 | # height: 88 40 | # backgroundColor: "white" 41 | # 42 | ################################################################################ 43 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 44 | 45 | # InputField Instance: text 46 | 47 | colorInput = new InputField 48 | name: "colorInput" 49 | type: "text" 50 | width: Screen.width 51 | height: 132 52 | y: 0 53 | color: "#696969" 54 | backgroundColor: "#f5f5f5" 55 | indent: 48 56 | fontSize: 48 57 | fontWeight: 600 58 | fontFamily: "Georgia, serif" 59 | placeHolder: "Enter Hexadecimal Color" 60 | placeHolderFocus: "#_ _ _ _ _ _" 61 | placeHolderColor: "silver" 62 | autoCapitalize: false 63 | autoComplete: false 64 | autoCorrect: false 65 | maxLength: 7 66 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 67 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 68 | value: "" 69 | # lineHeight: 30 70 | 71 | # InputField Instance: text - Events 72 | 73 | colorInput.on Events.Input, (value, layer) -> 74 | setDefault @ if @.isEmpty 75 | 76 | colorInput.on Events.Focus, (value, layer) -> 77 | @.color = @.originalTextColor 78 | 79 | colorInput.on Events.Blur, (value, layer) -> 80 | @.color = "limeGreen" if @.isValid 81 | 82 | colorInput.on Events.Valid, (value, layer) -> 83 | setValid @, value 84 | 85 | colorInput.on Events.Invalid, (value, layer) -> 86 | setInvalid @, value 87 | 88 | colorInput.on Events.Match, (value, layer) -> 89 | setDefault @, value 90 | @.animate properties: 91 | backgroundColor: value 92 | color: "#fff" 93 | Utils.delay 3, => 94 | @.animate properties: 95 | backgroundColor: "#f5f5f5" 96 | color: @.originalTextColor 97 | 98 | ################################################################################ 99 | 100 | # InputField Instance: file-image 101 | 102 | imagePlaceholder = new Layer 103 | width: Screen.width 104 | height: Screen.height/2 105 | image: "" 106 | maxY: Screen.height 107 | backgroundColor: "black" 108 | html: "Add Image" 109 | style: 110 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 111 | textAlign: "center" 112 | 113 | fileInput = new InputField 114 | name: "fileInput" 115 | type: "file-image" 116 | width: Screen.width 117 | parent: imagePlaceholder 118 | 119 | 120 | 121 | # InputField Instance: file-image - Events 122 | 123 | fileInput.on Events.FileData, (value, layer) -> 124 | @.parent.image = value 125 | @.parent.html = "" 126 | 127 | ################################################################################ 128 | # DEMO HELPER FUNCTIONS 129 | 130 | # Text Input Validation Functions 131 | 132 | setDefault = (input, value) -> 133 | check.states.switch "invalid" 134 | input.color = input.originalTextColor 135 | input.backgroundColor = "#f5f5f5" 136 | Screen.backgroundColor = "#808080" 137 | 138 | setValid = (input, value) -> 139 | check.states.switch "valid" 140 | input.color = input.originalTextColor 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | 144 | setInvalid = (input, value) -> 145 | check.states.switch "invalid" 146 | input.backgroundColor = "#f5f5f5" 147 | Screen.backgroundColor = value 148 | Utils.delay 1.5, => 149 | unless input.isValid 150 | input.color = "red" unless input.isEmpty 151 | check.states.switch "invalid" 152 | Screen.backgroundColor = value 153 | 154 | ################################################################################ 155 | # DEMO HELPER CODE FOR CHECKMARK 156 | 157 | # Checkmark for Valid Answer 158 | 159 | check = new Layer 160 | width: 20 161 | height: 40 162 | rotation: 45 163 | backgroundColor: "" 164 | style: boxShadow: "inset -8px -8px 0 limeGreen" 165 | 166 | check.states.add 167 | valid: opacity: 1, scale: 1 168 | invalid: opacity: 0, scale: .25 169 | check.states.animationOptions = curve: "spring(1000,30,0)" 170 | check.states.switchInstant "invalid" 171 | check.center() 172 | 173 | check.bringToFront() 174 | check.props = 175 | midY: colorInput.midY - 8 176 | maxX: colorInput.maxX - 48 177 | 178 | ################################################################################ 179 | # DEMO FOR CLASS FUNCTIONS 180 | 181 | # Print button 182 | 183 | buttton_read = new Layer 184 | width: Screen.width/3 185 | height: 88 186 | y: 132 + (Screen.width/3)/3 187 | x: (Screen.width/3)/3 188 | borderRadius: 132/2 189 | backgroundColor: "rgba(0,0,0,.25)" 190 | html: "Print Value" 191 | style: 192 | font: "400 32px/88px -apple-system, sans-serif" 193 | textAlign: "center" 194 | boxShadow: "inset 0 0 0 2px #fff" 195 | 196 | buttton_read.onClick -> 197 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 198 | print colorInput.value 199 | 200 | # Clear button 201 | 202 | buttton_clear = new Layer 203 | width: Screen.width/3 204 | height: 88 205 | y: 132 + (Screen.width/3)/3 206 | maxX: Screen.width - (Screen.width/3)/3 207 | borderRadius: 132/2 208 | backgroundColor: "rgba(0,0,0,.25)" 209 | html: "Clear Value" 210 | style: 211 | font: "400 32px/88px -apple-system, sans-serif" 212 | textAlign: "center" 213 | boxShadow: "inset 0 0 0 2px #fff" 214 | 215 | buttton_clear.onClick -> 216 | colorInput.clear() 217 | setDefault(colorInput) 218 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/backups/backup-2016-06-23 17.03.13.coffee: -------------------------------------------------------------------------------- 1 | {InputField} = require 'InputField' 2 | 3 | ################################################################################ 4 | # Updated 04 APR 2016 by Jordan Robert Dobson / @jordandobson / JordanDobson.com 5 | ################################################################################ 6 | 7 | # TO DO - Textarea or Content Editable 8 | # TO DO - Post to Github 9 | 10 | ################################################################################ 11 | 12 | Screen.backgroundColor = "#808080" 13 | 14 | ################################################################################ 15 | # Build the text inputs 16 | # 17 | # Valid & Tested InputField Types: 18 | # "text", "email", "number", "number-only", "url", "tel", "password", "search", file, file-multiple, file-image, file-video 19 | # "time", "month", "date", "datetime-local" 20 | # 21 | # The time & date types REQUIRE the value property is in a correct format & IGNORES the placeholder property. 22 | # 23 | # Here's a few examples to use for the value: property when you create them. 24 | # * time: "12:38" 25 | # * month: "2016-01" 26 | # * date: "2016-01-04" 27 | # * datetime-local: "2016-01-04T12:44:31.192" 28 | # 29 | # NOTES / 30 | # Some types work better than others on mobile or display differently than desktop. 31 | # All properties will work with input type "text" but may not work with other types. Ask for help if needed. 32 | # Some events won't fire if you enter incorrect content for the field type: i.e. "foo" for input type "number". 33 | # Find more patterns for the Valid and Invalid events at http://html5pattern.com 34 | # 35 | ################################################################################ 36 | # SIMPLE EXAMPLE 37 | # myInput = new InputField 38 | # width: 300 39 | # height: 88 40 | # backgroundColor: "white" 41 | # 42 | ################################################################################ 43 | # ADVANCED EXAMPLE WITH EVENTS & ALL SUPPORTED PROPERTIES 44 | 45 | # InputField Instance: text 46 | 47 | colorInput = new InputField 48 | name: "colorInput" 49 | type: "text" 50 | width: Screen.width 51 | height: 132 52 | y: 0 53 | color: "#696969" 54 | backgroundColor: "#f5f5f5" 55 | indent: 48 56 | fontSize: 48 57 | fontWeight: 600 58 | fontFamily: "Georgia, serif" 59 | placeHolder: "Enter Hexadecimal Color" 60 | placeHolderFocus: "#_ _ _ _ _ _" 61 | placeHolderColor: "silver" 62 | autoCapitalize: false 63 | autoComplete: false 64 | autoCorrect: false 65 | maxLength: 7 66 | pattern: "^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$" 67 | match: ["orange", "Orange", "red", "Red", "blue", "Blue"] 68 | value: "" 69 | # lineHeight: 30 70 | 71 | # InputField Instance: text - Events 72 | 73 | colorInput.on Events.Input, (value, layer) -> 74 | setDefault @ if @.isEmpty 75 | 76 | colorInput.on Events.Focus, (value, layer) -> 77 | @.color = @.originalTextColor 78 | 79 | colorInput.on Events.Blur, (value, layer) -> 80 | @.color = "limeGreen" if @.isValid 81 | 82 | colorInput.on Events.Valid, (value, layer) -> 83 | setValid @, value 84 | 85 | colorInput.on Events.Invalid, (value, layer) -> 86 | setInvalid @, value 87 | 88 | colorInput.on Events.Match, (value, layer) -> 89 | setDefault @, value 90 | @.animate properties: 91 | backgroundColor: value 92 | color: "#fff" 93 | Utils.delay 3, => 94 | @.animate properties: 95 | backgroundColor: "#f5f5f5" 96 | color: @.originalTextColor 97 | 98 | ################################################################################ 99 | 100 | # InputField Instance: file-image 101 | 102 | imagePlaceholder = new Layer 103 | width: Screen.width 104 | height: Screen.height/2 105 | image: "" 106 | maxY: Screen.height 107 | backgroundColor: "black" 108 | html: "Add Image" 109 | style: 110 | font: "200 2em/#{Screen.height/2}px -apple-system, Roboto, helvetica, sans-serif" 111 | textAlign: "center" 112 | 113 | fileInput = new InputField 114 | name: "fileInput" 115 | type: "file-image" 116 | width: Screen.width 117 | parent: imagePlaceholder 118 | 119 | 120 | 121 | # InputField Instance: file-image - Events 122 | 123 | fileInput.on Events.FileData, (value, layer) -> 124 | @.parent.image = value 125 | @.parent.html = "" 126 | 127 | ################################################################################ 128 | # DEMO HELPER FUNCTIONS 129 | 130 | # Text Input Validation Functions 131 | 132 | setDefault = (input, value) -> 133 | check.states.switch "invalid" 134 | input.color = input.originalTextColor 135 | input.backgroundColor = "#f5f5f5" 136 | Screen.backgroundColor = "#808080" 137 | 138 | setValid = (input, value) -> 139 | check.states.switch "valid" 140 | input.color = input.originalTextColor 141 | input.backgroundColor = "#f5f5f5" 142 | Screen.backgroundColor = value 143 | 144 | setInvalid = (input, value) -> 145 | check.states.switch "invalid" 146 | input.backgroundColor = "#f5f5f5" 147 | Screen.backgroundColor = value 148 | Utils.delay 1.5, => 149 | unless input.isValid 150 | input.color = "red" unless input.isEmpty 151 | check.states.switch "invalid" 152 | Screen.backgroundColor = value 153 | 154 | ################################################################################ 155 | # DEMO HELPER CODE FOR CHECKMARK 156 | 157 | # Checkmark for Valid Answer 158 | 159 | check = new Layer 160 | width: 20 161 | height: 40 162 | rotation: 45 163 | backgroundColor: "" 164 | style: boxShadow: "inset -8px -8px 0 limeGreen" 165 | 166 | check.states.add 167 | valid: opacity: 1, scale: 1 168 | invalid: opacity: 0, scale: .25 169 | check.states.animationOptions = curve: "spring(1000,30,0)" 170 | check.states.switchInstant "invalid" 171 | check.center() 172 | 173 | check.bringToFront() 174 | check.props = 175 | midY: colorInput.midY - 8 176 | maxX: colorInput.maxX - 48 177 | 178 | ################################################################################ 179 | # DEMO FOR CLASS FUNCTIONS 180 | 181 | # Print button 182 | 183 | buttton_read = new Layer 184 | width: Screen.width/3 185 | height: 88 186 | y: 132 + (Screen.width/3)/3 187 | x: (Screen.width/3)/3 188 | borderRadius: 132/2 189 | backgroundColor: "rgba(0,0,0,.25)" 190 | html: "Print Value" 191 | style: 192 | font: "400 32px/88px -apple-system, sans-serif" 193 | textAlign: "center" 194 | boxShadow: "inset 0 0 0 2px #fff" 195 | 196 | buttton_read.onClick -> 197 | print if colorInput.checkMatch() then "Match Found" else "No Match Found" 198 | print colorInput.value 199 | 200 | # Clear button 201 | 202 | buttton_clear = new Layer 203 | width: Screen.width/3 204 | height: 88 205 | y: 132 + (Screen.width/3)/3 206 | maxX: Screen.width - (Screen.width/3)/3 207 | borderRadius: 132/2 208 | backgroundColor: "rgba(0,0,0,.25)" 209 | html: "Clear Value" 210 | style: 211 | font: "400 32px/88px -apple-system, sans-serif" 212 | textAlign: "center" 213 | boxShadow: "inset 0 0 0 2px #fff" 214 | 215 | buttton_clear.onClick -> 216 | colorInput.clear() 217 | setDefault(colorInput) 218 | -------------------------------------------------------------------------------- /InputField-example.framer/framer/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "propertyPanelToggleStates" : { 3 | 4 | }, 5 | "deviceOrientation" : 0, 6 | "sharedPrototype" : 1, 7 | "contentScale" : 1, 8 | "deviceType" : "apple-iphone-6s-silver", 9 | "selectedHand" : "", 10 | "updateDelay" : 0.3, 11 | "deviceScale" : "fit", 12 | "foldedCodeRanges" : [ 13 | "{1813, 569}", 14 | "{2383, 646}", 15 | "{3112, 423}", 16 | "{3536, 136}", 17 | "{3782, 661}", 18 | "{4559, 438}", 19 | "{5108, 449}", 20 | "{5560, 415}" 21 | ], 22 | "orientation" : 0, 23 | "fullScreen" : false 24 | } -------------------------------------------------------------------------------- /InputField-example.framer/framer/framer.generated.js: -------------------------------------------------------------------------------- 1 | // This is autogenerated by Framer 2 | 3 | 4 | if (!window.Framer && window._bridge) {window._bridge('runtime.error', {message:'[framer.js] Framer library missing or corrupt. Select File → Update Framer Library.'})} 5 | if (DeviceComponent) {DeviceComponent.Devices["iphone-6-silver"].deviceImageJP2 = false}; 6 | if (window.Framer) {window.Framer.Defaults.DeviceView = {"deviceScale":"fit","selectedHand":"","deviceType":"apple-iphone-6s-silver","contentScale":1,"orientation":0}; 7 | } 8 | if (window.Framer) {window.Framer.Defaults.DeviceComponent = {"deviceScale":"fit","selectedHand":"","deviceType":"apple-iphone-6s-silver","contentScale":1,"orientation":0}; 9 | } 10 | window.FramerStudioInfo = {"deviceImagesUrl":"\/_server\/resources\/DeviceImages","documentTitle":"InputField-example.framer"}; 11 | 12 | Framer.Device = new Framer.DeviceView(); 13 | Framer.Device.setupContext(); -------------------------------------------------------------------------------- /InputField-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 += "Tap
, then choose 'Add to Home Screen' " 76 | html += "