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: 100%;
  51. height: 100%;
  52. background-position: center center;
  53. background-size: cover;
  54. border-radius: 50%;
  55. overflow: hidden;
  56. position: absolute;
  57. transform-origin: 95% 40%;
  58. transition: all 0.3s ease-in-out;
  59. }
  60. /* .pan-thumb:after {
  61. content: '';
  62. width: 8px;
  63. height: 8px;
  64. position: absolute;
  65. border-radius: 50%;
  66. top: 40%;
  67. left: 95%;
  68. margin: -4px 0 0 -4px;
  69. background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
  70. box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
  71. } */
  72. .pan-info {
  73. position: absolute;
  74. width: inherit;
  75. height: inherit;
  76. border-radius: 50%;
  77. overflow: hidden;
  78. box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05);
  79. }
  80. .pan-info h3 {
  81. color: #fff;
  82. text-transform: uppercase;
  83. position: relative;
  84. letter-spacing: 2px;
  85. font-size: 18px;
  86. margin: 0 60px;
  87. padding: 22px 0 0 0;
  88. height: 85px;
  89. font-family: 'Open Sans', Arial, sans-serif;
  90. text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
  91. }
  92. .pan-info p {
  93. color: #fff;
  94. padding: 10px 5px;
  95. font-style: italic;
  96. margin: 0 30px;
  97. font-size: 12px;
  98. border-top: 1px solid rgba(255, 255, 255, 0.5);
  99. }
  100. .pan-info p a {
  101. display: block;
  102. color: #333;
  103. width: 80px;
  104. height: 80px;
  105. background: rgba(255, 255, 255, 0.3);
  106. border-radius: 50%;
  107. color: #fff;
  108. font-style: normal;
  109. font-weight: 700;
  110. text-transform: uppercase;
  111. font-size: 9px;
  112. letter-spacing: 1px;
  113. padding-top: 24px;
  114. margin: 7px auto 0;
  115. font-family: 'Open Sans', Arial, sans-serif;
  116. opacity: 0;
  117. transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s;
  118. transform: translateX(60px) rotate(90deg);
  119. }
  120. .pan-info p a:hover {
  121. background: rgba(255, 255, 255, 0.5);
  122. }
  123. .pan-item:hover .pan-thumb {
  124. transform: rotate(-110deg);
  125. }
  126. .pan-item:hover .pan-info p a {
  127. opacity: 1;
  128. transform: translateX(0px) rotate(0deg);
  129. }
  130. </style>