is like, you know, night. 127 |
Tooltip Animations
35 |Some ideas for tooltip shapes and animations
36 | /Github 37 |is like, you know, night. 127 |
├── .gitignore ├── README.md ├── css ├── component.css ├── demo.css └── normalize.css ├── favicon.ico ├── img └── related │ ├── ElasticProgress.jpg │ └── TooltipStyles.jpg ├── index.html └── js ├── anime.min.js ├── charming.min.js └── main.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tooltip Animations 2 | 3 | Some little ideas for bouncy and playful tooltip shapes and animations with SVG and anime.js. Among other styles, we use shape morphing and transform. 4 | 5 |  6 | 7 | [Article on Codrops](https://tympanus.net/codrops/?p=31283) 8 | 9 | [Demo](http://tympanus.net/Development/TooltipAnimations/) 10 | 11 | ## Credits 12 | 13 | - [Anime.js](https://github.com/juliangarnier/anime) by Julian Garnier 14 | - [Charming.js](https://github.com/yuanqing/charming) by Yuan Qing 15 | 16 | ## License 17 | This resource can be used freely if integrated or build upon in personal or commercial projects such as websites, web apps and web templates intended for sale. It is not allowed to take the resource "as-is" and sell it, redistribute, re-publish it, or sell "pluginized" versions of it. Free plugins built using this resource should have a visible mention and link to the original work. Always consider the licenses of all included libraries, scripts and images used. 18 | 19 | ## Misc 20 | 21 | Follow Codrops: [Twitter](http://www.twitter.com/codrops), [Facebook](http://www.facebook.com/codrops), [Google+](https://plus.google.com/101095823814290637419), [GitHub](https://github.com/codrops), [Pinterest](http://www.pinterest.com/codrops/), [Instagram](https://www.instagram.com/codropsss/) 22 | 23 | [© Codrops 2017](http://www.codrops.com) 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /css/component.css: -------------------------------------------------------------------------------- 1 | .tooltip { 2 | position: relative; 3 | display: inline-block; 4 | } 5 | 6 | .tooltip__trigger { 7 | cursor: pointer; 8 | position: relative; 9 | } 10 | 11 | .tooltip__trigger-text { 12 | display: block; 13 | padding: 0.85em; 14 | pointer-events: none; 15 | } 16 | 17 | .tooltip__base { 18 | position: absolute; 19 | bottom: 2em; 20 | left: 50%; 21 | margin-left: -150px; 22 | width: 300px; 23 | height: 200px; 24 | display: flex; 25 | align-items: center; 26 | justify-content: center; 27 | opacity: 0; 28 | pointer-events: none; 29 | } 30 | 31 | .tooltip__content { 32 | color: #4a4a4a; 33 | display: flex; 34 | position: relative; 35 | align-items: center; 36 | justify-content: center; 37 | width: 65%; 38 | padding: 0 1em; 39 | opacity: 0; 40 | font-size: 0.85em; 41 | } 42 | 43 | .tooltip__shape, 44 | .tooltip__deco { 45 | position: absolute; 46 | width: 100%; 47 | height: 100%; 48 | top: 0; 49 | left: 0; 50 | } 51 | 52 | .tooltip__shape { 53 | fill: #141514; 54 | } 55 | 56 | /* Indivudual styles */ 57 | 58 | /* Cora */ 59 | .tooltip--cora .tooltip__base{ 60 | transform-origin: 50% 100%; 61 | } 62 | 63 | .tooltip--cora .tooltip__content { 64 | margin-bottom: 1em; 65 | } 66 | 67 | /* Smaug */ 68 | .tooltip--smaug .tooltip__base { 69 | bottom: -0.5em; 70 | transform-origin: 50% 100%; 71 | } 72 | 73 | .tooltip--smaug .tooltip__content { 74 | padding: 0; 75 | } 76 | 77 | /* Dori */ 78 | .tooltip--dori .tooltip__base { 79 | bottom: -0.5em; 80 | } 81 | 82 | .tooltip--dori .tooltip__content { 83 | margin: 0 0 1em; 84 | } 85 | 86 | /* Walda */ 87 | .tooltip--walda .tooltip__base { 88 | left: 0; 89 | bottom: 0.75em; 90 | position: absolute; 91 | margin-left: 0; 92 | width: 250px; 93 | height: 100px; 94 | padding: 0 0 0 0.25em; 95 | } 96 | 97 | .tooltip--walda .tooltip__trigger-text { 98 | padding: 1em; 99 | } 100 | 101 | .tooltip--walda .tooltip__content { 102 | margin: 0; 103 | width: 100%; 104 | height: 100%; 105 | align-items: flex-start; 106 | text-align: left; 107 | font-size: 0.85em; 108 | line-height: 2; 109 | opacity: 1; 110 | justify-content: flex-start; 111 | } 112 | 113 | .tooltip--walda .tooltip__letters span { 114 | display: inline-block; 115 | white-space: pre; 116 | opacity: 0; 117 | } 118 | 119 | .tooltip--walda .tooltip__deco { 120 | width: 4px; 121 | height: 100%; 122 | background: #141514; 123 | transform-origin: 50% 100%; 124 | } 125 | 126 | /* Gram */ 127 | .tooltip--gram .tooltip__base { 128 | bottom: -0.5em; 129 | } 130 | 131 | /* Narvi */ 132 | .path-narvi { 133 | transform-origin: 200px 150px; 134 | } 135 | 136 | .tooltip--narvi .tooltip__content { 137 | width: 80%; 138 | } 139 | 140 | /* Amras */ 141 | .path-amras-1 { 142 | transform-origin: 115px 111px; 143 | } 144 | 145 | .path-amras-2 { 146 | transform-origin: 204px 107px; 147 | } 148 | 149 | .path-amras-3 { 150 | transform-origin: 279px 66px; 151 | } 152 | 153 | .path-amras-4 { 154 | transform-origin: 320px 99px; 155 | } 156 | 157 | .path-amras-5 { 158 | transform-origin: 137px 199px; 159 | } 160 | 161 | .path-amras-6 { 162 | transform-origin: 222px 217px; 163 | } 164 | 165 | .path-amras-7 { 166 | transform-origin: 80px 168px; 167 | } 168 | 169 | .path-amras-8 { 170 | transform-origin: 296px 211px; 171 | } 172 | 173 | .path-amras-9 { 174 | transform-origin: 310px 167px; 175 | } 176 | 177 | /* Hador */ 178 | .tooltip--hador .tooltip__base { 179 | bottom: 2.25em; 180 | margin-left: -115px; 181 | } 182 | 183 | .path-hador-1 { 184 | transform-origin: 148px 284px; 185 | } 186 | 187 | .path-hador-2 { 188 | transform-origin: 160px 268px; 189 | } 190 | 191 | .path-hador-3 { 192 | transform-origin: 171px 246px; 193 | } 194 | 195 | .path-hador-4 { 196 | transform-origin: 200px 120px; 197 | } 198 | 199 | .tooltip--hador .tooltip__content { 200 | width: 50%; 201 | margin: 0 0 2.5em; 202 | } 203 | 204 | /* Malva */ 205 | .tooltip--malva .tooltip__content { 206 | width: 50%; 207 | } 208 | 209 | /* Sadoc */ 210 | .tooltip--sadoc .tooltip__base { 211 | bottom: 2.5em; 212 | } 213 | 214 | .tooltip--sadoc .tooltip__shape path { 215 | fill: #1d1f1e; 216 | stroke: #5a5c5b; 217 | stroke-width: 3px; 218 | } 219 | 220 | -------------------------------------------------------------------------------- /css/demo.css: -------------------------------------------------------------------------------- 1 | *, 2 | *::after, 3 | *::before { 4 | -webkit-box-sizing: border-box; 5 | box-sizing: border-box; 6 | } 7 | 8 | body { 9 | font-family: 'Overpass Mono', monospace; 10 | color: #666; 11 | background: #1d1f1e; 12 | } 13 | 14 | a { 15 | text-decoration: none; 16 | color: #6fbb95; 17 | outline: none; 18 | } 19 | 20 | a:hover, 21 | a:focus { 22 | color: #fff; 23 | } 24 | 25 | .hidden { 26 | position: absolute; 27 | overflow: hidden; 28 | width: 0; 29 | height: 0; 30 | pointer-events: none; 31 | } 32 | 33 | /* Icons */ 34 | .icon { 35 | display: block; 36 | width: 1.5em; 37 | height: 1.5em; 38 | margin: 0 auto; 39 | fill: currentColor; 40 | } 41 | 42 | /* Header */ 43 | .codrops-header { 44 | display: flex; 45 | flex-direction: row; 46 | flex-wrap: wrap; 47 | align-items: center; 48 | width: 100%; 49 | padding: 1.5em 1.5em 4em; 50 | text-align: left; 51 | } 52 | 53 | .codrops-header__title { 54 | font-size: 1.15em; 55 | margin: 0; 56 | padding: 0 0.5em; 57 | } 58 | 59 | .github { 60 | font-size: 0.85em; 61 | font-weight: bold; 62 | } 63 | 64 | .codrops-header__tagline { 65 | font-size: 0.85em; 66 | width: 100%; 67 | margin: 0 0 0.5em; 68 | color: #989898; 69 | } 70 | 71 | .codrops-header__tagline::before { 72 | content: '> '; 73 | } 74 | 75 | /* Top Navigation Style */ 76 | .codrops-links { 77 | position: relative; 78 | display: flex; 79 | justify-content: center; 80 | text-align: center; 81 | white-space: nowrap; 82 | } 83 | 84 | .codrops-links::after { 85 | content: ''; 86 | position: absolute; 87 | top: 20%; 88 | left: 50%; 89 | width: 1px; 90 | height: 60%; 91 | background: #b0adad; 92 | transform: rotate3d(0, 0, 1, 22.5deg); 93 | } 94 | 95 | .codrops-icon { 96 | display: inline-block; 97 | margin: 0.25em 0 0.25em 0.25em; 98 | padding: 0.35em 0 0.35em 0.35em; 99 | } 100 | 101 | .codrops-icon:first-child { 102 | margin: 0.25em 0.25em 0.25em 0; 103 | padding: 0.35em 0.35em 0.35em 0; 104 | } 105 | 106 | /* Grid */ 107 | .grid { 108 | display: grid; 109 | max-width: 1100px; 110 | margin: 0 auto; 111 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 112 | grid-auto-rows: 260px; 113 | } 114 | 115 | .grid__item { 116 | padding: 1em; 117 | text-align: center; 118 | display: grid; 119 | align-items: center; 120 | justify-items: center; 121 | } 122 | 123 | /* Content */ 124 | .content { 125 | padding: 5em 0 3em; 126 | -webkit-touch-callout: none; 127 | -ms-user-select: none; 128 | -webkit-user-select: none; 129 | -moz-user-select: none; 130 | user-select: none; 131 | } 132 | 133 | /* Related demos */ 134 | .content--related { 135 | text-align: center; 136 | font-size: 0.85em; 137 | padding: 3em 1em 6em; 138 | } 139 | 140 | .media-item { 141 | display: inline-block; 142 | padding: 1em; 143 | vertical-align: top; 144 | transition: color 0.3s; 145 | } 146 | 147 | .media-item__img { 148 | max-width: 100%; 149 | opacity: 0.8; 150 | transition: opacity 0.3s; 151 | } 152 | 153 | .media-item:hover .media-item__img, 154 | .media-item:focus .media-item__img { 155 | opacity: 1; 156 | } 157 | 158 | .media-item__title { 159 | font-size: 1em; 160 | margin: 0; 161 | padding: 0.5em; 162 | } 163 | 164 | @media screen and (max-width: 40em) { 165 | .codrops-header { 166 | display: block; 167 | text-align: center; 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /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;} -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/TooltipAnimations/7d002add564cc6b5c3da7be907c91f83b8004fb0/favicon.ico -------------------------------------------------------------------------------- /img/related/ElasticProgress.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/TooltipAnimations/7d002add564cc6b5c3da7be907c91f83b8004fb0/img/related/ElasticProgress.jpg -------------------------------------------------------------------------------- /img/related/TooltipStyles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/TooltipAnimations/7d002add564cc6b5c3da7be907c91f83b8004fb0/img/related/TooltipStyles.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |Some ideas for tooltip shapes and animations
36 | /Github 37 |