Elevator.js – A “back to top” button that behaves like a real elevator
tholman.com
tholman.com
Edit: Wow, I thought I was going the extra mile to make the joke obvious by saying the key should also take you to the beginning of a text line, but I guess it wasn't obvious enough for the first 3 commentators.
So you need to press Cmd+Up. Yes, it's two keys instead of one but I would argue it's actually quicker since they are both usually located on the bottom row, meaning there is less distance for your hand to travel.
I just switched to OS X recently and I am definitely having the reverse trouble getting used to the Cmd/Alt+Arrow I almost never have problem finding Home/End on any keyboards (been using Windows/Linux for 15+ years). Nowadays for laptop it's almost always fn+Arrow for Home/End.
What do you mean some keyboards? Any PC keyboard you connect to the mac will support home, end, page up, etc. (Unlike buttons 4 and up on mice)
- Home (and Fn + Up) don't move your caret if you're in an editing context, except...
- Some apps have different behavior for Home than go-to-top. Typically these exceptions use the Windows behavior of go-to-start-of-line (obviously this does move your cursor).
I use space all the time to scroll down on a web page, didn't know you could reverse direction, awesome :)
A tip: If it seems the whole world is a problem, it's probably not the world that is the problem.
Penny: Great! I hope I'm a waitress at the Cheesecake Factory for my whole life!
Sheldon: Was that sarcasm?
Penny: No.
Sheldon: Was that sarcasm?
Penny: Yes.
SaRcASm iS NeARlY ImpOsSibLe To dEtecT iN WrITiNg.
It's a key combo that requires two hands, for what on a regular keyboard is one finger.
Perhaps Mac people never hold a cup of coffee in their hand while using a computer?
Control-A: Move to the beginning of the line or paragraph.
Control-E: Move to the end of a line or paragraph.
Control-F: Move one character forward.
Control-B: Move one character backward.
Control-L: Center the cursor or selection in the visible area.
Control-P: Move up one line.
Control-N: Move down one line.
Control-O: Insert a new line after the insertion point.
Control-T: Swap the character behind the insertion point with the character in front of the insertion point.
Mac people expect their Butler to carefully hold the coffee cup for them and tilt it so they can take a sip.
I mean, not while using the keyboard, no. Typing is a two-handed activity.
The moment I learned my macbook didn’t have a home button I was searching for how to emulate that.
My home Apple keyboard has the Home button between Help and Page Up. Though, I will admit that keyboard is 2003ish. But I keep using it because it still has good action.
[1]:https://en.wikipedia.org/wiki/Apple_Keyboard#Apple_Keyboard_...
https://en.wikipedia.org/wiki/File:Apple_Pro_Keyboard_black....
I have to get a USB⇄USB-C dongle so I can use it on my Windows machine.
Way too many people who have never used an actual console terminal
Here's where I disagree
Ahh, I see you're also trying your hand at sarcasm!
Sarcasm is definitely not impossible to detect in writing. You just to have to trust people and give them the benefit of the doubt.
It's very useful on web sites like HN, when you don't want to lose where you are in the thread, yet need to go back to the top to have a second look at the topic for instance.
gg - go to top
G - go to bottom
You can also go anywhere on page (litterary) with single key (homework).
Much better then home/end as you usually need to hunt for those keys, or even use them with Fn modifier.
I sometimes install plugins myself if the code is open source and it is small enough for me to vet it.
I would love vimium, but the code is way too big to vet it myself.
I wish there was some party that is trustworthy, vets codebases like these and publish hashes of trusted versions.
An alternative would be more modular codebases. So instead of publishing a giant box of code with all kinds of vim-like behavior, publish lots of small ones. Like the code to make gg work.
If you want to fight for security on that level, your computer life must be miserable. You are also missing out a lot of great tools and are way less effective then folks that use them (and thus less competitive).
I am all up for great security in OS, emails, browsers, messangers etc, but it has to stop somewhere. Also, this kind of stuff like vimium is so widely used that somebody would probably notice if something funky is going on (everything leaves some traces, you dont really need to look at the code to notice it most of the time).
Your proposed way to solve this issue is way worse - now, instead of having one monolitic but still simple and well rounded app you have thousands of little scripts that combined are also hessle to review, belong to way more humans with different agendas (instead of single or couple) and would be horror to initialize (really sounds like nodejs ecosystem).
Just get the damn thing and relax a bit. Anything malicious that could be done by some developer is already done by big evil corps anyway (and more) and you cant really escape those.
Life is risky by default. You calculate your ods.
Thinking about it some more, I was being driven in a friend's BMW one day and there was some bad smell coming from outside so I asked if I should press the air recirculation button. It turns out he'd had that car for more than five years and had never pressed that button. In fact, he'd never pressed, nor seemingly even wondered about, most of the buttons in the car. Strange.
I never use escape or any function keys either.
I still can’t figure out how to get in and out of insert mode in sublime text. When it happens I just quit and restart.
I’m starting to wonder why I tolerate this level of ignorance in myself.
I mean, I use key commands constantly. That’s what is odd about all this.
Not sure if joking, but you literally press the button labelled "Insert".
TIL Enter key toggles comment collapsing.
Turns out the f12 key was the culprit; took me longer than it should have to realize she was describing the Firefox developer console.
Push, push-and-hold, and push multiple times quickly.
Bonus: also try Ctrl+E (and Ctrl+A) in text fields, or on the command-line.
(Both of these carry over to iOS, if you’re curious. I just tested them with the iPad keyboard-folio thing.)
Interesting aside: the “Globe” key on an iPad keyboard-folio (the one that opens the IME chooser) has some but not all of the properties of an Fn key. Globe+Left and Globe+Right work as PgUp/PgDn, but Globe+Up and Globe+Down do not work as Home/End. (Or maybe they do, but Home/End just aren’t bound in any app I’ve tested? I don’t want to write+deploy an iOS keysym tester just to find this out...)
cmd-left/cmd-right go to beginning/end of the line.
It seems Word for Mac supports cmd-left/right but not cmd-up/down. Word also supports fn-left (home) and fn-right (end), and fn-opt-left does like ctrl+home on Windows.
e.g. ^A ^K to clear an input line
I use Ctrl-A and Ctrl-E all the time.
You can also plug in arbitrary USB keyboards, or pair arbitrary Bluetooth keyboards, to a Mac, and the Home/End keys on those will also do what you'd expect.
Apple just doesn't bother to put Home/End/PgUp/PgDn keys on their laptops — presumably because they find that people don't need them very often; and that, when the keyboard's size is already constrained, people get more value out of fewer, larger keys (while requiring key-chords for some things) vs. more, smaller keys.
No, they don't. I expect pressing Home to go to the beginning of the line I am on, and I have to hit Command-Left for that, and Home does nothing of value.
Just to pile on with fun new keyboard tricks! Caveat: "linux" here is largely specific to the Desktop environments I've worked with. 'Good terminals' refers to termianls that support emacs keybindings by default, which is the mac os terminal, and most linux bash/zsh terminals at least. I know Cygwin and Conemu respect this under normal usage too.
## Start and end of line:
- Mac: CMD + left, CMD + right
- Linux/PC: Home and End Buttons
- Linux/Mac/Good Terminals: ctrl+a ctrl+e
## "Word-wise" movement:
- Mac: option+left, option+right
- Linux/PC: alt+left, alt+right
- Good Terminals: alt+b, alt+f (mnemonic: 'back' and 'forward')
The 'shift' key can be added to any of the above to select whole words or lines, or parts of lines at a time. Combined with multiple insertion points you've got superpowers.
- Insert toggles between shifting characters after the cursor to the right and deleting the character to the right of the cursor, replacing it with the new character you typed, but not replacing a newline character. While eg. Caps Lock is global, Insert mode is local to the text input that currently has focus - tab or mouse over to a new window and you've lost Insert mode, tab back to the one where you previously set it and you're back to Insert mode.
- Delete is like Backspace, but deletes stuff to the right of the cursor.
- Home, as you discovered, moves browsers to the top of the page. When composing text, it moves the cursor to the start of the line (and vice versa with "End"), CTRL+Home moves to the start of the text entry box.
- Page Up and Page Down shift the cursor by screenfulls of text, typically leaving a couple lines at the top and bottom for context. Note to web developers who are unfamiliar with keyboards: Make sure your fixed/sticky header/footer banners don't hide content when using "Page Up" and "Page Down". Also of note, CTRL+Page Up/Down and CTRL+Tab/CTRL+Shift+Tab shift the window or tab focus within an application, for example to go to the next tab in Chrome or the next file in your IDE.
- Print Screen creates a screenshot. Depending on your setup, this may either go to your Pictures folder, or may go to the clipboard (open an image editor eg. Win+R, mspaint, and CTRL+V to paste). It shares a key with SysRq, which can be accessed with Alt+SysRq+(magic letter), and used to recover from various crash conditions - be careful, if you start hitting letters at random, you'll invoke the bad kind of magic that will shut down your computer.
- Scroll lock was used to stop auto-scrolling an input buffer that was running too fast. Largely neutered in modern OSes, it's still useful in the BIOS when all the hardware initialization messages are scrolling by too fast to read. Sometimes it's also used to toggle keyboard backlighting because it had an LED attached and doesn't have a real function anymore, but depending on the manner in which your OS/hardware neuters this key your keyboard backlighting may not work.
- Pause/Break kills a process like CTRL+C, but sometimes has different specific modes of operation in various debuggers. Access the "break" alternate function with CTRL+Pause.
- Super/Windows key opens the Start menu or search tool. On Macs, it's the Command key and used for lots of keyboard shortcuts. Hyper useful for window management, Super+arrow keys move screens to the left or right half of the monitor, maximize, resize, or minimize them, and Shift+Super+arrow moves them between multiple monitors.
- Num lock toggles between entering numbers with the 10-key section of the keyboard and that section's alternate navigation functions, where 7 is home, 1 is end, 9 is page up, 3 is page down, and 4/8/6/2 are left/up/right/down respectively. Not really important if you've got an inverted-T arrow cluster and Super useful on some dumb 17" laptops that cram in a 10-key section but relegate all these normal navigation keys to arcane random Function invocations on tiny distant buttons crammed into the top of the keyboard if they're present at all. Uniquely, Num Lock is typically remembered across reboots.
I haven't seen that or heard of it happening for probably 10-odd years now. Didn't realize it still worked in Windows 10!
Firefox has specific code to detect banners and reduce the Page Down distance. This code fails on new Twitter.
Today I know what Home/End keys do, because of a random comment on the internet.
I often need to make bigger and smaller jumps with keyboard. In Sublime I use a plug-in that can jump 10 lines up and down but I also need that functionality across the rest of OS. For navigating menus, scrolling through content, moving around spreadsheet. Page up/down is too large jump with the amount of content that can fit modern screens.
(global-set-key [C-down] '(lambda () (interactive) (next-line 10) ))
(global-set-key [C-up] '(lambda () (interactive) (previous-line 10) ))I probably need a scriptable keyboard to make it work across all programs. Some keyboards support Lua, but I think it's only for LED patterns which is pretty retarded.
On iOS: double-tap the top bar
On Windows: use the home key
On Android: swipe your thumb a dozen times really quickly
I'm reading a story on a page with a back to the top button. I get distracted in real life and change the grip on my phone. I look back at my phone to continue reading and I'm at the top of the page. Now I have to find where I was again.
I've probably lost more time from accidentally hitting the back to the top button than the button has saved me time. This has made me paranoid about those buttons and I definitely prefer sites not to have them. Sometimes I switch to desktop mode on my phone just so I don't have that button on the screen.
Tapping the top of the page again takes you back to your scroll position! Incredibly useful for recovering from accidental taps, and I kind of wish iOS would copy it, since it happens more often than I’d like.
I always thought that re-scrollback was just a feature of iOS. I use it all the time in Apollo. But it doesn't seem to work in the Reminders app, nor the Notes app. Way to go Tweetbot and Apollo devs!
Fuck AMP.
Though to play devil's advocate, I'm willing to bet 80%+ of iOS users have no idea the feature even exists, so removing it just because it's available as a system feature doesn't sound like a particularly compelling argument to me.
I think having some kind of sticky navigation instead of scroll to top makes for a much more compelling UX though, since it accomplishes the same goal without the downsides of hitting it by accident causing an irreversible loss of context.
I’m not sure I’ve ever clicked (or tapped) one of those buttons. The same complaint applies to share bars, and honestly, sticky headers as well. I really prefer to just read the content and let my browser handle the chrome.
We had buttons on our keyboards that did this for half a century now. As for phones it should be up to the web-browser to implement it, nobody wants to use your idea of how scrolling should work. My machine already knows how I want to browse my content, don't pretend you know better.
...AARGH! No, scratch that. It's actually infuriating. :)
I mean, that's the only possible conclusion I can come up with, since they give the button such prominence. It's the same with newsletter popups. You shove that in my face, obscuring all other content, it means your site is dedicated to harvesting email addresses, and you want to spam me senseless.
This is ironic. The vast majority of users don't know about most of these functions. They just use their mouse. Even for basic things like:
- navigating & selecting text (words, lines etc.)
- switching between windows
- opening search (like spotlight, if they use it at all...)
- opening & closing windows/tabs, saving files etc.
The list goes on. UI design is not about teaching you how to use a computer. And you certainly cannot expect users to already know.
That said. I think fixed position "back to top" buttons are terrible as well and I would put fixed position header-menus in the same category. They just add clutter and worsen the UX, even for those who almost exclusively use the mouse (as you can simply drag the scroll-bar).
Many don't use the scroll on their mouse/trackpad - they literally look for the scrollbar, click and drag to scroll.
Many are blissfully unaware that the keys Page Up and Page Down move the page up and down or that Home and End move the whole page to the beginning and the end.
BUT, they do know about the Back button on the browser so they end up resubmitting forms/double posting, etc. lol
Maybe we should be pushing browsers to have better UX on-boarding and teaching people that home button will scroll you up to the top of the page etc.
In all seriousness, I hope this will not become another 250kb JS framework we use in our projects..
Had a good laugh about it afterwards haha...
Pretty much every elevator I've been in for the last ten years. I note it mentally because spirit of the music is always at odds with the messages on the display screens.
I think the only elevators where I haven't heard music recently are in residential buildings.
I think we need web un-development to get us out of this javascript tar pit.
Anyway, we did end up having to put a Back to top button. It was clear that users just don’t get it. Most people really don’t know what the Home button does.
That, and you should never use the Mailto: link without writing the email as the text itself. Thanks to webmail, most users do not have their browsers configured to open mailto: so they complain that contact email links on their pages don’t work. Sigh....
That being said seeing the email is nice anyways in case you need to share it with someone or type it into your phone.
Because of the prevalence of webmail like gmail (most of our users are on gmail) there’s many users who aren’t aware that it needs to be configured to open the said webmail page, so the mailto links does nothing. A “Contact me” or “contact support” mailto link won’t open anything, or it will open the default mail client like Mac Mail on Mac....On Windows in the past it would open outlook express lol. :)
Users can fail to configure mailto links to point at their preferred email client irrespective of it being web-based or native. (Unless it is the default for the platform I guess)
That's more the issue. It's just misconfiguration and users who are oblivious to that setting. In the past, I don't believe that Gmail prompts you to make it your default handler, and from the number of support requests we received due to this issue, it's clear that a good number of users do not have their mailto handlers configured.
Cheers!
Joke aside, maybe add a feature to allow user to pause/suspend the "Lifting"? This will give user a chance to "Hey! oh wait" when they "Passed the desired floor by mistake".
Wish this was mentioned on the page, it was a bit embarrassing when it started playing in the middle of our daily standup!
I always mute myself when I'm not speaking
Those endless, highly volatile feeds that often can't even keep the ordering of content between page refreshes are annoying.
[1] https://people.apache.org/~jim/NewArchitect/webrevu/1997/02_...
1 problem in a browser is most definitely not enough to discourage it.
- I use both btw.
It's better than "Mute tab" because it's persistant over multiple sessions.
scroll all the way down to "content"->Additional content settings->Sound
Here you can do stuff.
edit: readability
Our elevators break down quarterly, and for some reason the wait for Otis-approved parts is weeks to months at a time.
So question if you're a frontend engineer: Should I? I never felt the need of a framework despite I render quite a bit of dom elements. Do I have a need that I just don't know right now?
If you just want to make personal projects, it depends a lot on what kinds of projects you want to make. React won't really help you with the sort of 2D-game-type programming you're using Pixi.js for. On the other hand, if you think the Reddit redesign is really good and you want to make a website that works exactly like that, the React community is a good place to start.
But one of the main benefits of using React that I've heard about is that it forces all the members of a development team to organize (certain parts of) their code the same way. This isn't really an issue on personal projects. Personally, I spent about a year working with React for a job, but I continue to write vanilla JavaScript on my own time.
(You can learn other frameworks than React, but React is a good starting point because it's the most popular one. Then you can learn about Framework X by reading "how is Framework X different from React" articles online.)
Conversely, if I think the reddit redesign is horrible, I guess I should stay well away? ;)
Which it's not.
The issue I see today is many of these frameworks started as ways to build efficiency; they have degraded into disciplines that require exorbitant investment without corresponding business value.
=== On a side note: There is an alternative to this that does far more. Vimium is available at:https://chrome.google.com/webstore/detail/vimium/dbepggeogba... It's based on Vim commands so It helps if you have some familiarity with that. It allows you to perform all basic features you would use in a web browser, like scrolling, refresh, forward/back etc; using only keystrokes.
Instead, it would be great to have something:
- That works on any website
- That can scroll to top, to bottom, and back to the place where you've scrolled from.
- Doesn't alter the websites appearance.
So I've created a tiny Chrome extension that solves all of this: https://github.com/sv3k/topscroll
After some time, you get used to it on reflexes level.
What problem is this even trying to solve?
[1] https://www.primative.net/blog/how-to-get-rid-of-the-flash-o...
Movement is janky on latest Firefox on Win10, 4K screen. I don't know if that matters much, but I'll leave it here just in case you actually wanted feedback.
If there is no sound at all, there shouldn't be an icon.
It scroll up slowing, harmful to my eyes. I'd rather "teleport to the top" or quickly scroll to top on my own than watching the animation…
And I cannot cancel the scrolling in the middle of process if I accidentally click it.
> Finally, a "back to top" button that behaves like a real elevator, by adding elevator music to quietly soothe the awkwardness that can ensue when being smoothly scrolled to the top of the screen. This is very serious stuff, here's a demo!
Can also be a bit bumpy when it passes "floors".
I normally always have my laptop on mute, because I'm paranoid about bothering people.
I was shocked, but that was a fun one, I laughed too.