-
Notifications
You must be signed in to change notification settings - Fork 0
/
focal-point-picker.css
129 lines (125 loc) · 2.46 KB
/
focal-point-picker.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* Hide the input element
*/
.compat-field-focalpoint-input {
/* display: none !important; */
}
/**
* Hidden elements if not initialized
*/
focal-point-picker [data-focalpoint-handle],
focal-point-picker [data-focalpoint-preview] {
display: none;
}
/**
* The input element
*/
[data-focalpoint-input-wrap] {
display: flex;
gap: 0.5rem;
}
[data-focalpoint-input-wrap] > * {
flex: 1;
}
[data-focalpoint-reset] {
cursor: pointer;
max-width: fit-content;
}
/**
* The handle
*/
[data-focalpoint-handle] {
box-sizing: border-box;
position: absolute;
z-index: 2;
appearance: none;
padding: 0;
border: none;
display: block;
width: 0;
height: 0;
cursor: move;
user-select: all;
filter: drop-shadow(1px 1px 2px rgb(0 0 0 / 0.3));
}
[data-focalpoint-handle]:focus {
outline: 0 !important;
}
[data-focalpoint-handle]::before {
content: "";
display: block;
position: absolute;
width: 4px;
height: 4px;
border-radius: 99999px;
background: white;
transform: translate(-50%, -50%);
}
[data-focalpoint-handle]:after {
content: "";
display: block;
--size: 1.2rem;
width: var(--size);
height: var(--size);
border-radius: 9999px;
transform: translate(-50%, -50%);
box-shadow:
inset 0 0 0 1px white,
0 0 0 3px #2271b1,
0 0 0 4px white;
}
[data-fcp-wrap] {
position: relative;
}
[data-fcp-wrap] img {
cursor: crosshair;
position: relative;
z-index: 2;
}
[data-fcp-dragging] [data-fcp-wrap] img {
outline: 1px solid rgba(0 0 0 / 0.1);
}
[data-fcp-dragging] .uploader-window {
display: none !important;
}
/**
* The Preview
*/
[data-focalpoint-preview] {
position: fixed;
z-index: 99999999;
--size: 20svw;
width: var(--size);
bottom: 0;
right: 0;
box-sizing: border-box;
padding: 1rem;
display: grid;
gap: 1rem;
pointer-events: none;
transition-property: opacity, transform;
transition-duration: 200ms;
transition-timing-function: ease-out;
}
[data-focalpoint-preview] > * {
box-sizing: border-box;
background-size: cover;
border-radius: 0.3rem;
background-image: var(--image);
background-color: white;
box-shadow:
0px 0px 0px 3px white,
2px 2px 10px rgb(0 0 0 / 0.5);
background-position: var(--focal-left, 50%) var(--focal-top, 50%);
}
[data-focalpoint-preview] > [data-landscape] {
aspect-ratio: 3/1;
}
[data-focalpoint-preview] > [data-portrait] {
aspect-ratio: 1/3;
width: 33.333%;
justify-self: end;
}
[data-focalpoint-preview]:not(.is-visible) {
opacity: 0;
}