index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item">
  3. <div class="pan-info">
  4. <div class="pan-info-roles-container">
  5. <slot />
  6. </div>
  7. </div>
  8. <!-- eslint-disable-next-line -->
  9. <div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'PanThumb',
  15. props: {
  16. image: {
  17. type: String,
  18. required: true
  19. },
  20. zIndex: {
  21. type: Number,
  22. default: 1
  23. },
  24. width: {
  25. type: String,
  26. default: '150px'
  27. },
  28. height: {
  29. type: String,
  30. default: '150px'
  31. }
  32. }
  33. }
  34. </script>
  35. <style scoped>
  36. .pan-item {
  37. width: 200px;
  38. height: 200px;
  39. border-radius: 50%;
  40. display: inline-block;
  41. position: relative;
  42. cursor: default;
  43. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  44. }
  45. .pan-info-roles-container {
  46. padding: 20px;
  47. text-align: center;
  48. }
  49. .pan-thumb {
  50. width: 96%;
  51. height: 96%;
  52. margin: 2%;
  53. background-position: center center;
  54. background-size: cover;
  55. border-radius: 50%;
  56. overflow: hidden;
  57. position: absolute;
  58. transform-origin: 95% 40%;
  59. transition: all 0.3s ease-in-out;
  60. }
  61. /* .pan-thumb:after {
  62. content: '';
  63. width: 8px;
  64. height: 8px;
  65. position: absolute;
  66. border-radius: 50%;
  67. top: 40%;
  68. left: 95%;
  69. margin: -4px 0 0 -4px;
  70. background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
  71. box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
  72. } */
  73. .pan-info {
  74. position: absolute;
  75. width: inherit;
  76. height: inherit;
  77. border-radius: 50%;
  78. overflow: hidden;
  79. box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05);
  80. }
  81. .pan-info h3 {
  82. color: #fff;
  83. text-transform: uppercase;
  84. position: relative;
  85. letter-spacing: 2px;
  86. font-size: 18px;
  87. margin: 0 60px;
  88. padding: 22px 0 0 0;
  89. height: 85px;
  90. font-family: 'Open Sans', Arial, sans-serif;
  91. text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
  92. }
  93. .pan-info p {
  94. color: #fff;
  95. padding: 10px 5px;
  96. font-style: italic;
  97. margin: 0 30px;
  98. font-size: 12px;
  99. border-top: 1px solid rgba(255, 255, 255, 0.5);
  100. }
  101. .pan-info p a {
  102. display: block;
  103. color: #333;
  104. width: 80px;
  105. height: 80px;
  106. background: rgba(255, 255, 255, 0.3);
  107. border-radius: 50%;
  108. color: #fff;
  109. font-style: normal;
  110. font-weight: 700;
  111. text-transform: uppercase;
  112. font-size: 9px;
  113. letter-spacing: 1px;
  114. padding-top: 24px;
  115. margin: 7px auto 0;
  116. font-family: 'Open Sans', Arial, sans-serif;
  117. opacity: 0;
  118. transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s;
  119. transform: translateX(60px) rotate(90deg);
  120. }
  121. .pan-info p a:hover {
  122. background: rgba(255, 255, 255, 0.5);
  123. }
  124. .pan-item:hover .pan-thumb {
  125. transform: rotate(-110deg);
  126. }
  127. .pan-item:hover .pan-info p a {
  128. opacity: 1;
  129. transform: translateX(0px) rotate(0deg);
  130. }
  131. </style>