Advertisement
Guest User

Untitled

a guest
Dec 12th, 2014
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. ul.gallery{
  2. list-style: none;
  3. margin: 0;
  4. padding: 0;
  5. }
  6.  
  7. ul.gallery li{
  8. display: block;
  9. width: 400px; /* width of gallery */
  10. height: 50px; /* portion of each gallery image that's shown initially */
  11. position: relative;
  12. -webkit-box-sizing: border-box;
  13. -moz-box-sizing: border-box;
  14. box-sizing: border-box;
  15. }
  16.  
  17.  
  18. ul.gallery li img{
  19. position: absolute;
  20. width: 100%;
  21. border: 10px solid #D8D2A2;
  22. -webkit-filter: grayscale(1);
  23. -moz-filter: grayscale(1);
  24. filter: url(#grayscale);
  25. filter: grayscale(1);
  26. -webkit-transition: all .5s ease-in-out; /* CSS3 transition setting */
  27. -moz-transition: all .5s ease-in-out;
  28. transition: all .5s ease-in-out;
  29. }
  30.  
  31.  
  32. ul.gallery li:focus{ /* when a LI receives focus (clicked on) */
  33. z-index: 100;
  34. outline: none;
  35. -webkit-transform: rotate(3deg); /* rotate enlarged LI by 3 degrees */
  36. -moz-transform: rotate(3deg);
  37. transform: rotate(3deg);
  38. pointer-events: none; /* disable pointer events on enlarged LI so thumbnail(s) beneath it can receive those events */
  39. }
  40.  
  41. ul.gallery li:nth-of-type(even):focus{ /* even LIs that received focus */
  42. -webkit-transform: rotate(-1deg); /* rotate enlarged LI by -1 degrees instead */
  43. -moz-transform: rotate(-1deg);
  44. transform: rotate(-1deg);
  45. }
  46.  
  47. ul.gallery li:focus img{
  48. -webkit-transform: scale(2) translateX(50%); /* enlarge focused image and move horizontally */
  49. -moz-transform: scale(2) translateX(50%);
  50. transform: scale(2) translateX(50%);
  51. top: 10px; /* shift enlarged image downwards by 10px */
  52. outline: none;
  53. box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.4);
  54. -webkit-filter: grayscale(0); /* nullify grayscale effect */
  55. filter: none;
  56. }
  57.  
  58. ul.gallery li:first-of-type:focus img{ /* first image within list of thumbnails that receives focus */
  59. top: 80px; /* move image down by 80px so it's not obscured by top of window edge */
  60. }
  61.  
  62. svg{
  63. position: absolute;
  64. visibility: hidden;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement