├── README.md ├── css ├── demo.css ├── normalize.css ├── style1.css ├── style10.css ├── style11.css ├── style12.css ├── style2.css ├── style3.css ├── style5.css ├── style6.css ├── style7.css ├── style8.css └── style9.css ├── fonts └── codropsicons │ ├── codropsicons.eot │ ├── codropsicons.svg │ ├── codropsicons.ttf │ ├── codropsicons.woff │ └── license.txt ├── img └── cross.png ├── index.html ├── index10.html ├── index11.html ├── index12.html ├── index2.html ├── index3.html ├── index5.html ├── index6.html ├── index7.html ├── index8.html ├── index9.html └── js ├── classie.js ├── demo1.js ├── demo10.js ├── demo12.js ├── demo7.js ├── demo9.js ├── modernizr.custom.js └── snap.svg-min.js /README.md: -------------------------------------------------------------------------------- 1 | Fullscreen Overlay Styles & Effects 2 | ========= 3 | 4 | Some simple and creative overlay styles and effects. From sliding the overlay into the viewport to using SVG morphing shapes, we explore some effects for fullscreen overlays. 5 | 6 | [Article on Codrops](http://tympanus.net/codrops/?p=18459) 7 | 8 | [Demo](http://tympanus.net/Development/FullscreenOverlayStyles/) 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 | 15 | [© Codrops 2013](http://www.codrops.com) -------------------------------------------------------------------------------- /css/demo.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Lato:300,400); 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: #fff; 19 | color: #8a8c7e; 20 | font-size: 100%; 21 | line-height: 1.25; 22 | font-family: 'Lato', 'Avenir Next', Arial, sans-serif; 23 | } 24 | 25 | a { 26 | color: #99cc33; 27 | text-decoration: none; 28 | outline: none; 29 | } 30 | 31 | a:hover, a:focus { 32 | color: #373e18; 33 | } 34 | 35 | .codrops-header { 36 | margin: 0 auto; 37 | padding: 2em 0 0; 38 | text-align: center; 39 | } 40 | 41 | .codrops-header h1 { 42 | margin: 0; 43 | font-weight: 300; 44 | font-size: 2.5em; 45 | } 46 | 47 | .codrops-header h1 span { 48 | display: block; 49 | padding: 0 0 0.6em 0.1em; 50 | font-size: 0.6em; 51 | opacity: 0.7; 52 | } 53 | 54 | /* To Navigation Style */ 55 | .codrops-top { 56 | width: 100%; 57 | text-transform: uppercase; 58 | font-weight: 600; 59 | font-size: 0.69em; 60 | line-height: 2.2; 61 | background: #fff; 62 | } 63 | 64 | .codrops-top a { 65 | display: inline-block; 66 | padding: 0 1em; 67 | text-decoration: none; 68 | } 69 | 70 | .codrops-top span.right { 71 | float: right; 72 | } 73 | 74 | .codrops-top span.right a { 75 | display: block; 76 | float: left; 77 | } 78 | 79 | .codrops-icon:before { 80 | margin: 0 4px; 81 | text-transform: none; 82 | font-weight: normal; 83 | font-style: normal; 84 | font-variant: normal; 85 | font-family: 'codropsicons'; 86 | line-height: 1; 87 | speak: none; 88 | -webkit-font-smoothing: antialiased; 89 | } 90 | 91 | .codrops-icon-drop:before { 92 | content: "\e001"; 93 | } 94 | 95 | .codrops-icon-prev:before { 96 | content: "\e004"; 97 | } 98 | 99 | .codrops-demos { 100 | margin: 30px auto 0; 101 | padding: 30px 0; 102 | } 103 | 104 | .codrops-demos a, 105 | section button { 106 | display: inline-block; 107 | background: #a9a9a9; 108 | color: #fff; 109 | font-weight: 400; 110 | padding: 10px 20px; 111 | margin: 5px; 112 | text-transform: uppercase; 113 | border-radius: 2px; 114 | letter-spacing: 1px; 115 | } 116 | 117 | .codrops-demos a:hover, 118 | .codrops-demos a:active, 119 | .codrops-demos a.current-demo { 120 | background: #777; 121 | } 122 | 123 | section { 124 | padding: 1em 2em 5em; 125 | text-align: center; 126 | font-size: 1.5em; 127 | } 128 | 129 | section p { 130 | max-width: 600px; 131 | margin: 0 auto; 132 | padding: 20px 0; 133 | } 134 | 135 | section button { 136 | border: none; 137 | padding: 15px 30px; 138 | outline: none; 139 | background: #85b91e; 140 | } 141 | 142 | .related > a { 143 | border: 1px solid #99cc33; 144 | display: inline-block; 145 | text-align: center; 146 | margin: 20px 10px; 147 | padding: 25px; 148 | color: #99cc33; 149 | opacity: 0.8; 150 | -webkit-transition: color 0.3s, border-color 0.3s; 151 | transition: color 0.3s, border-color 0.3s; 152 | -webkit-backface-visibility: hidden; 153 | } 154 | 155 | .related a:hover { 156 | border-color: #82b222; 157 | color: #82b222; 158 | } 159 | 160 | .related a img { 161 | max-width: 100%; 162 | } 163 | 164 | .related a h3 { 165 | margin: 0; 166 | padding: 0.5em 0 0.3em; 167 | max-width: 300px; 168 | text-align: left; 169 | font-size: 65%; 170 | font-weight: 400; 171 | } 172 | 173 | @media screen and (max-width: 25em) { 174 | .codrops-icon span { 175 | display: none; 176 | } 177 | } -------------------------------------------------------------------------------- /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;} -------------------------------------------------------------------------------- /css/style1.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | font-size: 54px; 34 | -webkit-transform: translateY(-50%); 35 | transform: translateY(-50%); 36 | } 37 | 38 | .overlay ul { 39 | list-style: none; 40 | padding: 0; 41 | margin: 0 auto; 42 | display: inline-block; 43 | height: 100%; 44 | position: relative; 45 | } 46 | 47 | .overlay ul li { 48 | display: block; 49 | height: 20%; 50 | height: calc(100% / 5); 51 | min-height: 54px; 52 | } 53 | 54 | .overlay ul li a { 55 | font-weight: 300; 56 | display: block; 57 | color: #fff; 58 | -webkit-transition: color 0.2s; 59 | transition: color 0.2s; 60 | } 61 | 62 | .overlay ul li a:hover, 63 | .overlay ul li a:focus { 64 | color: #e3fcb1; 65 | } 66 | 67 | /* Effects */ 68 | .overlay-hugeinc { 69 | opacity: 0; 70 | visibility: hidden; 71 | -webkit-transition: opacity 0.5s, visibility 0s 0.5s; 72 | transition: opacity 0.5s, visibility 0s 0.5s; 73 | } 74 | 75 | .overlay-hugeinc.open { 76 | opacity: 1; 77 | visibility: visible; 78 | -webkit-transition: opacity 0.5s; 79 | transition: opacity 0.5s; 80 | } 81 | 82 | .overlay-hugeinc nav { 83 | -webkit-perspective: 1200px; 84 | perspective: 1200px; 85 | } 86 | 87 | .overlay-hugeinc nav ul { 88 | opacity: 0.4; 89 | -webkit-transform: translateY(-25%) rotateX(35deg); 90 | transform: translateY(-25%) rotateX(35deg); 91 | -webkit-transition: -webkit-transform 0.5s, opacity 0.5s; 92 | transition: transform 0.5s, opacity 0.5s; 93 | } 94 | 95 | .overlay-hugeinc.open nav ul { 96 | opacity: 1; 97 | -webkit-transform: rotateX(0deg); 98 | transform: rotateX(0deg); 99 | } 100 | 101 | .overlay-hugeinc.close nav ul { 102 | -webkit-transform: translateY(25%) rotateX(-35deg); 103 | transform: translateY(25%) rotateX(-35deg); 104 | } 105 | 106 | @media screen and (max-height: 30.5em) { 107 | .overlay nav { 108 | height: 70%; 109 | font-size: 34px; 110 | } 111 | .overlay ul li { 112 | min-height: 34px; 113 | } 114 | } -------------------------------------------------------------------------------- /css/style10.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-boxes { 71 | background: transparent; 72 | visibility: hidden; 73 | -webkit-transition: visibility 0s 0.8s; 74 | transition: visibility 0s 0.8s; 75 | } 76 | 77 | .overlay-boxes.open { 78 | visibility: visible; 79 | -webkit-transition: none; 80 | transition: none; 81 | } 82 | 83 | .overlay-boxes svg { 84 | position: absolute; 85 | top: 0; 86 | left: 0; 87 | } 88 | 89 | .overlay-boxes svg path { 90 | fill: rgb(153,204,51); 91 | display: none; 92 | } 93 | 94 | .overlay-boxes nav, 95 | .overlay-boxes .overlay-close { 96 | opacity: 0; 97 | -webkit-transition: opacity 0.5s 0.8s; 98 | transition: opacity 0.5s 0.8s; 99 | } 100 | 101 | .overlay-boxes.open nav, 102 | .overlay-boxes.open .overlay-close { 103 | opacity: 1; 104 | -webkit-transition-delay: 0.8s; 105 | transition-delay: 0.8s; 106 | } 107 | 108 | .overlay-boxes.close nav, 109 | .overlay-boxes.close .overlay-close { 110 | -webkit-transition-delay: 0s; 111 | transition-delay: 0s; 112 | } 113 | 114 | @media screen and (max-height: 30.5em) { 115 | .overlay nav { 116 | height: 70%; 117 | font-size: 34px; 118 | } 119 | .overlay ul li { 120 | min-height: 34px; 121 | } 122 | } -------------------------------------------------------------------------------- /css/style11.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #e3fcb1; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-simplegenie { 71 | visibility: hidden; 72 | -webkit-transform: translateY(60%) scale(0); 73 | transform: translateY(60%) scale(0); 74 | -webkit-transition: -webkit-transform 0.4s, visibility 0s 0.4s; 75 | transition: transform 0.4s, visibility 0s 0.4s; 76 | } 77 | 78 | .overlay-simplegenie.open { 79 | visibility: visible; 80 | -webkit-transform: translateY(0%) scale(1); 81 | transform: translateY(0%) scale(1); 82 | -webkit-transition: -webkit-transform 0.4s; 83 | transition: transform 0.4s; 84 | } 85 | 86 | @media screen and (max-height: 30.5em) { 87 | .overlay nav { 88 | height: 70%; 89 | font-size: 34px; 90 | } 91 | .overlay ul li { 92 | min-height: 34px; 93 | } 94 | } -------------------------------------------------------------------------------- /css/style12.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-genie { 71 | background: transparent; 72 | visibility: hidden; 73 | opacity: 0; 74 | -webkit-transition: opacity 0.3s 0.2s, visibility 0s 0.6s; 75 | transition: opacity 0.3s 0.2s, visibility 0s 0.6s; 76 | } 77 | 78 | .overlay-genie.open { 79 | visibility: visible; 80 | opacity: 1; 81 | -webkit-transition: opacity 0.3s; 82 | transition: opacity 0.3s; 83 | } 84 | 85 | .overlay-genie svg { 86 | position: absolute; 87 | top: 0; 88 | left: 0; 89 | } 90 | 91 | .overlay-genie .overlay-path { 92 | fill: rgba(153,204,51,0.9); 93 | } 94 | 95 | .overlay-genie nav { 96 | opacity: 0; 97 | -webkit-transform: scale(0.8) translateY(-48%); 98 | transform: scale(0.8) translateY(-48%); 99 | -webkit-transition: opacity 0.3s 0.3s, -webkit-transform 0.3s 0.3s; 100 | transition: opacity 0.3s 0.3s, transform 0.3s 0.3s; 101 | } 102 | 103 | .overlay-genie .overlay-close { 104 | opacity: 0; 105 | -webkit-transition: opacity 0.3s; 106 | transition: opacity 0.3s; 107 | } 108 | 109 | .overlay-genie.open nav, 110 | .overlay-genie.open .overlay-close { 111 | opacity: 1; 112 | -webkit-transition-delay: 0.3s; 113 | transition-delay: 0.3s; 114 | } 115 | 116 | .overlay-genie.open nav { 117 | -webkit-transform: scale(1) translateY(-50%); 118 | transform: scale(1) translateY(-50%); 119 | } 120 | 121 | .overlay-genie.close nav, 122 | .overlay-genie.close .overlay-close { 123 | -webkit-transition-delay: 0s; 124 | transition-delay: 0s; 125 | } 126 | 127 | @media screen and (max-height: 30.5em) { 128 | .overlay nav { 129 | height: 70%; 130 | font-size: 34px; 131 | } 132 | .overlay ul li { 133 | min-height: 34px; 134 | } 135 | } -------------------------------------------------------------------------------- /css/style2.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-corner { 71 | opacity: 0; 72 | visibility: hidden; 73 | -webkit-transform: translateY(50px) translateX(50px); 74 | transform: translateY(50px) translateX(50px); 75 | -webkit-transition: opacity 0.5s, -webkit-transform 0.5s, visibility 0s 0.5s; 76 | transition: opacity 0.5s, transform 0.5s, visibility 0s 0.5s; 77 | } 78 | 79 | .overlay-corner.open { 80 | opacity: 1; 81 | visibility: visible; 82 | -webkit-transform: translateY(0%); 83 | transform: translateY(0%); 84 | -webkit-transition: opacity 0.5s, -webkit-transform 0.5s; 85 | transition: opacity 0.5s, transform 0.5s; 86 | } 87 | 88 | @media screen and (max-height: 30.5em) { 89 | .overlay nav { 90 | height: 70%; 91 | font-size: 34px; 92 | } 93 | .overlay ul li { 94 | min-height: 34px; 95 | } 96 | } -------------------------------------------------------------------------------- /css/style3.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #e3fcb1; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-slidedown { 71 | visibility: hidden; 72 | -webkit-transform: translateY(-100%); 73 | transform: translateY(-100%); 74 | -webkit-transition: -webkit-transform 0.4s ease-in-out, visibility 0s 0.4s; 75 | transition: transform 0.4s ease-in-out, visibility 0s 0.4s; 76 | } 77 | 78 | .overlay-slidedown.open { 79 | visibility: visible; 80 | -webkit-transform: translateY(0%); 81 | transform: translateY(0%); 82 | -webkit-transition: -webkit-transform 0.4s ease-in-out; 83 | transition: transform 0.4s ease-in-out; 84 | } 85 | 86 | @media screen and (max-height: 30.5em) { 87 | .overlay nav { 88 | height: 70%; 89 | font-size: 34px; 90 | } 91 | .overlay ul li { 92 | min-height: 34px; 93 | } 94 | } -------------------------------------------------------------------------------- /css/style5.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-scale { 71 | visibility: hidden; 72 | opacity: 0; 73 | -webkit-transform: scale(0.9); 74 | transform: scale(0.9); 75 | -webkit-transition: -webkit-transform 0.2s, opacity 0.2s, visibility 0s 0.2s; 76 | transition: transform 0.2s, opacity 0.2s, visibility 0s 0.2s; 77 | } 78 | 79 | .overlay-scale.open { 80 | visibility: visible; 81 | opacity: 1; 82 | -webkit-transform: scale(1); 83 | transform: scale(1); 84 | -webkit-transition: -webkit-transform 0.4s, opacity 0.4s; 85 | transition: transform 0.4s, opacity 0.4s; 86 | } 87 | 88 | @media screen and (max-height: 30.5em) { 89 | .overlay nav { 90 | height: 70%; 91 | font-size: 34px; 92 | } 93 | .overlay ul li { 94 | min-height: 34px; 95 | } 96 | } -------------------------------------------------------------------------------- /css/style6.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-door { 71 | visibility: hidden; 72 | width: 0; 73 | left: 50%; 74 | -webkit-transform: translateX(-50%); 75 | transform: translateX(-50%); 76 | -webkit-transition: width 0.5s 0.3s, visibility 0s 0.8s; 77 | transition: width 0.5s 0.3s, visibility 0s 0.8s; 78 | } 79 | 80 | .overlay-door.open { 81 | visibility: visible; 82 | width: 100%; 83 | -webkit-transition: width 0.5s; 84 | transition: width 0.5s; 85 | } 86 | 87 | .overlay-door nav { 88 | position: absolute; 89 | left: 50%; 90 | -webkit-transform: translateY(-50%) translateX(-50%); 91 | transform: translateY(-50%) translateX(-50%); 92 | } 93 | 94 | .overlay-door nav, 95 | .overlay-door .overlay-close { 96 | opacity: 0; 97 | -webkit-transition: opacity 0.3s 0.5s; 98 | transition: opacity 0.3s 0.5s; 99 | } 100 | 101 | .overlay-door.open nav, 102 | .overlay-door.open .overlay-close { 103 | opacity: 1; 104 | -webkit-transition-delay: 0.5s; 105 | transition-delay: 0.5s; 106 | } 107 | 108 | .overlay-door.close nav, 109 | .overlay-door.close .overlay-close { 110 | -webkit-transition-delay: 0s; 111 | transition-delay: 0s; 112 | } 113 | 114 | @media screen and (max-height: 30.5em) { 115 | .overlay nav { 116 | height: 70%; 117 | font-size: 34px; 118 | } 119 | .overlay ul li { 120 | min-height: 34px; 121 | } 122 | } -------------------------------------------------------------------------------- /css/style7.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | html, body { 71 | overflow-x: hidden; 72 | } 73 | 74 | .container { 75 | overflow-x: hidden; 76 | -webkit-transition: -webkit-transform 0.5s; 77 | transition: transform 0.5s; 78 | } 79 | 80 | .container.overlay-open { 81 | -webkit-transform: translateX(50%); 82 | transform: translateX(50%); 83 | } 84 | 85 | .container::after { 86 | content: ''; 87 | opacity: 0; 88 | visibility: hidden; 89 | position: absolute; 90 | top: 0; 91 | left: 0; 92 | width: 100%; 93 | height: 100%; 94 | background: rgba(0,0,0,0.6); 95 | -webkit-transition: opacity 0.5s, visibility 0s 0.5s; 96 | transition: opacity 0.5s, visibility 0s 0.5s; 97 | } 98 | 99 | .container.overlay-open::after { 100 | visibility: visible; 101 | opacity: 1; 102 | -webkit-transition: opacity 0.5s; 103 | transition: opacity 0.5s; 104 | } 105 | 106 | .overlay-contentpush { 107 | background: rgba(153,204,51,1); 108 | visibility: hidden; 109 | -webkit-backface-visibility: hidden; 110 | backface-visibility: hidden; 111 | -webkit-transform: translateX(-100%); 112 | transform: translateX(-100%); 113 | -webkit-transition: -webkit-transform 0.5s, visibility 0s 0.5s; 114 | transition: transform 0.5s, visibility 0s 0.5s; 115 | } 116 | 117 | .overlay-contentpush.open { 118 | visibility: visible; 119 | -webkit-transform: translateX(0%); 120 | transform: translateX(0%); 121 | -webkit-transition: -webkit-transform 0.5s; 122 | transition: transform 0.5s; 123 | } 124 | 125 | @media screen and (max-height: 30.5em) { 126 | .overlay nav { 127 | height: 70%; 128 | font-size: 34px; 129 | } 130 | .overlay ul li { 131 | min-height: 34px; 132 | } 133 | } -------------------------------------------------------------------------------- /css/style8.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | } 52 | 53 | .overlay ul li a { 54 | font-size: 54px; 55 | font-weight: 300; 56 | display: block; 57 | color: #fff; 58 | -webkit-transition: color 0.2s; 59 | transition: color 0.2s; 60 | } 61 | 62 | .overlay ul li a:hover, 63 | .overlay ul li a:focus { 64 | color: #f0f0f0; 65 | } 66 | 67 | /* Effects */ 68 | body { 69 | background: #ddd; 70 | } 71 | 72 | .container { 73 | background: #fff; 74 | -webkit-transition: -webkit-transform 0.5s; 75 | transition: transform 0.5s; 76 | } 77 | 78 | .container.overlay-open { 79 | -webkit-transform: scale(0.8); 80 | transform: scale(0.8); 81 | } 82 | 83 | .overlay-contentscale { 84 | visibility: hidden; 85 | -webkit-transform: translateY(100%); 86 | transform: translateY(100%); 87 | -webkit-transition: -webkit-transform 0.5s, visibility 0s 0.5s; 88 | transition: transform 0.5s, visibility 0s 0.5s; 89 | } 90 | 91 | .overlay-contentscale.open { 92 | visibility: visible; 93 | -webkit-transform: translateY(0%); 94 | transform: translateY(0%); 95 | -webkit-transition: -webkit-transform 0.5s; 96 | transition: transform 0.5s; 97 | } 98 | 99 | @media screen and (max-height: 30.5em) { 100 | .overlay nav { 101 | height: 70%; 102 | font-size: 34px; 103 | } 104 | .overlay ul li { 105 | min-height: 34px; 106 | } 107 | } -------------------------------------------------------------------------------- /css/style9.css: -------------------------------------------------------------------------------- 1 | /* Overlay style */ 2 | .overlay { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | top: 0; 7 | left: 0; 8 | background: rgba(153,204,51,0.9); 9 | } 10 | 11 | /* Overlay closing cross */ 12 | .overlay .overlay-close { 13 | width: 80px; 14 | height: 80px; 15 | position: absolute; 16 | right: 20px; 17 | top: 20px; 18 | overflow: hidden; 19 | border: none; 20 | background: url(../img/cross.png) no-repeat center center; 21 | text-indent: 200%; 22 | color: transparent; 23 | outline: none; 24 | z-index: 100; 25 | } 26 | 27 | /* Menu style */ 28 | .overlay nav { 29 | text-align: center; 30 | position: relative; 31 | top: 50%; 32 | height: 60%; 33 | -webkit-transform: translateY(-50%); 34 | transform: translateY(-50%); 35 | } 36 | 37 | .overlay ul { 38 | list-style: none; 39 | padding: 0; 40 | margin: 0 auto; 41 | display: inline-block; 42 | height: 100%; 43 | position: relative; 44 | } 45 | 46 | .overlay ul li { 47 | display: block; 48 | height: 20%; 49 | height: calc(100% / 5); 50 | min-height: 54px; 51 | -webkit-backface-visibility: hidden; 52 | backface-visibility: hidden; 53 | } 54 | 55 | .overlay ul li a { 56 | font-size: 54px; 57 | font-weight: 300; 58 | display: block; 59 | color: #fff; 60 | -webkit-transition: color 0.2s; 61 | transition: color 0.2s; 62 | } 63 | 64 | .overlay ul li a:hover, 65 | .overlay ul li a:focus { 66 | color: #f0f0f0; 67 | } 68 | 69 | /* Effects */ 70 | .overlay-cornershape { 71 | background: transparent; 72 | visibility: hidden; 73 | -webkit-transition: visibility 0s 0.5s; 74 | transition: visibility 0s 0.5s; 75 | } 76 | 77 | .overlay-cornershape.open { 78 | visibility: visible; 79 | -webkit-transition: none; 80 | transition: none; 81 | } 82 | 83 | .overlay-cornershape svg { 84 | position: absolute; 85 | top: 0; 86 | left: 0; 87 | } 88 | 89 | .overlay-cornershape .overlay-path { 90 | fill: rgba(153,204,51,0.9); 91 | } 92 | 93 | .overlay-cornershape nav, 94 | .overlay-cornershape .overlay-close { 95 | opacity: 0; 96 | -webkit-transition: opacity 0.4s 0.4s; 97 | transition: opacity 0.4s 0.4s; 98 | } 99 | 100 | .overlay-cornershape.open nav, 101 | .overlay-cornershape.open .overlay-close { 102 | opacity: 1; 103 | -webkit-transition-delay: 0.4s; 104 | transition-delay: 0.4s; 105 | } 106 | 107 | .overlay-cornershape.close nav, 108 | .overlay-cornershape.close .overlay-close { 109 | -webkit-transition-delay: 0s; 110 | transition-delay: 0s; 111 | } 112 | 113 | @media screen and (max-height: 30.5em) { 114 | .overlay nav { 115 | height: 70%; 116 | font-size: 34px; 117 | } 118 | .overlay ul li { 119 | min-height: 34px; 120 | } 121 | } -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/FullscreenOverlayStyles/c8ec821c031a2de83a66909077b2c34b7f76f80a/fonts/codropsicons/codropsicons.eot -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/FullscreenOverlayStyles/c8ec821c031a2de83a66909077b2c34b7f76f80a/fonts/codropsicons/codropsicons.ttf -------------------------------------------------------------------------------- /fonts/codropsicons/codropsicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/FullscreenOverlayStyles/c8ec821c031a2de83a66909077b2c34b7f76f80a/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/ -------------------------------------------------------------------------------- /img/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/FullscreenOverlayStyles/c8ec821c031a2de83a66909077b2c34b7f76f80a/img/cross.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |Overlay fades in and menu rotates slightly in perspective. As seen on Huge
42 | 43 |Boxes (SVG) appearing randomly to fill the background of the overlay.
43 | 44 |Overlay scales up from down (simple genie effect).
42 | 43 |Genie effect with SVG animation.
43 | 44 |Overlay moves in from the bottom right corner and fades in.
42 | 43 |Overlay simply slides down with the content.
42 | 43 |Overlay scale up and fades in.
42 | 43 |Overlay opens like a door from the middle and content fades in.
42 | 43 |The page gets pushed to the side and the overlay slides in.
42 | 43 |The page scales down and the overlay slide in from the bottom.
42 | 43 |Overlay is a SVG shape that animates from the top right corner.
43 | 44 |R(e,g)||R(b,d)R(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+Q(a,c).toFixed(2)||n>+R(a,c).toFixed(2)||n<+Q(e,g).toFixed(2)||n>+R(e,g).toFixed(2)||o<+Q(b,d).toFixed(2)||o>+R(b,d).toFixed(2)||o<+Q(f,h).toFixed(2)||o>+R(f,h).toFixed(2)))return{x:l,y:m}}}}function q(a,b,c){var d=j(a),e=j(b);if(!l(d,e))return c?0:[];for(var f=n.apply(0,a),g=n.apply(0,b),h=~~(f/5),k=~~(g/5),m=[],o=[],q={},r=c?0:[],s=0;h+1>s;s++){var t=i.apply(0,a.concat(s/h));m.push({x:t.x,y:t.y,t:s/h})}for(s=0;k+1>s;s++)t=i.apply(0,b.concat(s/k)),o.push({x:t.x,y:t.y,t:s/k});for(s=0;h>s;s++)for(var u=0;k>u;u++){var v=m[s],w=m[s+1],x=o[u],y=o[u+1],z=T(w.x-v.x)<.001?"y":"x",A=T(y.x-x.x)<.001?"y":"x",B=p(v.x,v.y,w.x,w.y,x.x,x.y,y.x,y.y);if(B){if(q[B.x.toFixed(4)]==B.y.toFixed(4))continue;q[B.x.toFixed(4)]=B.y.toFixed(4);var C=v.t+T((B[z]-v[z])/(w[z]-v[z]))*(w.t-v.t),D=x.t+T((B[A]-x[A])/(y[A]-x[A]))*(y.t-x.t);C>=0&&1>=C&&D>=0&&1>=D&&(c?r++:r.push({x:B.x,y:B.y,t1:C,t2:D}))}}return r}function r(a,b){return t(a,b)}function s(a,b){return t(a,b,1)}function t(a,b,c){a=F(a),b=F(b);for(var d,e,f,g,h,i,j,k,l,m,n=c?0:[],o=0,p=a.length;p>o;o++){var r=a[o];if("M"==r[0])d=h=r[1],e=i=r[2];else{"C"==r[0]?(l=[d,e].concat(r.slice(1)),d=l[6],e=l[7]):(l=[d,e,d,e,h,i,h,i],d=h,e=i);for(var s=0,t=b.length;t>s;s++){var u=b[s];if("M"==u[0])f=j=u[1],g=k=u[2];else{"C"==u[0]?(m=[f,g].concat(u.slice(1)),f=m[6],g=m[7]):(m=[f,g,f,g,j,k,j,k],f=j,g=k);var v=q(l,m,c);if(c)n+=v;else{for(var w=0,x=v.length;x>w;w++)v[w].segment1=o,v[w].segment2=s,v[w].bez1=l,v[w].bez2=m;n=n.concat(v)}}}}}return n}function u(a,b,c){var d=v(a);return k(d,b,c)&&1==t(a,[["M",b,c],["H",d.x2+10]],1)%2}function v(a){var b=c(a);if(b.bbox)return K(b.bbox);if(!a)return d();a=F(a);for(var e,f=0,g=0,h=[],i=[],j=0,k=a.length;k>j;j++)if(e=a[j],"M"==e[0])f=e[1],g=e[2],h.push(f),i.push(g);else{var l=E(f,g,e[1],e[2],e[3],e[4],e[5],e[6]);h=h.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),f=e[5],g=e[6]}var m=Q.apply(0,h),n=Q.apply(0,i),o=R.apply(0,h),p=R.apply(0,i),q=d(m,n,o-m,p-n);return b.bbox=K(q),q}function w(a,b,c,d,f){if(f)return[["M",a+f,b],["l",c-2*f,0],["a",f,f,0,0,1,f,f],["l",0,d-2*f],["a",f,f,0,0,1,-f,f],["l",2*f-c,0],["a",f,f,0,0,1,-f,-f],["l",0,2*f-d],["a",f,f,0,0,1,f,-f],["z"]];var g=[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]];return g.toString=e,g}function x(a,b,c,d,f){if(null==f&&null==d&&(d=c),null!=f)var g=Math.PI/180,h=a+c*Math.cos(-d*g),i=a+c*Math.cos(-f*g),j=b+c*Math.sin(-d*g),k=b+c*Math.sin(-f*g),l=[["M",h,j],["A",c,c,0,+(f-d>180),0,i,k]];else l=[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]];return l.toString=e,l}function y(b){var d=c(b),g=String.prototype.toLowerCase;if(d.rel)return f(d.rel);a.is(b,"array")&&a.is(b&&b[0],"array")||(b=a.parsePathString(b));var h=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=b[0][1],j=b[0][2],k=i,l=j,m++,h.push(["M",i,j]));for(var n=m,o=b.length;o>n;n++){var p=h[n]=[],q=b[n];if(q[0]!=g.call(q[0]))switch(p[0]=g.call(q[0]),p[0]){case"a":p[1]=q[1],p[2]=q[2],p[3]=q[3],p[4]=q[4],p[5]=q[5],p[6]=+(q[6]-i).toFixed(3),p[7]=+(q[7]-j).toFixed(3);break;case"v":p[1]=+(q[1]-j).toFixed(3);break;case"m":k=q[1],l=q[2];default:for(var r=1,s=q.length;s>r;r++)p[r]=+(q[r]-(r%2?i:j)).toFixed(3)}else{p=h[n]=[],"m"==q[0]&&(k=q[1]+i,l=q[2]+j);for(var t=0,u=q.length;u>t;t++)h[n][t]=q[t]}var v=h[n].length;switch(h[n][0]){case"z":i=k,j=l;break;case"h":i+=+h[n][v-1];break;case"v":j+=+h[n][v-1];break;default:i+=+h[n][v-2],j+=+h[n][v-1]}}return h.toString=e,d.rel=f(h),h}function z(b){var d=c(b);if(d.abs)return f(d.abs);if(J(b,"array")&&J(b&&b[0],"array")||(b=a.parsePathString(b)),!b||!b.length)return[["M",0,0]];var g,h=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=+b[0][1],j=+b[0][2],k=i,l=j,m++,h[0]=["M",i,j]);for(var n,o,p=3==b.length&&"M"==b[0][0]&&"R"==b[1][0].toUpperCase()&&"Z"==b[2][0].toUpperCase(),q=m,r=b.length;r>q;q++){if(h.push(n=[]),o=b[q],g=o[0],g!=g.toUpperCase())switch(n[0]=g.toUpperCase(),n[0]){case"A":n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=+(o[6]+i),n[7]=+(o[7]+j);break;case"V":n[1]=+o[1]+j;break;case"H":n[1]=+o[1]+i;break;case"R":for(var s=[i,j].concat(o.slice(1)),t=2,u=s.length;u>t;t++)s[t]=+s[t]+i,s[++t]=+s[t]+j;h.pop(),h=h.concat(H(s,p));break;case"O":h.pop(),s=x(i,j,o[1],o[2]),s.push(s[0]),h=h.concat(s);break;case"U":h.pop(),h=h.concat(x(i,j,o[1],o[2],o[3])),n=["U"].concat(h[h.length-1].slice(-2));break;case"M":k=+o[1]+i,l=+o[2]+j;default:for(t=1,u=o.length;u>t;t++)n[t]=+o[t]+(t%2?i:j)}else if("R"==g)s=[i,j].concat(o.slice(1)),h.pop(),h=h.concat(H(s,p)),n=["R"].concat(o.slice(-2));else if("O"==g)h.pop(),s=x(i,j,o[1],o[2]),s.push(s[0]),h=h.concat(s);else if("U"==g)h.pop(),h=h.concat(x(i,j,o[1],o[2],o[3])),n=["U"].concat(h[h.length-1].slice(-2));else for(var v=0,w=o.length;w>v;v++)n[v]=o[v];if(g=g.toUpperCase(),"O"!=g)switch(n[0]){case"Z":i=k,j=l;break;case"H":i=n[1];break;case"V":j=n[1];break;case"M":k=n[n.length-2],l=n[n.length-1];default:i=n[n.length-2],j=n[n.length-1]}}return h.toString=e,d.abs=f(h),h}function A(a,b,c,d){return[a,b,c,d,c,d]}function B(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function C(b,c,d,e,f,g,h,i,j,k){var l,m=120*P/180,n=P/180*(+f||0),o=[],p=a._.cacher(function(a,b,c){var d=a*O.cos(c)-b*O.sin(c),e=a*O.sin(c)+b*O.cos(c);return{x:d,y:e}});if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(b,c,-n),b=l.x,c=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(O.cos(P/180*f),O.sin(P/180*f),(b-i)/2),r=(c-j)/2,s=q*q/(d*d)+r*r/(e*e);s>1&&(s=O.sqrt(s),d=s*d,e=s*e);var t=d*d,u=e*e,v=(g==h?-1:1)*O.sqrt(T((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*d*r/e+(b+i)/2,x=v*-e*q/d+(c+j)/2,y=O.asin(((c-x)/e).toFixed(9)),z=O.asin(((j-x)/e).toFixed(9));y=w>b?P-y:y,z=w>i?P-z:z,0>y&&(y=2*P+y),0>z&&(z=2*P+z),h&&y>z&&(y-=2*P),!h&&z>y&&(z-=2*P)}var A=z-y;if(T(A)>m){var B=z,D=i,E=j;z=y+m*(h&&z>y?1:-1),i=w+d*O.cos(z),j=x+e*O.sin(z),o=C(i,j,d,e,f,0,h,D,E,[z,B,w,x])}A=z-y;var F=O.cos(y),G=O.sin(y),H=O.cos(z),I=O.sin(z),J=O.tan(A/4),K=4/3*d*J,L=4/3*e*J,M=[b,c],N=[b+K*G,c-L*F],Q=[i+K*I,j-L*H],R=[i,j];if(N[0]=2*M[0]-N[0],N[1]=2*M[1]-N[1],k)return[N,Q,R].concat(o);o=[N,Q,R].concat(o).join().split(",");for(var S=[],U=0,V=o.length;V>U;U++)S[U]=U%2?p(o[U-1],o[U],n).y:p(o[U],o[U+1],n).x;return S}function D(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:S(j,3)*a+3*S(j,2)*i*c+3*j*i*i*e+S(i,3)*g,y:S(j,3)*b+3*S(j,2)*i*d+3*j*i*i*f+S(i,3)*h}}function E(a,b,c,d,e,f,g,h){var i,j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+O.sqrt(k*k-4*j*l))/2/j,n=(-k-O.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g];return T(m)>"1e12"&&(m=.5),T(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=D(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=D(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+O.sqrt(k*k-4*j*l))/2/j,n=(-k-O.sqrt(k*k-4*j*l))/2/j,T(m)>"1e12"&&(m=.5),T(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=D(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=D(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),{min:{x:Q.apply(0,p),y:Q.apply(0,o)},max:{x:R.apply(0,p),y:R.apply(0,o)}}}function F(a,b){var d=!b&&c(a);if(!b&&d.curve)return f(d.curve);for(var e=z(a),g=b&&z(b),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},j=(function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"].concat(C.apply(0,[b.x,b.y].concat(a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d].concat(a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"].concat(B(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"].concat(B(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"].concat(A(b.x,b.y,a[1],a[2]));break;case"H":a=["C"].concat(A(b.x,b.y,a[1],b.y));break;case"V":a=["C"].concat(A(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"].concat(A(b.x,b.y,b.X,b.Y))}return a}),k=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),n=R(e.length,g&&g.length||0)}},l=function(a,b,c,d,f){a&&b&&"M"==a[f][0]&&"M"!=b[f][0]&&(b.splice(f,0,["M",d.x,d.y]),c.bx=0,c.by=0,c.x=a[f][1],c.y=a[f][2],n=R(e.length,g&&g.length||0))},m=0,n=R(e.length,g&&g.length||0);n>m;m++){e[m]=j(e[m],h),k(e,m),g&&(g[m]=j(g[m],i)),g&&k(g,m),l(e,g,h,i,m),l(g,e,i,h,m);var o=e[m],p=g&&g[m],q=o.length,r=g&&p.length;h.x=o[q-2],h.y=o[q-1],h.bx=N(o[q-4])||h.x,h.by=N(o[q-3])||h.y,i.bx=g&&(N(p[r-4])||i.x),i.by=g&&(N(p[r-3])||i.y),i.x=g&&p[r-2],i.y=g&&p[r-1]}return g||(d.curve=f(e)),g?[e,g]:e}function G(a,b){if(!b)return a;var c,d,e,f,g,h,i;for(a=F(a),e=0,g=a.length;g>e;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a}function H(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}var I=b.prototype,J=a.is,K=a._.clone,L="hasOwnProperty",M=/,?([a-z]),?/gi,N=parseFloat,O=Math,P=O.PI,Q=O.min,R=O.max,S=O.pow,T=O.abs,U=h(1),V=h(),W=h(0,1),X=a._unit2px,Y={path:function(a){return a.attr("path")},circle:function(a){var b=X(a);return x(b.cx,b.cy,b.r)},ellipse:function(a){var b=X(a);return x(b.cx,b.cy,b.rx,b.ry)},rect:function(a){var b=X(a);return w(b.x,b.y,b.width,b.height,b.rx,b.ry)},image:function(a){var b=X(a);return w(b.x,b.y,b.width,b.height)},text:function(a){var b=a.node.getBBox();return w(b.x,b.y,b.width,b.height)},g:function(a){var b=a.node.getBBox();return w(b.x,b.y,b.width,b.height)},symbol:function(a){var b=a.getBBox();return w(b.x,b.y,b.width,b.height)},line:function(a){return"M"+[a.attr("x1"),a.attr("y1"),a.attr("x2"),a.attr("y2")]},polyline:function(a){return"M"+a.attr("points")},polygon:function(a){return"M"+a.attr("points")+"z"},svg:function(a){var b=a.node.getBBox();return w(b.x,b.y,b.width,b.height)},deflt:function(a){var b=a.node.getBBox();return w(b.x,b.y,b.width,b.height)}};a.path=c,a.path.getTotalLength=U,a.path.getPointAtLength=V,a.path.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return W(a,b).end;var d=W(a,c,1);return b?W(d,b).end:d},I.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},I.getPointAtLength=function(a){return V(this.attr("d"),a)},I.getSubpath=function(b,c){return a.path.getSubpath(this.attr("d"),b,c)},a._.box=d,a.path.findDotsAtSegment=i,a.path.bezierBBox=j,a.path.isPointInsideBBox=k,a.path.isBBoxIntersect=l,a.path.intersection=r,a.path.intersectionNumber=s,a.path.isPointInside=u,a.path.getBBox=v,a.path.get=Y,a.path.toRelative=y,a.path.toAbsolute=z,a.path.toCubic=F,a.path.map=G,a.path.toString=e,a.path.clone=f}),d.plugin(function(a){var b=Math.max,c=Math.min,d=function(a){if(this.items=[],this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)a[b]&&(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},e=d.prototype;e.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],a&&(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},e.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},e.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this},e.remove=function(){for(;this.length;)this.pop().remove();return this},e.attr=function(a){for(var b=0,c=this.items.length;c>b;b++)this.items[b].attr(a);return this},e.clear=function(){for(;this.length;)this.pop()},e.splice=function(a,e){a=0>a?b(this.length+a,0):a,e=b(0,c(this.length-a,e));var f,g=[],h=[],i=[];for(f=2;ff;f++)h.push(this[a+f]);for(;f f?i[f]:g[f-j];for(f=this.items.length=this.length-=e-j;this[f];)delete this[f++];return new d(h)},e.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0;return!1},e.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},e.getBBox=function(){for(var a=[],d=[],e=[],f=[],g=this.items.length;g--;)if(!this.items[g].removed){var h=this.items[g].getBBox();a.push(h.x),d.push(h.y),e.push(h.x+h.width),f.push(h.y+h.height)}return a=c.apply(0,a),d=c.apply(0,d),e=b.apply(0,e),f=b.apply(0,f),{x:a,y:d,x2:e,y2:f,width:e-a,height:f-d,cx:a+(e-a)/2,cy:d+(f-d)/2}},e.clone=function(a){a=new d;for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},e.toString=function(){return"Snap‘s set"},e.type="set",a.set=function(){var a=new d;return arguments.length&&a.push.apply(a,Array.prototype.slice.call(arguments,0)),a}}),d.plugin(function(a,b){function c(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}}function d(b,d,e){d=l(d).replace(/\.{3}|\u2026/g,b),b=a.parseTransformString(b)||[],d=a.parseTransformString(d)||[];for(var f,g,j,k,m=Math.max(b.length,d.length),n=[],o=[],p=0;m>p;p++){if(j=b[p]||c(d[p]),k=d[p]||c(j),j[0]!=k[0]||"r"==j[0].toLowerCase()&&(j[2]!=k[2]||j[3]!=k[3])||"s"==j[0].toLowerCase()&&(j[3]!=k[3]||j[4]!=k[4])){b=a._.transform2matrix(b,e()),d=a._.transform2matrix(d,e()),n=[["m",b.a,b.b,b.c,b.d,b.e,b.f]],o=[["m",d.a,d.b,d.c,d.d,d.e,d.f]];break}for(n[p]=[],o[p]=[],f=0,g=Math.max(j.length,k.length);g>f;f++)f in j&&(n[p][f]=j[f]),f in k&&(o[p][f]=k[f])}return{from:i(n),to:i(o),f:h(n)}}function e(a){return a}function f(a){return function(b){return+b.toFixed(3)+a}}function g(b){return a.rgb(b[0],b[1],b[2])}function h(a){var b,c,d,e,f,g,h=0,i=[];for(b=0,c=a.length;c>b;b++){for(f="[",g=['"'+a[b][0]+'"'],d=1,e=a[b].length;e>d;d++)g[d]="val["+h++ +"]";f+=g+"]",i[b]=f}return Function("val","return Snap.path.toString.call(["+i+"])")}function i(a){for(var b=[],c=0,d=a.length;d>c;c++)for(var e=1,f=a[c].length;f>e;e++)b.push(a[c][e]);return b}var j={},k=/[a-z]+$/i,l=String;j.stroke=j.fill="colour",b.prototype.equal=function(b,c){var m,n,o=l(this.attr(b)||""),p=this;if(o==+o&&c==+c)return{from:+o,to:+c,f:e};if("colour"==j[b])return m=a.color(o),n=a.color(c),{from:[m.r,m.g,m.b,m.opacity],to:[n.r,n.g,n.b,n.opacity],f:g};if("transform"==b||"gradientTransform"==b||"patternTransform"==b)return c instanceof a.Matrix&&(c=c.toTransformString()),a._.rgTransform.test(c)||(c=a._.svgTransform2string(c)),d(o,c,function(){return p.getBBox(1)});if("d"==b||"path"==b)return m=a.path.toCubic(o,c),{from:i(m[0]),to:i(m[1]),f:h(m[0])};if("points"==b)return m=l(o).split(","),n=l(c).split(","),{from:m,to:n,f:function(a){return a}};var q=o.match(k),r=l(c).match(k);return q&&q==r?{from:parseFloat(o),to:parseFloat(c),f:f(q)}:{from:this.asPX(b),to:this.asPX(b,c),f:e}}}),d.plugin(function(a,c,d,e){for(var f=c.prototype,g="hasOwnProperty",h=("createTouch"in e.doc),i=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],j={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},k=function(a){var b="y"==a?"scrollTop":"scrollLeft";return e.doc.documentElement[b]||e.doc.body[b]},l=function(){this.returnValue=!1},m=function(){return this.originalEvent.preventDefault()},n=function(){this.cancelBubble=!0},o=function(){return this.originalEvent.stopPropagation()},p=function(){return e.doc.addEventListener?function(a,b,c,d){var e=h&&j[b]?j[b]:b,f=function(e){var f=k("y"),i=k("x");if(h&&j[g](b))for(var l=0,n=e.targetTouches&&e.targetTouches.length;n>l;l++)if(e.targetTouches[l].target==a||a.contains(e.targetTouches[l].target)){var p=e;e=e.targetTouches[l],e.originalEvent=p,e.preventDefault=m,e.stopPropagation=o;break}var q=e.clientX+i,r=e.clientY+f;return c.call(d,e,q,r)};return b!==e&&a.addEventListener(b,f,!1),a.addEventListener(e,f,!1),function(){return b!==e&&a.removeEventListener(b,f,!1),a.removeEventListener(e,f,!1),!0}}:e.doc.attachEvent?function(a,b,c,d){var f=function(a){a=a||e.win.event;var b=k("y"),f=k("x"),g=a.clientX+f,h=a.clientY+b;return a.preventDefault=a.preventDefault||l,a.stopPropagation=a.stopPropagation||n,c.call(d,a,g,h)};a.attachEvent("on"+b,f);var g=function(){return a.detachEvent("on"+b,f),!0};return g}:void 0}(),q=[],r=function(c){for(var d,e=c.clientX,f=c.clientY,g=k("y"),i=k("x"),j=q.length;j--;){if(d=q[j],h){for(var l,m=c.touches&&c.touches.length;m--;)if(l=c.touches[m],l.identifier==d.el._drag.id||d.el.node.contains(l.target)){e=l.clientX,f=l.clientY,(c.originalEvent?c.originalEvent:c).preventDefault();break}}else c.preventDefault();var n=d.el.node;a._.glob,n.nextSibling,n.parentNode,n.style.display,e+=i,f+=g,b("snap.drag.move."+d.el.id,d.move_scope||d.el,e-d.el._drag.x,f-d.el._drag.y,e,f,c)}},s=function(c){a.unmousemove(r).unmouseup(s);for(var d,e=q.length;e--;)d=q[e],d.el._drag={},b("snap.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,c);q=[]},t=i.length;t--;)!function(b){a[b]=f[b]=function(c,d){return a.is(c,"function")&&(this.events=this.events||[],this.events.push({name:b,f:c,unbind:p(this.shape||this.node||e.doc,b,c,d||this)})),this},a["un"+b]=f["un"+b]=function(a){for(var c=this.events||[],d=c.length;d--;)if(c[d].name==b&&(c[d].f==a||!a))return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}}(i[t]);f.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},f.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var u=[];f.drag=function(c,d,e,f,g,h){function i(i,j,k){(i.originalEvent||i).preventDefault(),this._drag.x=j,this._drag.y=k,this._drag.id=i.identifier,!q.length&&a.mousemove(r).mouseup(s),q.push({el:this,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("snap.drag.start."+this.id,d),c&&b.on("snap.drag.move."+this.id,c),e&&b.on("snap.drag.end."+this.id,e),b("snap.drag.start."+this.id,g||f||this,j,k,i)}if(!arguments.length){var j;return this.drag(function(a,b){this.attr({transform:j+(j?"T":"t")+[a,b]})},function(){j=this.transform().local})}return this._drag={},u.push({el:this,start:i}),this.mousedown(i),this},f.undrag=function(){for(var c=u.length;c--;)u[c].el==this&&(this.unmousedown(u[c].start),u.splice(c,1),b.unbind("snap.drag.*."+this.id));return!u.length&&a.unmousemove(r).unmouseup(s),this}}),d.plugin(function(a,c,d){var e=(c.prototype,d.prototype),f=/^\s*url\((.+)\)/,g=String,h=a._.$;a.filter={},e.filter=function(b){var d=this;"svg"!=d.type&&(d=d.paper);var e=a.parse(g(b)),f=a._.id(),i=(d.node.offsetWidth,d.node.offsetHeight,h("filter"));return h(i,{id:f,filterUnits:"userSpaceOnUse"}),i.appendChild(e.node),d.defs.appendChild(i),new c(i)},b.on("snap.util.getattr.filter",function(){b.stop();var c=h(this.node,"filter");if(c){var d=g(c).match(f);return d&&a.select(d[1])}}),b.on("snap.util.attr.filter",function(d){if(d instanceof c&&"filter"==d.type){b.stop();var e=d.node.id;e||(h(d.node,{id:d.id}),e=d.id),h(this.node,{filter:a.url(e)})}d&&"none"!=d||(b.stop(),this.node.removeAttribute("filter"))}),a.filter.blur=function(b,c){null==b&&(b=2);var d=null==c?b:[b,c];return a.format(' ',{def:d})},a.filter.blur.toString=function(){return this()},a.filter.shadow=function(b,c,d,e){return e=e||"#000",null==d&&(d=4),"string"==typeof d&&(e=d,d=4),null==b&&(b=0,c=2),null==c&&(c=b),e=a.color(e),a.format(' ',{color:e,dx:b,dy:c,blur:d}) 20 | },a.filter.shadow.toString=function(){return this()},a.filter.grayscale=function(b){return null==b&&(b=1),a.format(' ',{a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},a.filter.grayscale.toString=function(){return this()},a.filter.sepia=function(b){return null==b&&(b=1),a.format(' ',{a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},a.filter.sepia.toString=function(){return this()},a.filter.saturate=function(b){return null==b&&(b=1),a.format(' ',{amount:1-b})},a.filter.saturate.toString=function(){return this()},a.filter.hueRotate=function(b){return b=b||0,a.format(' ',{angle:b})},a.filter.hueRotate.toString=function(){return this()},a.filter.invert=function(b){return null==b&&(b=1),a.format(' ',{amount:b,amount2:1-b})},a.filter.invert.toString=function(){return this()},a.filter.brightness=function(b){return null==b&&(b=1),a.format(' ',{amount:b})},a.filter.brightness.toString=function(){return this()},a.filter.contrast=function(b){return null==b&&(b=1),a.format(' ',{amount:b,amount2:.5-b/2})},a.filter.contrast.toString=function(){return this()}}),d}); --------------------------------------------------------------------------------