public
Last active

A CodePen by atomicpages.

  • Download Gist
index.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
<div class="snowman">
<div class="head">
<div class="eyes">
<div class="eye left"></div>
<div class="eye right"></div>
</div>
<div class="nose">
<div class="inner"></div>
</div>
<div class="mouth">
<div class="inner"></div>
</div>
</div>
<div class="arm left">
<div class="hand">
<div class="finger one"></div>
<div class="finger two"></div>
<div class="finger three"></div>
</div>
</div>
<div class="arm right">
<div class="hand">
<div class="finger one"></div>
<div class="finger two"></div>
<div class="finger three"></div>
</div>
</div>
<div class="middle">
<div class="inner">
<div class="button top">
<div class="highlight"></div>
</div>
<div class="button center">
<div class="highlight"></div>
</div>
<div class="button floor">
<div class="highlight"></div>
</div>
</div>
</div>
<div class="bottom">
<div class="inner">
<div class="button top">
<div class="highlight"></div>
</div>
<div class="button floor">
<div class="highlight"></div>
</div>
</div>
</div>
</div>
script.js
JavaScript
1 2 3 4
document.body.className = "lightBg";
$('.collectonme').hide();
$(document).snowfall('clear');
$(document).snowfall({shadow : true, round : true, minSize: 5, maxSize:8}); // add shadows
style.scss
SCSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
@import "compass/css3";
 
body { background: #666; }
 
// CHANGE ME!!
$base: 300px;
 
// VARIABLES
$snowColor: #f0f0f0;
// $snowColor: gray;
$buttonColor: #0e74bc;
$eyeColor: black;
$noseColor: red;
 
@mixin bg_color() {
background-color: #f0f0f0;
@include filter-gradient(#f0f0f0, #d8d8d8, horizontal);
$experimental-support-for-svg: true;
@include background-image(radial-gradient(center, ellipse cover, #f0f0f0 0%,#d8d8d8 100%));
}
 
@mixin rotate($deg) {
// transform: rotate(2deg);
transform: rotate($deg);
-ms-transform: rotate($deg);
-moz-transform: rotate($deg);
-webkit-transform: rotate($deg);
-o-transform: rotate($deg);
}
 
.snowman {
// border: 1px solid black;
margin: 10px auto;
width: $base;
z-index: 20;
.head {
position: relative;
height: round($base / 3);
width: round($base / 3);
margin: 0 auto;
.eyes {
position: relative;
z-index: 15;
.eye {
position: relative;
background: $eyeColor;
height: floor($base / 20);
width: floor($base / 20);
@include border-radius(round($base / 10));
z-index: 15;
}
.left {
float: left;
margin: round($base / 15) 0 0 round($base / 15);
}
.right {
float: right;
margin: round($base / 15) round($base / 15) 0 0
}
}
.nose {
position: relative;
margin: 0 auto;
width: $base / 15;
height: $base / 15;
background-color: #d33b30;
@include filter-gradient(#d33b30, #c40003, horizontal);
$experimental-support-for-svg: true;
@include background-image(radial-gradient(center, ellipse cover, #d33b30 0%,#c40003 100%));
padding: round($base / 100) round($base / 50);
position: relative;
top: round($base / 7);
@include border-radius($base / 5);
@include box-shadow(lighten($snowColor, 10%) 2px 2px 5px);
z-index: 10;
.inner {
position: relative;
background: white;
height: round($base / 30);
width: round($base / 30);
@include border-radius($base / 5);
float: right;
opacity: 0.6;
z-index: 15;
}
}
.mouth {
position: relative;
margin: 0 auto;
padding-top: round($base / 60);
height: round($base / 4);
width: round($base / 4);
border: round($base / 75) dashed black;
@include border-radius($base / 5);
bottom: round($base / 15);
.inner {
@include bg_color();
height: round(($base / 3) * 0.85);
width: round(($base / 3) * 0.85);
@include border-radius(round($base / 1.5));
position: relative;
bottom: round($base / 21.42);
right: round($base / 60);
}
}
}
.middle {
position: relative;
height: round($base / 1.5);
width: round($base / 1.5);
margin: 0 auto;
}
.bottom {
position: relative;
height: $base;
width: $base;
margin: 0 auto;
}
.middle,
.bottom {
.inner { padding-top: round($base / 15); }
.button {
position: relative;
height: round($base / 15);
width: round($base / 15);
background: $buttonColor;
border: medium solid darken($buttonColor, 20%);
@include border-radius(round($base / 10));
margin: round($base / 20) auto;
@include box-shadow(lighten($snowColor, 10%) 1px 1px 0px);
.highlight {
height: round(($base / 15) * 0.95);
width: round(($base / 15) * 0.95);
background: darken($buttonColor, 10%);
@include border-radius(round($base / 10));
position: relative;
top: 2px;
float: right;
}
}
.top { margin-top: 0; }
}
.head,
.middle,
.bottom {
position: relative;
@include bg_color();
@include border-radius(round($base / 1.5));
z-index: 10;
}
.arm {
position: relative;
height: round($base / 1.5);
width: round($base / 50);
background: black;
z-index: 0;
.hand {
.finger {
height: round($base / 10);
width: round($base / 50);
background: black;
}
.finger.one {
@include rotate(45deg);
position: relative;
bottom: round($base / 12);
left: round($base / 30);
}
.finger.two {
@include rotate(0deg);
position: relative;
bottom: round($base / 5);
left: 0;
}
.finger.three {
@include rotate(-45deg);
position: relative;
bottom: round($base / 3.75);
right: round($base / 30);
}
}
}
.arm.left {
margin-top: 20px;
float: left;
@include rotate(225deg);
}
.arm.right {
margin-top: 20px;
float: right;
@include rotate(-225deg);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.