Commit graph

110 commits

Author SHA1 Message Date
Stephane Zermatten c2bd2f306a feat: Add support for keyboard shortcuts (#870)
* Add support for keyboard shortcuts.

This change introduces a Shortcut component for defining global
keyboard shortcuts from whichever component makes more sense.

This change also adds an initial set of navigation shortcuts:
- Backspace to leave a modal dialog or to go back
- g t to go to the federated timeline
- g f to go to the favorite page
- g h to go to the home page
- g n to go to the notification page
- g c to go to the community page
- s to go to the search page

These shortcuts are loaded asynchronously from _layout.html

In modal dialogs, shortcuts are also modal, to avoid strange or
overly complex behavior. This is implemented by grouping
shortcuts into scopes, and activating a separate 'modal' scope
when entering a modal dialog, so a separate set of shortcuts can
be enabled in modal dialog. Modal dialogs can be exited by
pressing 'Backspace'.

* Navigate up/down lists using keyboard shortcuts.

This change introduces keyboard shortcuts for navigating in lists and
virtual lists. j or arrow up selects the next element, k or arrow down,
the previous element. Selecting an element scrolls the list up and down,
as necessary.

This change also allows directing keyboard shortcuts to the active
element and defines the following shortcuts, for the active status:
- f to favorite or unfavorite it
- b to boost or unboost it
- r to reply to it
- o to open its thread
- x to toggle the display of a CW
- y to toggle the display of sensitive medias

This works by defining a keyboard shortcut scope for each list element.
A new component, ScrollListShortcuts, keeps track of the active element,
based on list or virtual list elements and redirects shortcuts to the
active element's scope. ScrollListShortcuts keeps the active element in
the current realm of the store, so the active element is restored when
going back to the list.

* Typing h or ? displays the list of available keyboard shortcuts.

This change introduces a new modal dialog that documents the list of
available shortcuts.
2019-01-13 10:03:29 -08:00
Nolan Lawson bb7fe6e30a
chore: make build process faster/simpler (#833)
This gets rid of the awkward checking-in of `template.html` to git (when
it's a built file) and also makes the rebuilds faster and more
consistent by running everything through the same pipeline. So inline
CSS, SVG, and JS are all partially built on-the-fly.

I've basically reinvented gulp, but it's pretty lightweight and
zero-dep, so I'm happy with it.
2018-12-17 17:21:29 -08:00
Nolan Lawson 7ddfe3830a
feat: add drag and drop for media uploads (#809)
* feat: add drag and drop for media uploads

fixes #65

* tweak colors
2018-12-15 02:06:12 -08:00
Nolan Lawson 25793e2fec
fix(style): use dark placeholder on dark theme (#802)
fixes #797
2018-12-13 21:32:37 -08:00
sgenoud 94d0590070 Fix the Pitch Black buttons color (#773)
Fix #757
2018-12-10 20:52:24 -08:00
Nolan Lawson ab548a0a5d
fix(scroll): slightly tweak flicker fix (#758) 2018-12-08 07:53:14 -08:00
Nolan Lawson 99c44f348a
fix(scroll): improve flicker on back navigation (#756)
* fix(scroll): improve flicker on back navigation

It's still not perfect in Firefox for Android, but it's improved.

Partial fix for #753

* the double raf makes no difference here
2018-12-07 23:23:48 -08:00
sgenoud 03d883423c feat(themes): Add the Pitch Black theme (#727)
This theme is made with mobile OLED screens (iPhone XS for instance)
2018-12-04 20:40:47 -08:00
Nolan Lawson aae73f0cc6
fix(design): "add instance" input has dark bg on dark theme (#726)
fixes #723
2018-12-04 07:25:22 -08:00
Nolan Lawson 26b84c435a
fix(design): use dark compose button halo on dark themes (#714)
Also only show the halo when we're actually scrolled down, because the
point is to make it more visible against arbitrary content.
2018-12-02 14:25:40 -08:00
Nolan Lawson ef656301f6
fix(a11y): decrease brightness of hacker theme (#712)
fixes #576
2018-12-02 14:25:30 -08:00
Nolan Lawson 945c1e7a23
fix(iOS): fix horizontal scroll, use fake sticky button on iOS (#711)
fixes #667
2018-12-02 11:22:18 -08:00
Nolan Lawson e44cafb5fb
feat(scrollbars): add option to disable scrollbars, fix macOS style (#701)
fixes #698 and fixes #700
2018-11-27 19:17:18 -08:00
Nolan Lawson 58f9c09bb8
fix(scrollbars): use standard CSS for scrollbars (#697)
Also use correct SCSS escaping everywhere, and fix a missing semicolon. Fixes #691
2018-11-26 13:15:33 -08:00
Nolan Lawson bfa37f5105
fix(design): tweak scrollbar colors (#687) 2018-11-24 09:33:07 -08:00
Nolan Lawson 2569b59b32
feat(design): add custom scrollbars for each theme (#685)
* feat(design): add custom scrollbars for each theme

fixes #683

* improve contrast of hotpants theme
2018-11-24 01:39:00 -08:00
Nolan Lawson 48a1bd47b3
refactor(themes): use CSS specificity order for themes (#684)
The point of this PR is to make it easier to implement scrollbars (#683).

With this PR, the themes move from a body tag-based system (e.g. `body.theme-scarlet`) to a system where they simply declare global CSS and we use CSS specificity order to give us the right theme.
2018-11-24 00:41:36 -08:00
Nolan Lawson 83d92711e1
fix(safari): fix sticky-positioned button (#674)
fixes #673
2018-11-21 07:27:56 -08:00
Nolan Lawson 5fdba9366a
fix(scroll): prevent horizontal scroll in mobile safari/firefox (#669)
* fix(scroll): prevent horizontal scroll in mobile safari/firefox

fixes #667

* fix safari vs non-safari browsers
2018-11-21 00:17:59 -08:00
Nolan Lawson 35a42c9fd3
fix(emoji): fix textarea emoji on linux (#670) 2018-11-20 22:41:32 -08:00
Nolan Lawson 4124da2439
fix(emojos): fix emojos on Ubuntu and Chrome on Windows (#661)
* fix(emojos): fix emojos on Ubuntu and Chrome on Windows

* fixup

* start working on unit tests

* fixup

* add more tests and fix emoji
2018-11-20 00:01:23 -08:00
Nolan Lawson b7f5d04b4c
fix(scrolling): use body as scrolling container (#656)
* fix(scrolling): use body as scrolling container

Fixes #526

* fixup tests and focus
2018-11-17 18:06:49 -08:00
Nolan Lawson 92d2dbddfc
perf(virtuallist): add contain:content to virtual list items (#650)
* perf(virtuallist): add contain:content to virtual list items

* add a few more contain:contents
2018-11-16 00:37:28 -08:00
Nolan Lawson 5c204b8001
fix Safari search bar appearance (#575) 2018-09-23 14:17:48 -07:00
Nolan Lawson 9b2b90b46e
simplify theme definitions (#574)
* simplify theme definitions

* remove rollup dep which is overkill

* fix syntax error

* fix lint

* fix test
2018-09-23 12:26:01 -07:00
Nolan Lawson 24dc3ad2ae rename darkscarlet and darkpink to Punk and Riot 2018-09-22 16:42:57 -07:00
pianycist 9dac979cb6 add dark pink, dark red, dark green themes 2018-09-22 16:42:57 -07:00
Sorin Davidoi 1852f4842f fix(scss/global): Inherit colors for input and textarea (#541) 2018-09-22 16:26:53 -07:00
Nolan Lawson 8334598786
fix autosuggest for dark themes (#507) 2018-08-27 19:32:22 -07:00
Nolan Lawson d10f924620
remove will-change:transform from container (#470) 2018-08-22 19:26:13 -07:00
Nolan Lawson 350667e5df
allow user display names to contain custom emoji (#448)
* allow user display names to contain custom emoji

fixes #445

* fix tests

* fix focus issue
2018-08-19 15:23:40 -07:00
Nolan Lawson 092d9e98a5
fix typo in SCSS (#430) 2018-08-17 21:51:26 -07:00
Nolan Lawson 8f5a4aadca
fix container focus rendering issue on Edge (#256) 2018-05-02 20:35:05 -07:00
Nolan Lawson 7f325a0166
fix blue active background on Chrome for Android (#236)
fixes #141
2018-04-29 16:57:22 -07:00
Nolan Lawson 82438a62e0
upgrade to node-sass 4.8.3 (#165) 2018-04-18 21:38:16 -07:00
Maxime Le Conte des Floris e52130f1c8 add toot-cafe theme (#108)
* add toot-cafe theme

* rename "toot-cafe" theme to "sorcery"
2018-04-14 09:43:30 -07:00
Nolan Lawson edb621e0f5 nit: make cobalt secondary text a bit lighter
[skip ci]
2018-04-11 20:13:39 -07:00
Chris c8687635e8 add cobalt blue theme (#78)
* added cobalt blue theme

* lighten nav items
2018-04-11 20:11:47 -07:00
Nolan Lawson a150613b53 tweak css variable names
[skip ci]
2018-04-11 19:53:43 -07:00
Spanky bdf547b561 made a variable for the AccountProfile page for its color overlay of the header image. (#84) 2018-04-11 19:47:24 -07:00
Spanky a722e6e244 increased the default contrast in the --very-deemphasized* variables for dark themes (#76) 2018-04-11 08:41:16 -07:00
Nolan Lawson 70b03eb56e
fix headings for timelines (#67)
Adds an sr-only class to make this easier in the future. Also fixes a missing aria-label.

Fixes #44
2018-04-10 22:08:14 -07:00
Nolan Lawson 036dcf082f extract Ozark dark theme into separate scss file 2018-04-10 20:07:58 -07:00
Spanky 3a7d887531 Added 'Ozark' dark blue color theme (#62)
* added Ozark theme, based off of a personal color scheme I use elsewhere.

* fixed incorrect main color value
2018-04-10 20:02:28 -07:00
Nolan Lawson 33d595f239 add mention option to account profiles 2018-04-04 21:45:19 -07:00
Nolan Lawson 9210afe0c3 slow loading spinner down a bit 2018-04-03 08:58:59 -07:00
Nolan Lawson 10c34f7cca faster loading spinner 2018-04-02 22:22:24 -07:00
Nolan Lawson 36a30dece5 better define loading spinner 2018-03-30 17:25:22 -07:00
Nolan Lawson 5426c5a0ef fix sticky button in mobile Firefox 2018-03-28 22:57:52 -07:00
Nolan Lawson 4e67f36510 tweak css 2018-03-28 09:07:00 -07:00