├── README.md ├── css ├── component.css ├── demo.css └── normalize.css ├── fonts ├── codropsicons │ ├── codropsicons.eot │ ├── codropsicons.svg │ ├── codropsicons.ttf │ ├── codropsicons.woff │ └── license.txt └── icomoon │ ├── icomoon.eot │ ├── icomoon.svg │ ├── icomoon.ttf │ └── icomoon.woff ├── index.html └── js ├── classie.js ├── modernizr.custom.js └── stepsForm.js /README.md: -------------------------------------------------------------------------------- 1 | Minimal Form Interface 2 | ========= 3 | 4 | A simplistic form with inputs shown one at a time. Inspired by the form seen on the end of the [PageLanes website](http://www.pagelanes.com/). 5 | 6 | [Article on Codrops](http://tympanus.net/codrops/?p=18780) 7 | 8 | [Demo](http://tympanus.net/Development/MinimalForm/) 9 | 10 | Integrate or build upon it for free in your personal or commercial projects. Don't republish, redistribute or sell "as-is". 11 | 12 | Read more here: [License](http://tympanus.net/codrops/licensing/) 13 | 14 | [© Codrops 2013](http://www.codrops.com) -------------------------------------------------------------------------------- /css/component.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-weight: normal; 3 | font-style: normal; 4 | font-family: 'icomoon'; 5 | src:url('../fonts/icomoon/icomoon.eot?-9heso'); 6 | src:url('../fonts/icomoon/icomoon.eot?#iefix-9heso') format('embedded-opentype'), 7 | url('../fonts/icomoon/icomoon.woff?-9heso') format('woff'), 8 | url('../fonts/icomoon/icomoon.ttf?-9heso') format('truetype'), 9 | url('../fonts/icomoon/icomoon.svg?-9heso#icomoon') format('svg'); 10 | } 11 | 12 | .simform { 13 | position: relative; 14 | margin: 0 auto; 15 | padding: 2em 0; 16 | max-width: 860px; 17 | width: 100%; 18 | text-align: left; 19 | font-size: 2.5em; 20 | } 21 | 22 | .simform .submit { 23 | display: none; 24 | } 25 | 26 | /* Question list style */ 27 | .simform ol { 28 | margin: 0; 29 | padding: 0; 30 | list-style: none; 31 | position: relative; 32 | -webkit-transition: height 0.4s; 33 | transition: height 0.4s; 34 | } 35 | 36 | .simform ol:before { 37 | content: ''; 38 | background-color: rgba(0,0,0,0.1); 39 | position: absolute; 40 | left: 0; 41 | bottom: 0; 42 | width: 100%; 43 | height: 2.35em; 44 | } 45 | 46 | .questions li { 47 | z-index: 100; 48 | position: relative; 49 | visibility: hidden; 50 | height: 0; 51 | -webkit-transition: visibility 0s 0.4s, height 0s 0.4s; 52 | transition: visibility 0s 0.4s, height 0s 0.4s; 53 | } 54 | 55 | .questions li.current, 56 | .no-js .questions li { 57 | visibility: visible; 58 | height: auto; 59 | -webkit-transition: none; 60 | transition: none; 61 | } 62 | 63 | /* Labels */ 64 | .questions li > span { 65 | display: block; 66 | overflow: hidden; 67 | } 68 | 69 | .questions li > span label { 70 | display: block; 71 | -webkit-transition: -webkit-transform 0.4s; 72 | transition: transform 0.4s; 73 | -webkit-transform: translateY(-100%); 74 | transform: translateY(-100%); 75 | } 76 | 77 | .questions li.current > span label, 78 | .no-js .questions li > span label { 79 | -webkit-transition: none; 80 | transition: none; 81 | -webkit-transform: translateY(0); 82 | transform: translateY(0); 83 | } 84 | 85 | .show-next .questions li.current > span label { 86 | -webkit-animation: moveUpFromDown 0.4s both; 87 | animation: moveUpFromDown 0.4s both; 88 | } 89 | 90 | @-webkit-keyframes moveUpFromDown { 91 | from { -webkit-transform: translateY(100%); } 92 | to { -webkit-transform: translateY(0); } 93 | } 94 | 95 | @keyframes moveUpFromDown { 96 | from { -webkit-transform: translateY(100%); transform: translateY(100%); } 97 | to { -webkit-transform: translateY(0); transform: translateY(0); } 98 | } 99 | 100 | /* Input field */ 101 | .questions input { 102 | display: block; 103 | margin: 0.3em 0 0 0; 104 | padding: 0.2em 1em 0.5em 0.7em; 105 | width: calc(100% - 2em); 106 | border: none; 107 | background: transparent; 108 | color: rgba(0,0,0,0.8); 109 | font-size: 1em; 110 | line-height: 1; 111 | opacity: 0; 112 | -webkit-transition: opacity 0.3s; 113 | transition: opacity 0.3s; 114 | height: 2.1em; 115 | } 116 | 117 | .questions .current input, 118 | .no-js .questions input { 119 | opacity: 1; 120 | } 121 | 122 | .questions input:focus, 123 | .simform button:focus { 124 | outline: none; 125 | } 126 | 127 | /* Next question button */ 128 | .next { 129 | position: absolute; 130 | right: 0; 131 | bottom: 2.15em; /* padding-bottom of form plus progress bar height */ 132 | display: block; 133 | padding: 0; 134 | width: 2em; 135 | height: 2em; 136 | border: none; 137 | background: none; 138 | color: rgba(0,0,0,0.4); 139 | text-align: center; 140 | opacity: 0; 141 | z-index: 100; 142 | cursor: pointer; 143 | -webkit-transition: -webkit-transform 0.3s, opacity 0.3s; 144 | transition: transform 0.3s, opacity 0.3s; 145 | -webkit-transform: translateX(-20%); 146 | transform: translateX(-20%); 147 | pointer-events: none; 148 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 149 | } 150 | 151 | .next:hover { 152 | color: rgba(0,0,0,0.5); 153 | } 154 | 155 | .next::after { 156 | position: absolute; 157 | top: 0; 158 | left: 0; 159 | width: 100%; 160 | height: 100%; 161 | content: "\e600"; 162 | text-transform: none; 163 | font-weight: normal; 164 | font-style: normal; 165 | font-variant: normal; 166 | font-family: 'icomoon'; 167 | line-height: 2; 168 | speak: none; 169 | -webkit-font-smoothing: antialiased; 170 | -moz-osx-font-smoothing: grayscale; 171 | } 172 | 173 | .next.show { 174 | opacity: 1; 175 | -webkit-transform: translateX(0); 176 | transform: translateX(0); 177 | pointer-events: auto; 178 | } 179 | 180 | /* Progress bar */ 181 | .simform .progress { 182 | width: 0%; 183 | height: 0.15em; 184 | background: rgba(0,0,0,0.3); 185 | -webkit-transition: width 0.4s ease-in-out; 186 | transition: width 0.4s ease-in-out; 187 | } 188 | 189 | .simform .progress::before { 190 | position: absolute; 191 | top: auto; 192 | width: 100%; 193 | height: inherit; 194 | background: rgba(0,0,0,0.05); 195 | content: ''; 196 | } 197 | 198 | /* Number indicator */ 199 | .simform .number { 200 | position: absolute; 201 | right: 0; 202 | overflow: hidden; 203 | margin: 0.4em 0; 204 | width: 3em; 205 | font-weight: 700; 206 | font-size: 0.4em; 207 | } 208 | 209 | .simform .number:after { 210 | position: absolute; 211 | left: 50%; 212 | content: '/'; 213 | opacity: 0.4; 214 | -webkit-transform: translateX(-50%); 215 | transform: translateX(-50%); 216 | } 217 | 218 | .simform .number span { 219 | float: right; 220 | width: 40%; 221 | text-align: center; 222 | } 223 | 224 | .simform .number .number-current { 225 | float: left; 226 | } 227 | 228 | .simform .number-next { 229 | position: absolute; 230 | left: 0; 231 | } 232 | 233 | .simform.show-next .number-current { 234 | -webkit-transition: -webkit-transform 0.4s; 235 | transition: transform 0.4s; 236 | -webkit-transform: translateY(-100%); 237 | transform: translateY(-100%); 238 | } 239 | 240 | .simform.show-next .number-next { 241 | -webkit-animation: moveUpFromDown 0.4s both; 242 | animation: moveUpFromDown 0.4s both; 243 | } 244 | 245 | /* Error and final message */ 246 | .simform .error-message, 247 | .simform .final-message { 248 | position: absolute; 249 | visibility: hidden; 250 | opacity: 0; 251 | -webkit-transition: opacity 0.4s; 252 | transition: opacity 0.4s; 253 | } 254 | 255 | .simform .error-message { 256 | padding: 0.4em 3.5em 0 0; 257 | width: 100%; 258 | color: rgba(0,0,0,0.7); 259 | font-style: italic; 260 | font-size: 0.4em; 261 | } 262 | 263 | .final-message { 264 | top: 50%; 265 | left: 0; 266 | padding: 0.5em; 267 | width: 100%; 268 | text-align: center; 269 | -webkit-transform: translateY(-50%); 270 | transform: translateY(-50%); 271 | } 272 | 273 | .error-message.show, 274 | .final-message.show { 275 | visibility: visible; 276 | opacity: 1; 277 | } 278 | 279 | .final-message.show { 280 | -webkit-transition-delay: 0.5s; 281 | transition-delay: 0.5s; 282 | } 283 | 284 | /* Final hiding of form / showing message */ 285 | .simform-inner.hide { 286 | visibility: hidden; 287 | opacity: 0; 288 | -webkit-transition: opacity 0.3s, visibility 0s 0.3s; 289 | transition: opacity 0.3s, visibility 0s 0.3s; 290 | } 291 | 292 | /* No JS Fallback */ 293 | .no-js .simform { 294 | font-size: 1.75em; 295 | } 296 | 297 | .no-js .questions li { 298 | padding: 0 0 2em; 299 | } 300 | 301 | .no-js .simform .submit { 302 | display: block; 303 | float: right; 304 | padding: 10px 20px; 305 | border: none; 306 | background: rgba(0,0,0,0.3); 307 | color: rgba(0,0,0,0.4); 308 | } 309 | 310 | .no-js .simform .controls { 311 | display: none; 312 | } 313 | 314 | /* Remove IE clear cross */ 315 | input[type=text]::-ms-clear { 316 | display: none; 317 | } 318 | 319 | /* Adjust form for smaller screens */ 320 | @media screen and (max-width: 44.75em) { 321 | .simform { 322 | font-size: 1.8em; 323 | } 324 | } 325 | 326 | @media screen and (max-width: 33.5625em) { 327 | .simform { 328 | font-size: 1.2em; 329 | } 330 | } -------------------------------------------------------------------------------- /css/demo.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic); 2 | @font-face { 3 | font-weight: normal; 4 | font-style: normal; 5 | font-family: 'codropsicons'; 6 | src:url('../fonts/codropsicons/codropsicons.eot'); 7 | src:url('../fonts/codropsicons/codropsicons.eot?#iefix') format('embedded-opentype'), 8 | url('../fonts/codropsicons/codropsicons.woff') format('woff'), 9 | url('../fonts/codropsicons/codropsicons.ttf') format('truetype'), 10 | url('../fonts/codropsicons/codropsicons.svg#codropsicons') format('svg'); 11 | } 12 | 13 | *, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } 14 | .clearfix:before, .clearfix:after { content: ''; display: table; } 15 | .clearfix:after { clear: both; } 16 | 17 | body { 18 | background: #26C281; 19 | color: rgba(0,0,0,0.45); 20 | font-size: 100%; 21 | line-height: 1.25; 22 | font-family: 'Lato', Arial, sans-serif; 23 | } 24 | 25 | a { 26 | color: rgba(0,0,0,0.25); 27 | text-decoration: none; 28 | outline: none; 29 | } 30 | 31 | a:hover, a:focus { 32 | color: rgba(0,0,0,0.6); 33 | } 34 | 35 | .codrops-header { 36 | margin: 0 auto; 37 | padding: 3em 1em; 38 | text-align: center; 39 | color: rgba(0,0,0,0.35); 40 | } 41 | 42 | .codrops-header h1 { 43 | margin: 0; 44 | font-weight: 400; 45 | font-size: 2.5em; 46 | } 47 | 48 | .codrops-header h1 span { 49 | display: block; 50 | padding: 0 0 0.6em 0.1em; 51 | font-size: 0.6em; 52 | opacity: 0.7; 53 | } 54 | 55 | /* To Navigation Style */ 56 | .codrops-top { 57 | width: 100%; 58 | text-transform: uppercase; 59 | font-weight: 700; 60 | font-size: 0.69em; 61 | line-height: 2.2; 62 | } 63 | 64 | .codrops-top a { 65 | display: inline-block; 66 | padding: 0 1em; 67 | text-decoration: none; 68 | letter-spacing: 1px; 69 | } 70 | 71 | .codrops-top span.right { 72 | float: right; 73 | } 74 | 75 | .codrops-top span.right a { 76 | display: block; 77 | float: left; 78 | } 79 | 80 | .codrops-icon:before { 81 | margin: 0 4px; 82 | text-transform: none; 83 | font-weight: normal; 84 | font-style: normal; 85 | font-variant: normal; 86 | font-family: 'codropsicons'; 87 | line-height: 1; 88 | speak: none; 89 | -webkit-font-smoothing: antialiased; 90 | } 91 | 92 | .codrops-icon-drop:before { 93 | content: "\e001"; 94 | } 95 | 96 | .codrops-icon-prev:before { 97 | content: "\e004"; 98 | } 99 | 100 | section { 101 | padding: 5em 2em 10em; 102 | background: #2dcb89; 103 | text-align: center; 104 | } 105 | 106 | section.related { 107 | padding: 3em 1em 4em; 108 | background: #465650; 109 | color: rgba(0,0,0,0.4); 110 | font-size: 1.5em; 111 | } 112 | 113 | .related > a { 114 | max-width: 80%; 115 | border: 2px solid rgba(0,0,0,0.3); 116 | display: inline-block; 117 | text-align: center; 118 | margin: 20px 10px; 119 | padding: 25px; 120 | -webkit-transition: color 0.3s, border-color 0.3s; 121 | transition: color 0.3s, border-color 0.3s; 122 | } 123 | 124 | .related a:hover { 125 | border-color: rgba(0,0,0,0.6); 126 | } 127 | 128 | .related a img { 129 | max-width: 100%; 130 | opacity: 0.4; 131 | -webkit-transition: opacity 0.3s; 132 | transition: opacity 0.3s; 133 | } 134 | 135 | .related a:hover img, 136 | .related a:active img { 137 | opacity: 1; 138 | } 139 | 140 | .related a h3 { 141 | margin: 0; 142 | padding: 0.5em 0 0.3em; 143 | max-width: 300px; 144 | font-weight: 400; 145 | font-size: 0.75em; 146 | text-align: left; 147 | } 148 | 149 | @media screen and (max-width: 44.75em) { 150 | section { padding: 1em 2em; } 151 | } 152 | 153 | @media screen and (max-width: 25em) { 154 | .codrops-header { font-size: 0.8em; } 155 | section.related { font-size: 1.2em; } 156 | .codrops-icon span { display: none; } 157 | } -------------------------------------------------------------------------------- /css/normalize.css: -------------------------------------------------------------------------------- 1 | article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;} -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MinimalForm/9ecb888f388eac23e4a20bf795343673f6eb2367/fonts/codropsicons/codropsicons.eot -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MinimalForm/9ecb888f388eac23e4a20bf795343673f6eb2367/fonts/codropsicons/codropsicons.ttf -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MinimalForm/9ecb888f388eac23e4a20bf795343673f6eb2367/fonts/codropsicons/codropsicons.woff -------------------------------------------------------------------------------- /fonts/codropsicons/license.txt: -------------------------------------------------------------------------------- 1 | Icon Set: Font Awesome -- http://fortawesome.github.com/Font-Awesome/ 2 | License: SIL -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | 4 | 5 | Icon Set: Eco Ico -- http://dribbble.com/shots/665585-Eco-Ico 6 | License: CC0 -- http://creativecommons.org/publicdomain/zero/1.0/ -------------------------------------------------------------------------------- /fonts/icomoon/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MinimalForm/9ecb888f388eac23e4a20bf795343673f6eb2367/fonts/icomoon/icomoon.eot -------------------------------------------------------------------------------- /fonts/icomoon/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /fonts/icomoon/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MinimalForm/9ecb888f388eac23e4a20bf795343673f6eb2367/fonts/icomoon/icomoon.ttf -------------------------------------------------------------------------------- /fonts/icomoon/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MinimalForm/9ecb888f388eac23e4a20bf795343673f6eb2367/fonts/icomoon/icomoon.woff -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |