_imagecheck.scss 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. .imagecheck {
  2. margin: 0;
  3. position: relative;
  4. cursor: pointer;
  5. }
  6. .imagecheck-input {
  7. position: absolute;
  8. z-index: -1;
  9. opacity: 0;
  10. }
  11. .imagecheck-figure {
  12. border: 1px solid rgba(0, 40, 100, 0.12);
  13. border-radius: 3px;
  14. margin: 0;
  15. position: relative;
  16. }
  17. .imagecheck-input {
  18. &:focus ~ .imagecheck-figure {
  19. border-color: $primary-color;
  20. box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
  21. }
  22. &:checked ~ .imagecheck-figure {
  23. border-color: rgba(0, 40, 100, 0.24);
  24. }
  25. }
  26. .imagecheck-figure:before {
  27. content: '';
  28. position: absolute;
  29. top: .25rem;
  30. left: .25rem;
  31. display: block;
  32. width: 1rem;
  33. height: 1rem;
  34. pointer-events: none;
  35. -webkit-user-select: none;
  36. -moz-user-select: none;
  37. -ms-user-select: none;
  38. user-select: none;
  39. background: $primary-color url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E") no-repeat center (center / 50%) 50%;
  40. color: #fff;
  41. z-index: 1;
  42. border-radius: 3px;
  43. opacity: 0;
  44. transition: .3s opacity;
  45. }
  46. .imagecheck-input:checked ~ .imagecheck-figure:before {
  47. opacity: 1;
  48. }
  49. .imagecheck-image {
  50. max-width: 100%;
  51. opacity: .64;
  52. transition: .3s opacity;
  53. &:first-child {
  54. border-top-left-radius: 2px;
  55. border-top-right-radius: 2px;
  56. }
  57. &:last-child {
  58. border-bottom-left-radius: 2px;
  59. border-bottom-right-radius: 2px;
  60. }
  61. }
  62. .imagecheck:hover .imagecheck-image {
  63. opacity: 1;
  64. }
  65. .imagecheck-input {
  66. &:focus ~ .imagecheck-figure .imagecheck-image, &:checked ~ .imagecheck-figure .imagecheck-image {
  67. opacity: 1;
  68. }
  69. }
  70. .imagecheck-caption {
  71. text-align: center;
  72. padding: .25rem .25rem;
  73. color: #9aa0ac;
  74. font-size: 0.875rem;
  75. transition: .3s color;
  76. }
  77. .imagecheck:hover .imagecheck-caption {
  78. color: #495057;
  79. }
  80. .imagecheck-input {
  81. &:focus ~ .imagecheck-figure .imagecheck-caption, &:checked ~ .imagecheck-figure .imagecheck-caption {
  82. color: #495057;
  83. }
  84. }