├── README.md ├── css ├── component.css ├── demo.css └── normalize.css ├── fonts ├── codropsicons │ ├── codropsicons.eot │ ├── codropsicons.svg │ ├── codropsicons.ttf │ ├── codropsicons.woff │ └── license.txt └── ecoicons │ ├── Read Me.txt │ ├── ecoicons.dev.svg │ ├── ecoicons.eot │ ├── ecoicons.svg │ ├── ecoicons.ttf │ ├── ecoicons.woff │ └── license.txt ├── index.html └── js ├── classie.js ├── gnmenu.js └── modernizr.custom.js /README.md: -------------------------------------------------------------------------------- 1 | 2 | Google Nexus Website Menu 3 | ========= 4 | A tutorial on how to recreate the slide out sidebar menu that can be seen on the Google Nexus 7 website. 5 | 6 | [article on Codrops](http://tympanus.net/codrops/?p=16030) 7 | 8 | [demo](http://tympanus.net/Tutorials/GoogleNexusWebsiteMenu/) 9 | 10 | [LICENSING & TERMS OF USE](http://tympanus.net/codrops/licensing/) -------------------------------------------------------------------------------- /css/component.css: -------------------------------------------------------------------------------- 1 | *, 2 | *:after, 3 | *::before { 4 | -webkit-box-sizing: border-box; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | } 8 | 9 | @font-face { 10 | font-weight: normal; 11 | font-style: normal; 12 | font-family: 'ecoicons'; 13 | src: url("../fonts/ecoicons/ecoicons.eot"); 14 | src: url("../fonts/ecoicons/ecoicons.eot?#iefix") format("embedded-opentype"), url("../fonts/ecoicons/ecoicons.woff") format("woff"), url("../fonts/ecoicons/ecoicons.ttf") format("truetype"), url("../fonts/ecoicons/ecoicons.svg#ecoicons") format("svg"); 15 | } 16 | 17 | /* Icomoon.com */ 18 | 19 | .gn-menu-main, 20 | .gn-menu-main ul { 21 | margin: 0; 22 | padding: 0; 23 | background: white; 24 | color: #5f6f81; 25 | list-style: none; 26 | text-transform: none; 27 | font-weight: 300; 28 | font-family: 'Lato', Arial, sans-serif; 29 | line-height: 60px; 30 | } 31 | 32 | .gn-menu-main { 33 | position: fixed; 34 | top: 0; 35 | left: 0; 36 | width: 100%; 37 | height: 60px; 38 | font-size: 13px; 39 | } 40 | 41 | .gn-menu-main a { 42 | display: block; 43 | height: 100%; 44 | color: #5f6f81; 45 | text-decoration: none; 46 | cursor: pointer; 47 | } 48 | 49 | .no-touch .gn-menu-main a:hover, 50 | .no-touch .gn-menu li.gn-search-item:hover, 51 | .no-touch .gn-menu li.gn-search-item:hover a { 52 | background: #5f6f81; 53 | color: white; 54 | } 55 | 56 | .gn-menu-main > li { 57 | display: block; 58 | float: left; 59 | height: 100%; 60 | border-right: 1px solid #c6d0da; 61 | text-align: center; 62 | } 63 | 64 | /* icon-only trigger (menu item) */ 65 | 66 | .gn-menu-main li.gn-trigger { 67 | position: relative; 68 | width: 60px; 69 | -webkit-touch-callout: none; 70 | -webkit-user-select: none; 71 | -khtml-user-select: none; 72 | -moz-user-select: none; 73 | -ms-user-select: none; 74 | user-select: none; 75 | } 76 | 77 | .gn-menu-main > li:last-child { 78 | float: right; 79 | border-right: none; 80 | border-left: 1px solid #c6d0da; 81 | } 82 | 83 | .gn-menu-main > li > a { 84 | padding: 0 30px; 85 | text-transform: uppercase; 86 | letter-spacing: 1px; 87 | font-weight: bold; 88 | } 89 | 90 | .gn-menu-main:after { 91 | display: table; 92 | clear: both; 93 | content: ""; 94 | } 95 | 96 | .gn-menu-wrapper { 97 | position: fixed; 98 | top: 60px; 99 | bottom: 0; 100 | left: 0; 101 | overflow: hidden; 102 | width: 60px; 103 | border-top: 1px solid #c6d0da; 104 | background: white; 105 | -webkit-transform: translateX(-60px); 106 | -moz-transform: translateX(-60px); 107 | transform: translateX(-60px); 108 | -webkit-transition: -webkit-transform 0.3s, width 0.3s; 109 | -moz-transition: -moz-transform 0.3s, width 0.3s; 110 | transition: transform 0.3s, width 0.3s; 111 | } 112 | 113 | .gn-scroller { 114 | position: absolute; 115 | overflow-y: scroll; 116 | width: 370px; 117 | height: 100%; 118 | } 119 | 120 | .gn-menu { 121 | border-bottom: 1px solid #c6d0da; 122 | text-align: left; 123 | font-size: 18px; 124 | } 125 | 126 | .gn-menu li:not(:first-child), 127 | .gn-menu li li { 128 | box-shadow: inset 0 1px #c6d0da 129 | } 130 | 131 | .gn-submenu li { 132 | overflow: hidden; 133 | height: 0; 134 | -webkit-transition: height 0.3s; 135 | -moz-transition: height 0.3s; 136 | transition: height 0.3s; 137 | } 138 | 139 | .gn-submenu li a { 140 | color: #c1c9d1 141 | } 142 | 143 | input.gn-search { 144 | position: relative; 145 | z-index: 10; 146 | padding-left: 60px; 147 | outline: none; 148 | border: none; 149 | background: transparent; 150 | color: #5f6f81; 151 | font-weight: 300; 152 | font-family: 'Lato', Arial, sans-serif; 153 | cursor: pointer; 154 | } 155 | 156 | /* placeholder */ 157 | 158 | .gn-search::-webkit-input-placeholder { 159 | color: #5f6f81 160 | } 161 | 162 | .gn-search:-moz-placeholder { 163 | color: #5f6f81 164 | } 165 | 166 | .gn-search::-moz-placeholder { 167 | color: #5f6f81 168 | } 169 | 170 | .gn-search:-ms-input-placeholder { 171 | color: #5f6f81 172 | } 173 | 174 | /* hide placeholder when active in Chrome */ 175 | 176 | .gn-search:focus::-webkit-input-placeholder, 177 | .no-touch .gn-menu li.gn-search-item:hover .gn-search:focus::-webkit-input-placeholder { 178 | color: transparent 179 | } 180 | 181 | input.gn-search:focus { 182 | cursor: text 183 | } 184 | 185 | .no-touch .gn-menu li.gn-search-item:hover input.gn-search { 186 | color: white 187 | } 188 | 189 | /* placeholder */ 190 | 191 | .no-touch .gn-menu li.gn-search-item:hover .gn-search::-webkit-input-placeholder { 192 | color: white 193 | } 194 | 195 | .no-touch .gn-menu li.gn-search-item:hover .gn-search:-moz-placeholder { 196 | color: white 197 | } 198 | 199 | .no-touch .gn-menu li.gn-search-item:hover .gn-search::-moz-placeholder { 200 | color: white 201 | } 202 | 203 | .no-touch .gn-menu li.gn-search-item:hover .gn-search:-ms-input-placeholder { 204 | color: white 205 | } 206 | 207 | .gn-menu-main a.gn-icon-search { 208 | position: absolute; 209 | top: 0; 210 | left: 0; 211 | height: 60px; 212 | } 213 | 214 | .gn-icon::before { 215 | display: inline-block; 216 | width: 60px; 217 | text-align: center; 218 | text-transform: none; 219 | font-weight: normal; 220 | font-style: normal; 221 | font-variant: normal; 222 | font-family: 'ecoicons'; 223 | line-height: 1; 224 | speak: none; 225 | -webkit-font-smoothing: antialiased; 226 | } 227 | 228 | .gn-icon-help::before { 229 | content: "\e000" 230 | } 231 | 232 | .gn-icon-earth::before { 233 | content: "\e004" 234 | } 235 | 236 | .gn-icon-cog::before { 237 | content: "\e006" 238 | } 239 | 240 | .gn-icon-search::before { 241 | content: "\e005" 242 | } 243 | 244 | .gn-icon-download::before { 245 | content: "\e007" 246 | } 247 | 248 | .gn-icon-photoshop::before { 249 | content: "\e001" 250 | } 251 | 252 | .gn-icon-illustrator::before { 253 | content: "\e002" 254 | } 255 | 256 | .gn-icon-archive::before { 257 | content: "\e00d" 258 | } 259 | 260 | .gn-icon-article::before { 261 | content: "\e003" 262 | } 263 | 264 | .gn-icon-pictures::before { 265 | content: "\e008" 266 | } 267 | 268 | .gn-icon-videos::before { 269 | content: "\e009" 270 | } 271 | 272 | /* if an icon anchor has a span, hide the span */ 273 | 274 | .gn-icon span { 275 | width: 0; 276 | height: 0; 277 | display: block; 278 | overflow: hidden; 279 | } 280 | 281 | .gn-icon-menu::before { 282 | margin-left: -15px; 283 | vertical-align: -2px; 284 | width: 30px; 285 | height: 3px; 286 | background: #5f6f81; 287 | box-shadow: 0 3px white, 0 -6px #5f6f81, 0 -9px white, 0 -12px #5f6f81; 288 | content: ''; 289 | } 290 | 291 | .no-touch .gn-icon-menu:hover::before, 292 | .no-touch .gn-icon-menu.gn-selected:hover::before { 293 | background: white; 294 | box-shadow: 0 3px #5f6f81, 0 -6px white, 0 -9px #5f6f81, 0 -12px white; 295 | } 296 | 297 | .gn-icon-menu.gn-selected::before { 298 | background: #5993cd; 299 | box-shadow: 0 3px white, 0 -6px #5993cd, 0 -9px white, 0 -12px #5993cd; 300 | } 301 | 302 | /* styles for opening menu */ 303 | 304 | .gn-menu-wrapper.gn-open-all, 305 | .gn-menu-wrapper.gn-open-part { 306 | -webkit-transform: translateX(0px); 307 | -moz-transform: translateX(0px); 308 | transform: translateX(0px); 309 | } 310 | 311 | .gn-menu-wrapper.gn-open-all { 312 | width: 340px 313 | } 314 | 315 | .gn-menu-wrapper.gn-open-all .gn-submenu li { 316 | height: 60px 317 | } 318 | 319 | @media screen and (max-width: 422px) { 320 | .gn-menu-wrapper.gn-open-all { 321 | -webkit-transform: translateX(0px); 322 | -moz-transform: translateX(0px); 323 | transform: translateX(0px); 324 | width: 100%; 325 | } 326 | 327 | .gn-menu-wrapper.gn-open-all .gn-scroller { 328 | width: 130% 329 | } 330 | } 331 | -------------------------------------------------------------------------------- /css/demo.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Lato:300,400,700); 2 | @font-face { 3 | font-family: 'codropsicons'; 4 | src:url('../fonts/codropsicons/codropsicons.eot'); 5 | src:url('../fonts/codropsicons/codropsicons.eot?#iefix') format('embedded-opentype'), 6 | url('../fonts/codropsicons/codropsicons.woff') format('woff'), 7 | url('../fonts/codropsicons/codropsicons.ttf') format('truetype'), 8 | url('../fonts/codropsicons/codropsicons.svg#codropsicons') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | body { 14 | background: #34495e; 15 | } 16 | 17 | .container > header, 18 | .codrops-top { 19 | color: #fff; 20 | font-family: 'Lato', Arial, sans-serif; 21 | } 22 | 23 | .container > header { 24 | margin: 0 auto; 25 | padding: 12em 2em; 26 | padding-left: 370px; 27 | background: rgba(0,0,0,0.05); 28 | } 29 | 30 | .container > header a { 31 | color: #566473; 32 | text-decoration: none; 33 | outline: none; 34 | } 35 | 36 | .container > header a:hover { 37 | color: #4f7bab; 38 | } 39 | 40 | .container > header h1 { 41 | font-size: 3.2em; 42 | line-height: 1.3; 43 | margin: 0; 44 | font-weight: 300; 45 | } 46 | 47 | .container > header span { 48 | display: block; 49 | font-size: 55%; 50 | color: #74818e; 51 | padding: 0 0 0.6em 0.1em; 52 | } 53 | 54 | /* To Navigation Style */ 55 | .codrops-top { 56 | background: #fff; 57 | background: rgba(255, 255, 255, 0.6); 58 | text-transform: uppercase; 59 | width: 100%; 60 | font-size: 0.69em; 61 | line-height: 2.2; 62 | } 63 | 64 | .codrops-top a { 65 | text-decoration: none; 66 | padding: 0 1em; 67 | letter-spacing: 0.1em; 68 | color: #888; 69 | display: inline-block; 70 | } 71 | 72 | .codrops-top a:hover { 73 | background: rgba(255,255,255,0.95); 74 | color: #333; 75 | } 76 | 77 | .codrops-top span.right { 78 | float: right; 79 | } 80 | 81 | .codrops-top span.right a { 82 | float: left; 83 | display: block; 84 | } 85 | 86 | .codrops-icon:before { 87 | font-family: 'codropsicons'; 88 | margin: 0 4px; 89 | speak: none; 90 | font-style: normal; 91 | font-weight: normal; 92 | font-variant: normal; 93 | text-transform: none; 94 | line-height: 1; 95 | -webkit-font-smoothing: antialiased; 96 | } 97 | 98 | .codrops-icon-drop:before { 99 | content: "\e001"; 100 | } 101 | 102 | .codrops-icon-prev:before { 103 | content: "\e004"; 104 | } 105 | 106 | /* Demo Buttons Style */ 107 | .codrops-demos { 108 | padding-top: 1em; 109 | font-size: 0.9em; 110 | } 111 | 112 | .codrops-demos a { 113 | text-decoration: none; 114 | outline: none; 115 | display: inline-block; 116 | margin: 0.5em; 117 | padding: 0.7em 1.1em; 118 | border: 3px solid #b1aea6; 119 | color: #b1aea6; 120 | font-weight: 700; 121 | } 122 | 123 | .codrops-demos a:hover, 124 | .codrops-demos a.current-demo, 125 | .codrops-demos a.current-demo:hover { 126 | border-color: #89867e; 127 | color: #89867e; 128 | } 129 | 130 | @media screen and (max-width: 1025px) { 131 | .container > header { 132 | margin: 0 auto; 133 | padding: 120px 50px; 134 | font-size: 70%; 135 | text-align: right; 136 | } 137 | } 138 | 139 | @media screen and (max-width: 740px) { 140 | 141 | .codrops-icon span { 142 | display: none; 143 | } 144 | 145 | } -------------------------------------------------------------------------------- /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/GoogleNexusWebsiteMenu/8413011b2f220520cced4109fecd697e08373ca5/fonts/codropsicons/codropsicons.eot -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GoogleNexusWebsiteMenu/8413011b2f220520cced4109fecd697e08373ca5/fonts/codropsicons/codropsicons.ttf -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GoogleNexusWebsiteMenu/8413011b2f220520cced4109fecd697e08373ca5/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/ecoicons/Read Me.txt: -------------------------------------------------------------------------------- 1 | To modify your generated font, use the *dev.svg* file, located in the *fonts* folder in this package. You can import this dev.svg file to the IcoMoon app. All the tags (class names) and the Unicode points of your glyphs are saved in this file. 2 | 3 | See the documentation for more info on how to use this package: http://icomoon.io/#docs/font-face -------------------------------------------------------------------------------- /fonts/ecoicons/ecoicons.dev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /fonts/ecoicons/ecoicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GoogleNexusWebsiteMenu/8413011b2f220520cced4109fecd697e08373ca5/fonts/ecoicons/ecoicons.eot -------------------------------------------------------------------------------- /fonts/ecoicons/ecoicons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /fonts/ecoicons/ecoicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GoogleNexusWebsiteMenu/8413011b2f220520cced4109fecd697e08373ca5/fonts/ecoicons/ecoicons.ttf -------------------------------------------------------------------------------- /fonts/ecoicons/ecoicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GoogleNexusWebsiteMenu/8413011b2f220520cced4109fecd697e08373ca5/fonts/ecoicons/ecoicons.woff -------------------------------------------------------------------------------- /fonts/ecoicons/license.txt: -------------------------------------------------------------------------------- 1 | Icon Set: Eco Ico -- http://dribbble.com/shots/665585-Eco-Ico 2 | License: CC0 -- http://creativecommons.org/publicdomain/zero/1.0/ -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |