├── LICENSE ├── README.md ├── box.png ├── buttons.css ├── cloud.png ├── darkCloud.png ├── explosion.png ├── explosion2.png ├── index.html ├── smoke.png └── troll.png /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jaume Sanchez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CSS3D Clouds 2 | =========== 3 | 4 | Demo: http://clicktorelease.com/code/css3dclouds 5 | 6 | Tutorial: https://www.clicktorelease.com/blog/how-to-make-clouds-with-css-3d/ 7 | 8 | -------------------------------------------------------------------------------- /box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spite/CSS3DClouds/c062c4e2972318fe7684f2defa544f34581fe0ca/box.png -------------------------------------------------------------------------------- /buttons.css: -------------------------------------------------------------------------------- 1 | .button { 2 | display: inline-block; 3 | padding: 7px 9px; 4 | font-size: inherit; 5 | color: #3c3c3d; 6 | text-shadow: 1px 1px 0 #ffffff; 7 | background: #ececec; 8 | white-space: nowrap; 9 | overflow: visible; 10 | cursor: pointer; 11 | text-decoration: none; 12 | border: 1px solid #cacaca; 13 | -webkit-border-radius: 2px; 14 | -moz-border-radius: 2px; 15 | -webkit-background-clip: padding-box; 16 | border-radius: 2px; 17 | outline: none; 18 | position: relative; 19 | zoom: 1; 20 | *display: inline; 21 | } 22 | .button.primary { 23 | font-weight: bold; 24 | } 25 | .button:hover { 26 | color: #ffffff; 27 | border-color: #388ad4; 28 | text-decoration: none; 29 | text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3); 30 | background-position: 0 -40px; 31 | background-color: #2d7dc5; 32 | } 33 | .button:active, 34 | .button.active { 35 | background-position: 0 -81px; 36 | border-color: #347bba; 37 | background-color: #0f5ea2; 38 | color: #ffffff; 39 | text-shadow: none; 40 | } 41 | .button:active { 42 | top: 1px; 43 | } 44 | .button.negative:hover { 45 | color: #ffffff; 46 | background-position: 0 -121px; 47 | background-color: #d84743; 48 | border-color: #911d1b; 49 | } 50 | .button.negative:active, 51 | .button.negative.active { 52 | background-position: 0 -161px; 53 | background-color: #a5211e; 54 | border-color: #911d1b; 55 | } 56 | .button.pill { 57 | -webkit-border-radius: 19px; 58 | -moz-border-radius: 19px; 59 | border-radius: 19px; 60 | padding: 6px 12px; 61 | } 62 | .button.left { 63 | -webkit-border-bottom-right-radius: 0px; 64 | -webkit-border-top-right-radius: 0px; 65 | -moz-border-radius-bottomright: 0px; 66 | -moz-border-radius-topright: 0px; 67 | border-bottom-right-radius: 0px; 68 | border-top-right-radius: 0px; 69 | margin-right: 0px; 70 | } 71 | .button.middle { 72 | margin-right: 0px; 73 | margin-left: 0px; 74 | -webkit-border-radius: 0px; 75 | -moz-border-radius: 0px; 76 | border-radius: 0px; 77 | border-left: none; 78 | } 79 | .button.right { 80 | -webkit-border-bottom-left-radius: 0px; 81 | -webkit-border-top-left-radius: 0px; 82 | -moz-border-radius-bottomleft: 0px; 83 | -moz-border-radius-topleft: 0px; 84 | border-top-left-radius: 0px; 85 | border-bottom-left-radius: 0px; 86 | margin-left: 0px; 87 | border-left: none; 88 | } 89 | .button.left:active, 90 | .button.middle:active, 91 | .button.right:active { 92 | top: 0px; 93 | } 94 | .button.big { 95 | font-size: 16px; 96 | padding: 7px 16px; 97 | } 98 | .button span.icon { 99 | display: inline-block; 100 | width: 14px; 101 | height: 12px; 102 | margin: auto 7px auto auto; 103 | position: relative; 104 | top: 1px; 105 | background-image: url("/images/css3buttons_icons.png"); 106 | background-repeat: no-repeat; 107 | } 108 | .big.button span.icon { 109 | top: 0px; 110 | } 111 | .button span.icon.book { 112 | background-position: 0 0; 113 | } 114 | .button:hover span.icon.book { 115 | background-position: 0 -15px; 116 | } 117 | .button span.icon.calendar { 118 | background-position: 0 -30px; 119 | } 120 | .button:hover span.icon.calendar { 121 | background-position: 0 -45px; 122 | } 123 | .button span.icon.chat { 124 | background-position: 0 -60px; 125 | } 126 | .button:hover span.icon.chat { 127 | background-position: 0 -75px; 128 | } 129 | .button span.icon.check { 130 | background-position: 0 -90px; 131 | } 132 | .button:hover span.icon.check { 133 | background-position: 0 -103px; 134 | } 135 | .button span.icon.clock { 136 | background-position: 0 -116px; 137 | } 138 | .button:hover span.icon.clock { 139 | background-position: 0 -131px; 140 | } 141 | .button span.icon.cog { 142 | background-position: 0 -146px; 143 | } 144 | .button:hover span.icon.cog { 145 | background-position: 0 -161px; 146 | } 147 | .button span.icon.comment { 148 | background-position: 0 -176px; 149 | } 150 | .button:hover span.icon.comment { 151 | background-position: 0 -190px; 152 | } 153 | .button span.icon.cross { 154 | background-position: 0 -204px; 155 | } 156 | .button:hover span.icon.cross { 157 | background-position: 0 -219px; 158 | } 159 | .button span.icon.downarrow { 160 | background-position: 0 -234px; 161 | } 162 | .button:hover span.icon.downarrow { 163 | background-position: 0 -249px; 164 | } 165 | .button span.icon.fork { 166 | background-position: 0 -264px; 167 | } 168 | .button:hover span.icon.fork { 169 | background-position: 0 -279px; 170 | } 171 | .button span.icon.heart { 172 | background-position: 0 -294px; 173 | } 174 | .button:hover span.icon.heart { 175 | background-position: 0 -308px; 176 | } 177 | .button span.icon.home { 178 | background-position: 0 -322px; 179 | } 180 | .button:hover span.icon.home { 181 | background-position: 0 -337px; 182 | } 183 | .button span.icon.key { 184 | background-position: 0 -352px; 185 | } 186 | .button:hover span.icon.key { 187 | background-position: 0 -367px; 188 | } 189 | .button span.icon.leftarrow { 190 | background-position: 0 -382px; 191 | } 192 | .button:hover span.icon.leftarrow { 193 | background-position: 0 -397px; 194 | } 195 | .button span.icon.lock { 196 | background-position: 0 -412px; 197 | } 198 | .button:hover span.icon.lock { 199 | background-position: 0 -427px; 200 | } 201 | .button span.icon.loop { 202 | background-position: 0 -442px; 203 | } 204 | .button:hover span.icon.loop { 205 | background-position: 0 -457px; 206 | } 207 | .button span.icon.magnifier { 208 | background-position: 0 -472px; 209 | } 210 | .button:hover span.icon.magnifier { 211 | background-position: 0 -487px; 212 | } 213 | .button span.icon.mail { 214 | background-position: 0 -502px; 215 | } 216 | .button:hover span.icon.mail { 217 | background-position: 0 -514px; 218 | } 219 | .button span.icon.move { 220 | background-position: 0 -526px; 221 | } 222 | .button:hover span.icon.move { 223 | background-position: 0 -541px; 224 | } 225 | .button span.icon.pen { 226 | background-position: 0 -556px; 227 | } 228 | .button:hover span.icon.pen { 229 | background-position: 0 -571px; 230 | } 231 | .button span.icon.pin { 232 | background-position: 0 -586px; 233 | } 234 | .button:hover span.icon.pin { 235 | background-position: 0 -601px; 236 | } 237 | .button span.icon.plus { 238 | background-position: 0 -616px; 239 | } 240 | .button:hover span.icon.plus { 241 | background-position: 0 -631px; 242 | } 243 | .button span.icon.reload { 244 | background-position: 0 -646px; 245 | } 246 | .button:hover span.icon.reload { 247 | background-position: 0 -660px; 248 | } 249 | .button span.icon.rightarrow { 250 | background-position: 0 -674px; 251 | } 252 | .button:hover span.icon.rightarrow { 253 | background-position: 0 -689px; 254 | } 255 | .button span.icon.rss { 256 | background-position: 0 -704px; 257 | } 258 | .button:hover span.icon.rss { 259 | background-position: 0 -719px; 260 | } 261 | .button span.icon.tag { 262 | background-position: 0 -734px; 263 | } 264 | .button:hover span.icon.tag { 265 | background-position: 0 -749px; 266 | } 267 | .button span.icon.trash { 268 | background-position: 0 -764px; 269 | } 270 | .button:hover span.icon.trash { 271 | background-position: 0 -779px; 272 | } 273 | .button span.icon.unlock { 274 | background-position: 0 -794px; 275 | } 276 | .button:hover span.icon.unlock { 277 | background-position: 0 -809px; 278 | } 279 | .button span.icon.uparrow { 280 | background-position: 0 -824px; 281 | } 282 | .button:hover span.icon.uparrow { 283 | background-position: 0 -839px; 284 | } 285 | .button span.icon.user { 286 | background-position: 0 -854px; 287 | } 288 | .button:hover span.icon.user { 289 | background-position: 0 -869px; 290 | } 291 | -------------------------------------------------------------------------------- /cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spite/CSS3DClouds/c062c4e2972318fe7684f2defa544f34581fe0ca/cloud.png -------------------------------------------------------------------------------- /darkCloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spite/CSS3DClouds/c062c4e2972318fe7684f2defa544f34581fe0ca/darkCloud.png -------------------------------------------------------------------------------- /explosion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spite/CSS3DClouds/c062c4e2972318fe7684f2defa544f34581fe0ca/explosion.png -------------------------------------------------------------------------------- /explosion2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spite/CSS3DClouds/c062c4e2972318fe7684f2defa544f34581fe0ca/explosion2.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |228 | An experiment on creating volumetric 3d-like 229 | clouds with CSS3 3D Transforms and a bit of Javascript. 230 |
231 |232 | Check out the tutorial here! 238 |
239 |240 | Move the mouse to rotate around and 241 | mouse wheel to zoom in and out. Hit space to generate a 242 | new cloud. Works on Firefox (faster if Nightly), 243 | Chrome and Safari. 244 |
245 | 252 |255 | Select one or more textures to create clouds. The more the merrier! 256 | Click Generate to update. 257 |
258 |
270 | Coded by Jaume Sánchez (@thespite)
275 | Code available in
276 | GitHub
279 | Inspired on Mr.doob's
280 | WebGL clouds
281 | and
Mark J. Harris'
282 | Real-Time Cloud Rendering for Games.
287 | Fonts Open Sans and Lato are from
288 | Google Web Fonts.
291 | Textures are property of their respective owners.
292 |