Repository navigation
Expand file tree
/
Copy pathdocument-image-preview.css
More file actions
143 lines (143 loc) · 3.22 KB
/
Copy pathdocument-image-preview.css
File metadata and controls
143 lines (143 loc) · 3.22 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.document-image-preview {
position: fixed;
z-index: 1500;
inset: 0;
display: grid;
place-items: center;
color: #1f2329;
background: rgba(245, 246, 247, 0.96);
backdrop-filter: blur(5px);
outline: none;
animation: document-image-preview-arrive 0.15s ease-out;
}
.document-image-preview-toolbar {
position: absolute;
z-index: 3;
top: 18px;
left: 50%;
padding: 5px;
display: flex;
align-items: center;
gap: 3px;
max-width: calc(100vw - 24px);
transform: translateX(-50%);
background: rgba(255, 255, 255, 0.96);
border: 1px solid #dee0e3;
border-radius: 9px;
box-shadow: 0 8px 28px rgba(31, 35, 41, 0.14);
backdrop-filter: blur(10px);
}
.document-image-preview-toolbar :is(button, a) {
min-width: 34px;
height: 32px;
padding: 0 8px;
display: grid;
place-items: center;
color: #4e5969;
background: transparent;
border: 0;
border-radius: 6px;
cursor: pointer;
text-decoration: none;
}
.document-image-preview-toolbar :is(button, a):hover {
color: #245bdb;
background: #edf3ff;
}
.document-image-preview-toolbar :is(button, a):active {
background: #dbe7ff;
}
.document-image-preview-toolbar :is(button, a):focus-visible {
outline: 2px solid #3370ff;
outline-offset: 1px;
}
.document-image-preview-toolbar .document-image-preview-scale {
min-width: 60px;
font-variant-numeric: tabular-nums;
}
.document-image-preview-viewport {
box-sizing: border-box;
width: 100%;
height: 100%;
padding: 76px 42px 42px;
overflow: hidden;
display: grid;
place-items: center;
touch-action: none;
}
.document-image-preview-viewport img {
max-width: 88vw;
max-height: calc(100dvh - 120px);
transform-origin: center;
user-select: none;
background: #fff;
border: 1px solid #ebedf0;
border-radius: 8px;
box-shadow: 0 12px 38px rgba(31, 35, 41, 0.13);
cursor: grab;
}
.document-image-preview-viewport img:active {
cursor: grabbing;
}
.document-image-preview-error {
position: absolute;
bottom: 24px;
padding: 10px 16px;
border-radius: 6px;
color: #a61d24;
background: #fff1f0;
}
.document-image-preview-previous,
.document-image-preview-next {
position: absolute;
z-index: 2;
top: 50%;
width: 42px;
height: 48px;
display: grid;
place-items: center;
border: 1px solid #dee0e3;
border-radius: 8px;
color: #4e5969;
background: rgba(255, 255, 255, 0.96);
cursor: pointer;
}
.document-image-preview-previous { left: 16px; }
.document-image-preview-next { right: 16px; }
.document-image-preview-previous:disabled,
.document-image-preview-next:disabled { opacity: 0.3; cursor: default; }
.document-image-preview-position {
position: absolute;
bottom: 12px;
font-size: 13px;
font-variant-numeric: tabular-nums;
}
@keyframes document-image-preview-arrive {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@media (max-width: 480px) {
.document-image-preview-toolbar {
gap: 0;
padding: 4px;
}
.document-image-preview-toolbar :is(button, a) {
min-width: 30px;
padding: 0 5px;
}
.document-image-preview-toolbar .document-image-preview-scale {
min-width: 48px;
}
.document-image-preview-viewport {
padding: 76px 12px 24px;
}
}
@media (prefers-reduced-motion: reduce) {
.document-image-preview {
animation: none;
}
}