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