MediaWiki:Gadget-GrAnnotations.css: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* | /* | ||
* gr_annotations.css — grantha.io inline | * gr_annotations.css — grantha.io inline Notes + Bookmarks + Feedback (v3) | ||
*/ | */ | ||
/* ── Icon base | /* ── Icon base ──────────────────────────────────────────────────── */ | ||
.gra-icon { | .gra-icon { | ||
display: inline-block; | display: inline-block; | ||
| Line 25: | Line 13: | ||
flex-shrink: 0; | flex-shrink: 0; | ||
} | } | ||
.gra-icon- | /* comment.svg → Feedback (flag/report) */ | ||
.gra-icon-feedback { background-image: url('/images/commentary.svg'); } | |||
/* notes.svg → Notes */ | |||
.gra-icon-note { background-image: url('/images/notes.svg'); } | |||
.gra-icon-bookmark { background-image: url('/images/bookmark.svg'); } | .gra-icon-bookmark { background-image: url('/images/bookmark.svg'); } | ||
.gra-icon-copy { background-image: url('/images/copy.svg'); } | .gra-icon-copy { background-image: url('/images/copy.svg'); } | ||
/* ══════════════════════════════════════════════════════════════════ | /* ══════════════════════════════════════════════════════════════════ | ||
1. FLOATING ACTION STRIP | 1. FLOATING ACTION STRIP (3 buttons) | ||
══════════════════════════════════════════════════════════════════ */ | ══════════════════════════════════════════════════════════════════ */ | ||
#gra-fab { | #gra-fab { | ||
position: fixed; | position: fixed; | ||
z-index: 10200; | z-index: 10200; | ||
display: none; | display: none; | ||
| Line 45: | Line 34: | ||
padding: 6px 5px; | padding: 6px 5px; | ||
box-shadow: 0 2px 10px rgba(0,0,0,0.14); | box-shadow: 0 2px 10px rgba(0,0,0,0.14); | ||
} | } | ||
#gra-fab.gra-fab-visible { display: flex; } | #gra-fab.gra-fab-visible { display: flex; } | ||
| Line 63: | Line 51: | ||
} | } | ||
.gra-fab-btn:hover { background: #f5f5f5; } | .gra-fab-btn:hover { background: #f5f5f5; } | ||
.gra-fab-btn:hover .gra-fab-tooltip { opacity: 1; transform: translateX(-50% | .gra-fab-btn:hover .gra-fab-tooltip { opacity: 1; transform: translateX(0) translateY(-50%); } | ||
.gra-fab-tooltip { | .gra-fab-tooltip { | ||
position: absolute; | position: absolute; | ||
right: calc(100% + 8px); | right: calc(100% + 8px); | ||
top: 50%; | top: 50%; | ||
transform: translateX( | transform: translateX(4px) translateY(-50%); | ||
white-space: nowrap; | white-space: nowrap; | ||
background: rgba(30,30,30,0.82); | background: rgba(30,30,30,0.82); | ||
| Line 86: | Line 73: | ||
/* ══════════════════════════════════════════════════════════════════ | /* ══════════════════════════════════════════════════════════════════ | ||
2. RIGHT PANEL | 2. RIGHT PANEL | ||
══════════════════════════════════════════════════════════════════ */ | ══════════════════════════════════════════════════════════════════ */ | ||
#gra-panel { | #gra-panel { | ||
position: fixed; | position: fixed; | ||
top: 0; | top: 0; | ||
right: -360px; | right: -360px; | ||
width: 340px; | width: 340px; | ||
height: 100vh; | height: 100vh; | ||
| Line 107: | Line 92: | ||
#gra-panel.gra-panel-open { right: 0; } | #gra-panel.gra-panel-open { right: 0; } | ||
#gra-backdrop { | #gra-backdrop { | ||
position: fixed; | position: fixed; | ||
| Line 118: | Line 102: | ||
#gra-backdrop.gra-backdrop-visible { display: block; } | #gra-backdrop.gra-backdrop-visible { display: block; } | ||
#gra-panel-head { | #gra-panel-head { | ||
display: flex; | display: flex; | ||
| Line 138: | Line 121: | ||
#gra-panel-close:hover { background: #f5f5f5; color: #222; } | #gra-panel-close:hover { background: #f5f5f5; color: #222; } | ||
#gra-tabs { | #gra-tabs { | ||
display: flex; | display: flex; | ||
| Line 165: | Line 147: | ||
.gra-tab .gra-icon { width: 16px; height: 16px; opacity: 0.5; } | .gra-tab .gra-icon { width: 16px; height: 16px; opacity: 0.5; } | ||
.gra-tab:hover { color: #333; } | .gra-tab:hover { color: #333; } | ||
.gra-tab.gra-tab-active { | .gra-tab.gra-tab-active { color: #1a73e8; border-bottom-color: #1a73e8; } | ||
.gra-tab.gra-tab-active .gra-icon { | |||
opacity: 1; | |||
filter: invert(30%) sepia(100%) saturate(500%) hue-rotate(190deg); | |||
} | } | ||
#gra-panel-body { | #gra-panel-body { | ||
flex: 1; | flex: 1; | ||
| Line 181: | Line 162: | ||
/* ══════════════════════════════════════════════════════════════════ | /* ══════════════════════════════════════════════════════════════════ | ||
3. | 3. FEEDBACK COMPOSER | ||
══════════════════════════════════════════════════════════════════ */ | ══════════════════════════════════════════════════════════════════ */ | ||
.gra-composer { | .gra-composer { | ||
background: #fff; | background: #fff; | ||
| Line 190: | Line 169: | ||
border-radius: 8px; | border-radius: 8px; | ||
box-shadow: 0 4px 16px rgba(0,0,0,0.14); | box-shadow: 0 4px 16px rgba(0,0,0,0.14); | ||
width: | width: 340px; | ||
padding: 12px | padding: 14px 16px 12px; | ||
position: fixed; | position: fixed; | ||
z-index: 10150; | z-index: 10150; | ||
| Line 202: | Line 181: | ||
.gra-composer.gra-composer-visible { display: flex; } | .gra-composer.gra-composer-visible { display: flex; } | ||
/* Feedback composer header row */ | |||
.gra-composer-header { | |||
display: flex; | |||
align-items: center; | |||
gap: 8px; | |||
} | |||
.gra-composer-header strong { | |||
flex: 1; | |||
font-size: 14px; | |||
color: #202124; | |||
} | |||
.gra-btn-x { | |||
background: none; | |||
border: none; | |||
cursor: pointer; | |||
font-size: 16px; | |||
color: #666; | |||
padding: 2px 5px; | |||
border-radius: 4px; | |||
line-height: 1; | |||
} | |||
.gra-btn-x:hover { background: #f5f5f5; color: #222; } | |||
/* Feedback field labels */ | |||
.gra-fb-field-label { | |||
font-size: 11px; | |||
font-weight: 600; | |||
color: #5f6368; | |||
text-transform: uppercase; | |||
letter-spacing: 0.4px; | |||
margin-bottom: -6px; /* tighten gap to input below */ | |||
} | |||
/* Selected text quote preview */ | |||
.gra-fb-quote-label { | |||
font-size: 11px; | |||
color: #9aa0a6; | |||
margin-bottom: -4px; | |||
} | |||
.gra-fb-quote { | |||
font-size: 12px; | |||
color: #5f6368; | |||
font-style: italic; | |||
background: #fafafa; | |||
border-left: 3px solid #fbbc04; | |||
border-radius: 0 4px 4px 0; | |||
padding: 6px 10px; | |||
line-height: 1.45; | |||
max-height: 56px; | |||
overflow: hidden; | |||
display: -webkit-box; | |||
-webkit-line-clamp: 3; | |||
-webkit-box-orient: vertical; | |||
} | |||
/* Issue type dropdown */ | |||
.gra-fb-select { | |||
border: 1px solid #e0e0e0; | |||
border-radius: 6px; | |||
padding: 7px 10px; | |||
font-size: 13px; | |||
font-family: inherit; | |||
color: #202124; | |||
background: #fff; | |||
outline: none; | |||
transition: border-color 0.15s; | |||
width: 100%; | |||
box-sizing: border-box; | |||
cursor: pointer; | |||
} | |||
.gra-fb-select:focus { border-color: #1a73e8; } | |||
/* Email input */ | |||
.gra-fb-email-input { | |||
min-height: unset !important; | |||
height: 36px; | |||
padding: 6px 10px !important; | |||
} | |||
/* Status message */ | |||
.gra-fb-status { | |||
font-size: 12px; | |||
min-height: 16px; | |||
text-align: center; | |||
} | |||
.gra-fb-status.gra-fb-ok { color: #34a853; } | |||
.gra-fb-status.gra-fb-err { color: #ea4335; } | |||
/* ══════════════════════════════════════════════════════════════════ | |||
4. NOTE COMPOSER (local only) | |||
══════════════════════════════════════════════════════════════════ */ | |||
.gra-composer-user { | .gra-composer-user { | ||
display: flex; | display: flex; | ||
| Line 219: | Line 289: | ||
font-weight: 600; | font-weight: 600; | ||
flex-shrink: 0; | flex-shrink: 0; | ||
} | } | ||
.gra-composer-uname { font-weight: 600; color: #202124; font-size: 13px; } | |||
.gra-composer- | |||
.gra-composer-input { | .gra-composer-input { | ||
| Line 275: | Line 343: | ||
.gra-btn-submit:disabled { background: #c5d8f8; cursor: default; } | .gra-btn-submit:disabled { background: #c5d8f8; cursor: default; } | ||
/* | /* ── Note cards ── */ | ||
.gra- | .gra-note-card { | ||
border: 1px solid #e8eaed; | border: 1px solid #e8eaed; | ||
border-radius: 8px; | border-radius: 8px; | ||
| Line 286: | Line 354: | ||
transition: box-shadow 0.15s; | transition: box-shadow 0.15s; | ||
} | } | ||
.gra- | .gra-note-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); } | ||
.gra- | .gra-note-card.gra-card-active { | ||
border-color: # | border-color: #34a853; | ||
box-shadow: 0 0 0 2px rgba( | box-shadow: 0 0 0 2px rgba(52,168,83,0.25); | ||
} | } | ||
.gra-card-header { | .gra-card-header { | ||
| Line 298: | Line 366: | ||
} | } | ||
.gra-card-meta { flex: 1; } | .gra-card-meta { flex: 1; } | ||
.gra-card-ts { font-size: 11px; color: #80868b; } | |||
.gra-card-ts { font-size: 11px; color: #80868b | |||
.gra-card-quote { | .gra-card-quote { | ||
font-size: 12px; | font-size: 12px; | ||
color: #5f6368; | color: #5f6368; | ||
border-left: 3px solid # | border-left: 3px solid #34a853; | ||
padding-left: 8px; | padding-left: 8px; | ||
margin-bottom: 6px; | margin-bottom: 6px; | ||
font-style: italic; | font-style: italic; | ||
line-height: 1.4; | line-height: 1.4; | ||
display: -webkit-box; | display: -webkit-box; | ||
-webkit-line-clamp: 2; | -webkit-line-clamp: 2; | ||
| Line 314: | Line 380: | ||
overflow: hidden; | overflow: hidden; | ||
} | } | ||
.gra-card-text { | .gra-card-text { font-size: 13px; color: #202124; line-height: 1.5; } | ||
color: # | .gra-note-del { | ||
line-height: 1 | background: none; | ||
border: none; | |||
cursor: pointer; | |||
color: #ccc; | |||
font-size: 15px; | |||
padding: 0 2px; | |||
line-height: 1; | |||
flex-shrink: 0; | |||
margin-left: auto; | |||
} | } | ||
.gra-note-del:hover { color: #e53935; } | |||
.gra-empty-state { | .gra-empty-state { | ||
color: #9aa0a6; | color: #9aa0a6; | ||
| Line 328: | Line 404: | ||
/* ══════════════════════════════════════════════════════════════════ | /* ══════════════════════════════════════════════════════════════════ | ||
5. BOOKMARK CARDS + COMPOSER | |||
══════════════════════════════════════════════════════════════════ */ | ══════════════════════════════════════════════════════════════════ */ | ||
.gra-bookmark-card { | .gra-bookmark-card { | ||
| Line 374: | Line 450: | ||
.gra-bookmark-del:hover { color: #e53935; } | .gra-bookmark-del:hover { color: #e53935; } | ||
.gra-bm-composer { | .gra-bm-composer { | ||
background: #fff; | background: #fff; | ||
| Line 401: | Line 476: | ||
/* ══════════════════════════════════════════════════════════════════ | /* ══════════════════════════════════════════════════════════════════ | ||
6. ANCHOR HIGHLIGHTS | |||
══════════════════════════════════════════════════════════════════ */ | ══════════════════════════════════════════════════════════════════ */ | ||
.gra- | /* Note highlight — green tint */ | ||
background: rgba( | .gra-note-highlight { | ||
background: rgba(52, 168, 83, 0.18); | |||
border-radius: 2px; | border-radius: 2px; | ||
cursor: pointer; | cursor: pointer; | ||
transition: background 0.15s; | transition: background 0.15s; | ||
} | } | ||
.gra- | .gra-note-highlight:hover, | ||
.gra- | .gra-note-highlight.gra-hl-active { | ||
background: rgba( | background: rgba(52, 168, 83, 0.4); | ||
outline: 1.5px solid # | outline: 1.5px solid #34a853; | ||
} | } | ||
/* Bookmark highlight — blue underline */ | |||
.gra-bookmark-highlight { | .gra-bookmark-highlight { | ||
background: rgba(26, 115, 232, 0.12); | background: rgba(26, 115, 232, 0.12); | ||
| Line 424: | Line 502: | ||
/* ══════════════════════════════════════════════════════════════════ | /* ══════════════════════════════════════════════════════════════════ | ||
7. PERSISTENT TOGGLE BUTTON | |||
══════════════════════════════════════════════════════════════════ */ | ══════════════════════════════════════════════════════════════════ */ | ||
#gra-toggle { | #gra-toggle { | ||
position: fixed; | position: fixed; | ||
bottom: 80px; | bottom: 80px; | ||
right: 20px; | right: 20px; | ||
width: 48px; | width: 48px; | ||
| Line 460: | Line 521: | ||
transition: background 0.15s, transform 0.15s; | transition: background 0.15s, transform 0.15s; | ||
} | } | ||
#gra-toggle:hover { | #gra-toggle:hover { background: #a0410e; transform: scale(1.07); } | ||
} | |||
#gra-toggle .gra-icon { | #gra-toggle .gra-icon { | ||
width: 22px; | width: 22px; | ||
height: 22px; | height: 22px; | ||
filter: brightness(0) invert(1); | filter: brightness(0) invert(1); | ||
} | } | ||
#gra-toggle-badge { | #gra-toggle-badge { | ||
| Line 484: | Line 542: | ||
text-align: center; | text-align: center; | ||
display: none; | display: none; | ||
font-family: system-ui, sans-serif; | font-family: system-ui, sans-serif; | ||
pointer-events: none; | pointer-events: none; | ||
} | } | ||
#gra-panel.gra-panel-open ~ #gra-toggle { | #gra-panel.gra-panel-open ~ #gra-toggle { | ||
right: 356px; | right: 356px; | ||
| Line 496: | Line 550: | ||
} | } | ||
/* | /* ══════════════════════════════════════════════════════════════════ | ||
. | 8. RESPONSIVE | ||
══════════════════════════════════════════════════════════════════ */ | |||
@media (max-width: 768px) { | |||
#gra-panel { width: 100vw; right: -100vw; } | |||
.gra-composer, | |||
.gra-bm-composer { | |||
width: calc(100vw - 32px); | |||
left: 16px !important; | |||
} | |||
.gra- | |||
} | |||
} | } | ||