index.vue 2.9 KB

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