[HN Gopher] Elevator.js (2015)
___________________________________________________________________
 
Elevator.js (2015)
 
Author : susam
Score  : 246 points
Date   : 2022-02-24 18:15 UTC (4 hours ago)
 
web link (tholman.com)
w3m dump (tholman.com)
 
| cpcallen wrote:
| A very cute bit of coding.
| 
| But: I've always wondered who uses these "back to the top"
| buttons, and why?
| 
| Until quite recently I hardly ever had reason to go back to the
| top of the page--I was much more likely to click a link or click
| the back button--and if I did a quick tap of the home key or
| flick of the touchscreen usually did the trick. Conveniently,
| both gestures work even if you've not gotten all the way down to
| the "back to the top" button.
| 
| More recently with Chrome on iOS I find myself wanting to get to
| the top so I can use the pull-down-then-right gesture to close
| the tab. With really long pages sometimes a single flick isn't
| enough to get me all the way to the top--but then, on a really
| long page I'm also unlikely to have gotten all the way to the
| bottom.
 
  | dheera wrote:
  | I think it was more of a thing in a bygone era when scroll
  | wheels and swiping didn't have that inertia effect to get you
  | to the top efficiently.
  | 
  | Nowadays you just swipe down fast once and the inertia gets you
  | to the top but it used to once not be like that, and you had to
  | thumb your screen 15 times to free solo your way to the top.
 
  | electroly wrote:
  | On iOS, tap the top of the screen to automatically scroll to
  | the top.
 
    | eyelidlessness wrote:
    | This also works in most apps, unless they're using some weird
    | nonstandard UI (which is, perhaps surprisingly, less common
    | on iOS than on macOS). And it works with Reachability.
    | Neither of which are especially discoverable, but super handy
    | if you know about them.
 
    | hinkley wrote:
    | There's usually some combination of the Home key that does
    | the same on most desktop browsers, but the control key varies
    | by OS and sometimes browser.
    | 
    | What there isn't on iOS as far as I'm aware is a way to
    | scroll to the bottom. On infinite scroll pages accidentally
    | navigating away as one can easily do with touch screen
    | results in a lot of frustration.
 
    | majewsky wrote:
    | Oh THAT'S what that's supposed to be. I was always wondering
    | why my viewport jumps all over the place unprompted.
 
    | ComputerGuru wrote:
    | Except on AMP pages or on weird custom front ends. Long love
    | plain html and css. Please don't override the platform
    | default scroll acceleration either!
 
    | mwexler wrote:
    | And is frustratingly, conspicuously missing in Android. Every
    | time I switch to my Android tablet, it's becomes a hugely
    | missing piece for any content consumption app that scrolls.
 
      | Xenoamorphous wrote:
      | I think I read here on HN that Apple holds a patent for
      | that functionality.
 
    | frankfrankfrank wrote:
    | Yeah, I wish there were a way to scroll to the bottom too,
    | i.e., double-tap the top of the screen/bar. It would come in
    | handy quite frequently for me.
 
  | [deleted]
 
  | sandreas wrote:
  | Yeah, in the days where fixed nav at top is often used by
  | default it is not as common to have TOP links any more.
  | Recently I searched for a way to PREVENT going to the top
  | clicking a link  that only
  | had JavaScript in it and always jumped back and forth due to
  | AJAX page reload.
  | 
  | The solution[1] I found was using A no jump link.
  | 
  | [1]https://pilabor.com/blog/2021/03/html-and-css-tricks/#no-
  | jum...
 
  | throwaway889900 wrote:
  | On a pull-to-refresh style widget, the scrollbar needs to be at
  | the top. This provides a shortcut to jump to the top and
  | refresh.
 
  | jerf wrote:
  | I think back in Ye Olde Days it was harder for people who just
  | had a scrollbar, and weren't necessarily all that familiar with
  | that, either.
  | 
  | There has never been a technical need for it. The "Home"
  | keyboard button when pressed on a web page has taken you to the
  | top probably since the very first web browser was released. But
  | there's a lot of computer users for whom that entire complex of
  | keys off to the right of Enter on a standard keyboard is The
  | Outer Hinterlands, Where There Be Dragons, except for maybe the
  | arrow keys. Also the entire line of function keys. Not everyone
  | is an expert.
 
    | unkulunkulu wrote:
    | Reading your post I realized that I have not pressed a Home
    | button for years. Now I have a strong Home button (and full
    | sized keyboard in general) nostalgia and cannot sleep!
    | 
    | I will just go ahead and press it next time I see a full
    | sized keyboard I swear!
 
