Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

.gs-plus-icon {
opacity: 0;
transform: scale(0.7);
transition: opacity 500ms cubic-bezier(0.4,0,0.2,1), transform 500ms cubic-bezier(0.4,0,0.2,1);
}

.gs-plus-icon.gs-plus-icon--visible {
opacity: 1;
transform: scale(1);
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
Expand Down
8 changes: 8 additions & 0 deletions src/ui/header-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const PLUS_ICON_CLASS = 'gs-plus-icon';
const HEADER_WITH_ICON_CLASS = 'gs-has-plus-icon';
const PLUS_ICON_ACTIVE_CLASS = 'gs-plus-icon--active';

const SHORT_TIME = 10

export function injectPlusIcons(table: HTMLTableElement, columnTypes: ColumnType[]): void {
// Remove any existing plus icons first
removePlusIcons(table);
Expand Down Expand Up @@ -105,6 +107,12 @@ function addPlusIconToHeader(header: HTMLTableCellElement, type: HeaderType): vo
plusIcon.textContent = '+';
plusIcon.style.marginLeft = '4px';
plusIcon.style.cursor = 'pointer';

// Animate appearance
// Add the visible class after a tick to trigger the transition
setTimeout(() => {
plusIcon.classList.add('gs-plus-icon--visible');
}, SHORT_TIME);

// Add click handler
plusIcon.addEventListener('click', (e) => {
Expand Down