Repository navigation
Expand file tree
/
Copy pathcontent.css
More file actions
180 lines (172 loc) · 6.02 KB
/
Copy pathcontent.css
File metadata and controls
180 lines (172 loc) · 6.02 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/* ─────────────────────────────────────────────────────────────────────────────
Styles for the in-page immersive translator (content.js).
Injected into arbitrary web pages, so everything is namespaced and the
toolbar / popup reset inherited page styles with `all: revert`.
───────────────────────────────────────────────────────────────────────────── */
/* Inline bilingual translation node. `color: inherit` keeps it legible on any
page background; the tint + left border mark it as a translation. */
.vibe-inline-translation {
display: block;
margin: 0.25em 0;
padding: 0.15em 0.5em;
border-left: 3px solid rgba(20, 140, 90, 0.55);
border-radius: 3px;
background: rgba(20, 140, 90, 0.08);
color: inherit;
font-size: inherit;
line-height: 1.5;
white-space: normal;
}
.vibe-inline-translation.vibe-loading {
opacity: 0.6;
font-style: italic;
}
.vibe-inline-translation.vibe-error {
border-left-color: rgba(200, 40, 40, 0.6);
background: rgba(200, 40, 40, 0.08);
color: #c0392b;
}
/* ─── Persistent floating ball + hover-reveal control panel ────────────────────
The ball is always visible (bottom-right). Click it to translate the whole
page; hover it to slide out the control panel (language, hover toggle, …). */
#__vibe_toolbar {
all: revert;
color-scheme: dark;
position: fixed;
right: 16px;
bottom: 16px;
z-index: 2147483647;
display: flex;
flex-direction: row-reverse; /* ball on the right; panel slides out to its left */
align-items: center;
gap: 8px;
font: 13px/1.2 -apple-system, "Segoe UI", system-ui, sans-serif;
}
#__vibe_toolbar * { all: revert; color-scheme: dark; box-sizing: border-box; font: inherit; }
#__vibe_toolbar .vibe-ball {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
background: var(--vibe-surface);
color: var(--vibe-text);
border: 1px solid var(--vibe-border);
border-radius: 50%;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
cursor: pointer;
user-select: none;
}
#__vibe_toolbar .vibe-ball img { display: block; width: 28px; height: 28px; border-radius: 6px; }
#__vibe_toolbar.vibe-active .vibe-ball { background: #2f7d52; border-color: #36995f; }
#__vibe_toolbar .vibe-panel {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background: var(--vibe-surface);
color: var(--vibe-text);
border: 1px solid var(--vibe-border);
border-radius: 10px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
max-width: 80vw;
opacity: 0;
transform: translateX(12px) scale(0.96);
transform-origin: right center;
pointer-events: none;
transition: opacity 0.15s ease, transform 0.15s ease;
}
#__vibe_toolbar:hover .vibe-panel,
#__vibe_toolbar:focus-within .vibe-panel {
opacity: 1;
transform: none;
pointer-events: auto;
}
#__vibe_toolbar .vibe-tb-lang {
background: var(--vibe-surface-2);
color: var(--vibe-text);
border: 1px solid var(--vibe-border);
border-radius: 6px;
padding: 3px 6px;
}
#__vibe_toolbar .vibe-tb-hover { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
#__vibe_toolbar .vibe-tb-settings,
#__vibe_toolbar .vibe-tb-hide {
background: var(--vibe-border);
color: #fff;
border: 0;
border-radius: 6px;
padding: 4px 9px;
cursor: pointer;
}
#__vibe_toolbar .vibe-tb-settings:hover,
#__vibe_toolbar .vibe-tb-hide:hover { background: var(--vibe-hover); }
#__vibe_toolbar .vibe-tb-status {
color: var(--vibe-muted);
white-space: nowrap;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
}
/* "Hide ball" menu, opened from the panel's ✕ button. */
#__vibe_toolbar .vibe-hide-menu {
position: absolute;
right: 0;
bottom: 100%;
display: none;
flex-direction: column;
gap: 4px;
min-width: 180px;
margin-bottom: 8px;
padding: 8px;
background: var(--vibe-surface);
color: var(--vibe-text);
border: 1px solid var(--vibe-border);
border-radius: 10px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
/* Invisible bridge over the margin so moving the mouse up keeps :hover. */
#__vibe_toolbar .vibe-hide-menu::after {
content: "";
position: absolute;
left: 0;
right: 0;
top: 100%;
height: 8px;
}
#__vibe_toolbar .vibe-hide-menu.vibe-open { display: flex; }
#__vibe_toolbar .vibe-hide-menu button {
background: var(--vibe-surface-2);
color: var(--vibe-text);
border: 1px solid var(--vibe-border);
border-radius: 6px;
padding: 6px 10px;
text-align: left;
cursor: pointer;
}
#__vibe_toolbar .vibe-hide-menu button:hover { background: var(--vibe-border); }
#__vibe_toolbar .vibe-hide-note { color: var(--vibe-muted); font-size: 11px; padding: 2px 2px 0; }
/* ─── Selection popup card ──────────────────────────────────────────────────── */
#__vibe_sel_card {
all: revert;
position: absolute;
z-index: 2147483647;
max-width: 360px;
padding: 10px 12px;
background: var(--vibe-surface);
color: var(--vibe-text);
border: 1px solid var(--vibe-border);
border-radius: 8px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
font: 14px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
white-space: pre-wrap;
}
#__vibe_toolbar .vibe-tb-status.vibe-busy::before {
content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%;
margin-right: 6px; vertical-align: -1px;
background: conic-gradient(#f6a76b, #e9c96d, #77c6a4, #83b6e8, #bf9cdb, #ee9fb5, #f6a76b);
animation: vibe-content-orbit 1s linear infinite;
}
@keyframes vibe-content-orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #__vibe_toolbar .vibe-tb-status.vibe-busy::before { animation: none; } }