| davejitsu wrote:
| It's funny how sites used to play music all the time and now
| people are on the phone with the FBI to report any site with
| audio
 
  | hinkley wrote:
  | I was the accidental instigator of an incident where Mosaic for
  | Windows ended up with April Fool's jokes embedded in it.
  | 
  | It was probably the first time I noticed what others have
  | noticed since then, which is that I have a way of asking
  | questions that causes other people to react (often more than my
  | attempts to directly influence).
  | 
  | All I said was, "Isn't this going to be our last release before
  | April 1?" Everyone got quiet for a minute, their eyes glinted,
  | and we went from releasing at a reasonable hour for once to
  | deploying at 1 am. Unfortunately the lead engineer (who ended
  | up putting an audio clip of himself knocking on his CRT and
  | saying, "hello? Is anybody out there?" on an idle timeout) and
  | I had worked out all of the off-by-one errors on date
  | calculations in Win32 early in the evening when we were still
  | sharp, only for him to change the numbers in a crisis of faith
  | later in the evening. So the whole thing fired on April 2.
  | Which luckily was a Sunday, so few people using it at work or
  | for classes were affected.
  | 
  | It was all fun and games until the emails started coming in
  | informing us that we may have been hacked. I like easter eggs
  | in my games, but I've only ever mentioned this to coworkers as
  | a cautionary tale about impulses and judgement when tired.
 
  | Semiapies wrote:
  | It's a funny thing. The Gemini people are so about a retro take
  | on the web without any media you don't explicitly click on, but
  | even twenty years ago, most of the history of the web involved
  | media playing.
  | 
  | (Mind, everyone got sick of unwarned, auto-playing media.)
 
  | MisterTea wrote:
  | We hated it back then too.
 
    | dinkleberg wrote:
    | You hated it back then
 
      | hinkley wrote:
      | There are dozens of us. DOZENS.
 
  | jdrc wrote:
  | websites are now meant to be "content" for google or social
  | media. Social media are allowed all the permissions, websites
  | no.
 
    | hinkley wrote:
    | We only like audio or video on a page when the point of the
    | page is audio or video. Youtube. Conference slides. Podcasts.
    | 
    | And even then I have a bad habit, in part due to multiple
    | monitors, of trying to mix tabs and windows and sometimes I
    | cannot for the life of me locate the tab that is playing when
    | someone needs me for something. I may need a new rule about
    | where such tabs need to live (separate window, one monitor,
    | virtual desktop, something).
 
      | jdrc wrote:
      | then you have messaging apps that need to make
      | notifications and they can't. The way google blocks audio
      | at this point is not good.
 
        | hinkley wrote:
        | What would be nice is to be able to grant temporary
        | notifications. Probably 20% of the time I'm not keen on
        | granting permanent rights to some web page to ping me but
        | I might be okay with doing so until I close the tab or
        | the browser restarts.
 
  | KMnO4 wrote:
  | 
 
  | duxup wrote:
  | I miss the whimsy of the old web. I suspect even the folks who
  | participated in that whimsy and now turn their nose up at a
  | site with an odd design, or sound are to blame.
  | 
  | Whimsy is still out there to some extent but just not as
  | prevalent.
 
    | kixiQu wrote:
    | In case anyone wants to sniff around for some, there's some
    | left in personal sites, often with an explicitly nostalgic
    | vibe: https://yesterweb.org/webring/members.html
    | 
    | https://www.kickscondor.com <- anything in the kicksverse
    | 
    | http://tetrageddon.com/ <-- nathalie lawhead has some _wild_
    | net art projects
 
      | bluejellybean wrote:
      | These types of links are why I'm still hopeful for the
      | internet as a platform. What a hit of crazy weirdness out
      | of some random persons brain, just excellent.
 
      | michaelpb wrote:
      | kickstcondor has a cool art style, but from my
      | understanding it isn't exactly a personal site, given it's
      | run by multiple people pretending to be a single person,
      | who actually are doing this for work at Meta / Facebook:
      | https://usesthis.com/interviews/kicks.condor/
      | 
      | I hadn't heard of some of these other ones, and they look
      | cool, thanks for sharing!
 
    | nkrisc wrote:
    | Auto-playing music was obnoxious then and it's obnoxious now.
    | I didn't think there was anything whimsical about it. About
    | as whimsical as getting an air horn blown in my face when I
    | walk into a room.
 
| btdmaster wrote:
| Stanley Parable Ultra Deluxe JavaScript Port?!
 
| endisneigh wrote:
| Why? Can't you just use anchor tags?
 
  | marginalia_nu wrote:
  | Isn't that the punchline of the joke? At least I took it as a
  | joke poking fun at javascript libraries that re-implement basic
  | features in a more obnoxious fashion.
 
    | duxup wrote:
    | I think it's kinda fun actually...
 
  | Biganon wrote:
  | Because... humor?
 
| happyrock wrote:
| Warning: audio
 
  | contravariant wrote:
  | _OH_ , is that what it was. My mistake for having the sound
  | muted I supposed.
 
  | charles_f wrote:
  | For all of us who took that at work in the bathroom.
 
    | jonny_eh wrote:
    | Hearing phone sounds that come from stalls is the best reason
    | to return to office.
 
    | CSSer wrote:
    | I'd bust out laughing if I heard this in a stall.
 
| bjd2385 wrote:
| This is awesome haha
 
| lopis wrote:
| I give it 3.5 / 5. It needs to preload the audio at least shortly
| before I click the button for optimal experience.
 
