Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 4.59 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /* CSS States */
  2. body {
  3.         background: url(http://dabblet.com/img/noise.png);
  4.         background-color: #F5F2F0;
  5.         font-family: Georgia, serif;
  6.         font-size: 18px;
  7.         line-height: 1.6em;
  8.         text-shadow: 0 2px 0 white;
  9.         color: #222;
  10. }
  11. .wrapper {
  12.         width: 900px;
  13.         margin: 70px auto;
  14. }
  15. h1 {
  16.         font-family: Helvetica, Arial, sans-serif;
  17.         text-align: center;
  18.         font-size: 1.6em;
  19. }
  20. a {
  21.         text-decoration: none;
  22.         color: #B46919;
  23. }
  24. a:visited {
  25.         color: #834B0F;
  26. }
  27. a:hover {
  28.         color: #E9A051;
  29. }
  30. .device {
  31.         display: inline-block;
  32.         position: relative;
  33.         background:#AD0F0F;
  34.         width: 230px;
  35.         height: 450px;
  36.         padding: 20px 15px;
  37.         margin: 20px;
  38.         border-radius: 20px;
  39.         border: 1px solid #410707;
  40.         border-bottom-width: 8px;
  41.         box-shadow: 0 2px 5px rgba(0,0,0,0.7),
  42.                     inset 0 0 10px rgba(255,255,255,0.5),
  43.                     inset 0 2px 2px rgba(255,255,255,0.25);
  44. }
  45. section {
  46.         display: inline-block;
  47.         vertical-align: top;
  48.         padding: 30px;
  49.         width: 500px;
  50.  
  51. }
  52. small {
  53.         display: block;
  54.         margin-top: 20px;
  55.         opacity: 0.3;
  56.         text-align: center;
  57.         padding:
  58.         20px;
  59.         transition: opacity 0.5s;
  60. }
  61. small:hover {
  62.         opacity: 1;
  63. }
  64. .up, .down, .left, .right {
  65.         position: absolute;
  66.         z-index: 1001;
  67.         margin-left: 50%;
  68.         font-size: 40px;
  69.         width: 50px;
  70.         height: 50px;
  71.         background: #FFA03A;
  72.         border: 1px solid #915515;
  73.         box-shadow: 0 3px 0 #52300E,
  74.                     inset 0 0 10px rgba(255,255,255,0.3);
  75.  
  76.         appearance: none;
  77.         border-radius: 50px;
  78.         cursor: pointer;
  79. }
  80.  
  81.  
  82. .up:active, .down:active, .left:active, .right:active {
  83.         margin-top: 3px;
  84.         box-shadow: inset 0 1px 1px rgba(0,0,0,0.3);
  85. }
  86.  
  87. .up:before, .down:before, .left:before, .right:before {
  88.         display: block;
  89.         position: absolute;
  90.         content: "";
  91.         width: 15px;
  92.         height: 15px;
  93.         border-radius: 15px;
  94.         background: #E4923D;
  95.         box-shadow: 0 2px 2px rgba(255,255,255,0.25),
  96.                     inset 0 1px 0 rgba(0,0,0,0.5);
  97.  
  98. }
  99.  
  100. .up:after, .down:after, .left:after, .right:after {
  101.         display: block;
  102.         position: absolute;
  103.         content: "";
  104.         top: -5px;
  105.         left: -6px;
  106.         width: 60px;
  107.         height: 60px;
  108.         border-radius: 60px;
  109.         box-shadow: 0 2px 2px rgba(255,255,255,0.25),
  110.                     inset 0 2px 2px rgba(0,0,0,0.5);
  111. }
  112.  
  113. .up:active:after, .down:active:after, .left:active:after, .right:active:after {
  114.         top: -8px;
  115. }
  116.  
  117. .up {
  118.         top: 300px;
  119.         left: -25px;   
  120. }
  121. .up:before {
  122.         top: 5px;
  123.         left: 17px;
  124. }
  125. .down {
  126.         top: 400px;
  127.         left: -25px;
  128. }
  129. .down:before {
  130.         bottom: 5px;
  131.         left: 17px;
  132. }
  133. .left {
  134.         top: 350px;
  135.         left: -75px;
  136. }
  137. .left:before {
  138.         top: 17px;
  139.         left: 5px;
  140. }
  141.  
  142. .right {
  143.         top: 350px;
  144.         left: 25px;
  145. }
  146. .right:before {
  147.         top: 17px;
  148.         right: 5px;
  149. }
  150.  
  151. .up:active ~ .screen .char, .down:active ~ .screen .char, .left:active ~ .screen .char, .right:active ~ .screen .char {
  152.         transition: margin-top 2s linear,
  153.                     margin-left 2s linear;          
  154. }
  155.  
  156. .up:active ~ .screen .char {   
  157.         margin-top: -84px;
  158.         background-position: 0 -144px;
  159.         animation: walk-up 0.65s infinite;     
  160. }
  161.  
  162. .down:active ~ .screen .char {
  163.         margin-top: 90px;
  164.         background-position: 0 0;
  165.         animation: walk-down 0.65s infinite;
  166. }
  167.  
  168. .left:active ~ .screen .char { 
  169.         margin-left: -88px;
  170.         background-position: 0 -48px;
  171.         animation: walk-left 0.65s infinite;
  172. }
  173.  
  174. .right:active ~ .screen .char {
  175.         margin-left: 88px;
  176.         background-position: 0 -96px;
  177.         animation: walk-right 0.65s infinite;
  178. }
  179.  
  180. .screen {
  181.         position: relative;
  182.         margin: 0 auto;
  183.         padding: 128px 112px;
  184.         box-sizing: border-box;
  185.         width: 224px;
  186.         height: 256px;
  187.         overflow:hidden;
  188.         box-shadow: 0 0 20px rgba(255,255,255,0.25),
  189.                     0 2px 1px rgba(255,255,255,0.15);
  190.         background: url("http://joelb.me/extassets/sprites/home-layer-1.png") no-repeat;
  191. }
  192.  
  193. .overlay {
  194.         position: absolute;
  195.         width: 100%;
  196.         height: 100%;
  197.         top: 0;
  198.         left: 0;
  199.         background: url("http://joelb.me/extassets/sprites/home-layer-2.png") no-repeat;
  200.         box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
  201.         z-index: 1000;
  202. }
  203.  
  204. .char {
  205.         position: relative;
  206.         left: -16px;
  207.         background-image: url("http://joelb.me/extassets/sprites/old-man.png");
  208.         background-position: -32px 0;
  209.         width: 32px;
  210.         height: 48px;
  211.         transition-property: margin-top, margin-left, background-position;
  212.         transition-duration: 0;
  213.         transition-delay: 999999s;
  214.         transition-timing-function: linear;
  215. }
  216.  
  217. @keyframes walk-up {
  218.         0%, 32.99% { background-position: 0 -144px; }
  219.         33%, 65.99% { background-position: 32px -144px; }
  220.         66%, 100% { background-position: -32px -144px; }
  221. }
  222.  
  223. @keyframes walk-down {
  224.         0%, 32.99% { background-position: 0 0; }
  225.         33%, 65.99% { background-position: 32px 0; }
  226.         66%, 100% { background-position: -32px 0; }
  227. }
  228.  
  229. @keyframes walk-left {
  230.         0%, 32.99% { background-position: 0 -48px; }
  231.         33%, 65.99% { background-position: 32px -48px; }
  232.         66%, 100% { background-position: -32px -48px; }
  233. }
  234.  
  235. @keyframes walk-right {
  236.         0%, 32.99% { background-position: 0 -96px; }
  237.         33%, 65.99% { background-position: 32px -96px; }
  238.         66%, 100% { background-position: -32px -96px; }
  239. }