| rayrag wrote:
 
  | pwython wrote:
  | I bet your cats got really startled.
 
  | pc86 wrote:
  | I'll take "Slight Overreactions" for $1,000 please.
  | 
  | It's a joke, calm your shit.
 
  | dang wrote:
  | Please don't attack others. It's not what this site is for, and
  | it destroys what it is for.
  | 
  | Perhaps you don't owe websites that play audio better, but you
  | owe this community better if you're participating in it.
  | 
  | https://news.ycombinator.com/newsguidelines.html
 
| dstik wrote:
| This is so fun! Great work
 
| mishraprince wrote:
| Why that audio? Scared, I could have spilled some fine coffee!
 
  | mos_6502 wrote:
  | I submitted a PR for configurable volume ~2015 [0]. For as
  | often as I see this complaint in threads about the project,
  | it's a shame that the author isn't interested in implementing
  | it.
  | 
  | [0] https://github.com/tholman/elevator.js/pull/64
  | 
  | [1] https://github.com/tholman/elevator.js/issues/113
  | 
  | [2] https://github.com/tholman/elevator.js/issues/123
  | 
  | [2] https://github.com/tholman/elevator.js/issues/124
 
  | shakezula wrote:
  | Yeah, fuck this audio, it literally made me rip my earbuds out
  | because it was so loud and unexpected. Straight up asshole
  | design.
 
    | yhoiseth wrote:
    | It's elevator music. Relax and enjoy the ride
 
      | pc86 wrote:
      | Oh but you don't understand! They had to _take their
      | earbuds out_. Clearly this is a malicious site and should
      | be treated as such! The _volume_ , after all. Yhoiseth, the
      | _volume_.
 
    | Mogzol wrote:
    | The audio is the whole point of the library. Otherwise you
    | could just use                 window.scrollTo({ top: 0,
    | behavior: "smooth" })
 
  | Semiapies wrote:
  | Go easier on the fine coffee, then.
 
| maupin wrote:
| There's a slight pause between when you click and the elevator
| starts rising.
 
  | phailhaus wrote:
  | Just like a real elevator!
 
| huhtenberg wrote:
| Most excellent, but the music needs to fade-in and the ride
| should end with a ding.
 
  | Minor49er wrote:
  | It does end with a ding
 
| burnt_toast wrote:
| Loved the audio. I thought this was a serious library and was
| wondering why anyone would use it for something so simple until
| it started to play music.
 
| pedroma wrote:
| That scared the shit out of me. Thanks.
 
  | tanseydavid wrote:
  | I could almost perceive the scent of Chanel No. 5 and roasted-
  | cashews while I was riding on the UP-elevator.
 
| node-bayarea wrote:
| Fantastic surprise!
 
| ChrisArchitect wrote:
| (2015) unless there's something new here
| 
| Lots of previous somewhat recent discussion:
| 
|  _2 years ago_ https://news.ycombinator.com/item?id=23623470
| 
|  _7 years ago_ https://news.ycombinator.com/item?id=9416993
 
| [deleted]
 
| soheil wrote:
| All the comments hating on the audio is hilarious, I have to
| admit the audio is definitely louder than normal. It seems to
| have been tampered with to increase its loudness. Combined with
| the fact that the browser wouldn't have played it if it wasn't
| for the click interaction for "back to the top", which is of
| course the whole point of this demo. If intentional, clever and
| definitely deserves a HN front-page recognition.
 
| detaro wrote:
| No voice announcements? :/
 
| minimalc wrote:
| The Factorio blog [1] does a similarly fun thing with it's return
| to top functionality. It's a fun little easter egg.
| 
| Hint: rockets go up
| 
| [1] https://www.factorio.com/blog/post/fff-367
 
  | satyrnein wrote:
  | I regret that I could only do it once.
 
| [deleted]
 
| AA-BA-94-2A-56 wrote:
| Going to slip this into prod real quick
 
| joshuajomiller wrote:
| This should really be mandatory for any mall or office block
| website
 
| [deleted]
 
| olex wrote:
| Expected the music, was pleasantly surprised by the great comedic
| timing of the bell. Very nice.
 
| CGamesPlay wrote:
| Many comments on the previous discussions:
| 
| June 2020 (313 comments):
| https://news.ycombinator.com/item?id=23623470
| 
| April 2015 (66 comments):
| https://news.ycombinator.com/item?id=9416993
 
  | dang wrote:
  | Right you are. Macroexpanded:
  | 
  |  _Elevator.js - A "back to top" button that behaves like a real
  | elevator_ - https://news.ycombinator.com/item?id=23623470 -
  | June 2020 (313 comments)
  | 
  |  _ElevatorJS - Scroll to top the old-fashion way_ -
  | https://news.ycombinator.com/item?id=17048610 - May 2018 (1
  | comment)
  | 
  |  _Finally, a "back to top" button that behaves like a real
  | elevator_ - https://news.ycombinator.com/item?id=9446389 -
  | April 2015 (10 comments)
  | 
  |  _Elevator.js_ - https://news.ycombinator.com/item?id=9416993 -
  | April 2015 (66 comments)
  | 
  | (Reposts are ok after a year or so. This is in the FAQ:
  | https://news.ycombinator.com/newsfaq.html.)
 
___________________________________________________________________
(page generated 2022-02-24 23:01 UTC)