20 ms·
Elevator.js – A “back to top” button that behaves like a real elevator
- duxup 6y agoThis both absurd....and seems more natural than most browser experiences...
- djohnston 6y agoI love it!
- wtvanhest 6y agoClever, really is a better experience. I’d love to see this used more. I haven’t seen anything like this in a long-time.
- zanderwohl 6y agoThis gave me a good laugh. Great project.
- rosstex 6y agoI was hoping for a Koyaanisqatsi-esque visual interlude as the page scrolled back up, but this is still satisfying.
- yefim 6y agoFor those that didn't get it, turn your sound on.
- cmbell715 6y agoI didn’t realize I had my volume all the way up. Scared the crap out of me.
- Mirioron 6y agoThis is pretty funny, but God do I hate back to the top buttons. 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.
- saagarjha 6y agoI really hate them on iOS, because the system comes with back-to-top functionality so all these buttons are doing are looking ugly and covering part of the page. And don’t even get me started on when AMP breaks scrolling…
- bdibs 6y agoFor anyone else who was wondering, you can tap the top of the address bar on iOS Safari. I think it has to be expanded first. I didn’t know that and hope it helps.
- saagarjha 6y ago(This works through the system, by the way; it’s not just limited to Safari.)
- deleted 6y ago[deleted]
- hackmiester 6y agoIt works just about anywhere, actually. Just tap the time (or tap the earpiece, on a notched phone) to scroll to the top. Works in Safari, Chrome, Messages, Reddit, Tumblr, Twitter... the list of exceptions is short.
- ProfessorLayton 6y agoI just want to take a moment to give a shoutout to the Tweetbot devs, which expanded on iOS’ back-to-top functionality: 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.
- a-wu 6y agoThe Apollo reddit app also does this! Really great feature when I want to go back up to look at the content again and then go back to the comment I was reading.
- deleted 6y ago[deleted]
- teknopurge 6y agoI think other than being kitchy, the part I love the most is NO FRAMEWORK: plain js. No pre/mid/post/art-deco processor that turns 4 hours of work into 40 hours.
- Aperocky 6y agoI've been developing some games and frontend on my free time for fun. I've been using typescript and Pixi.js but other than that nothing else. As a backend engineer, I've always thought about learning a frontend framework but I've never actually had a strong need of it. 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?
- csande17 6y agoIf you want to get a job as a frontend engineer, you should learn React because it's a tick-box on a lot of job postings these days. 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.)
- Wowfunhappy 6y ago> if you think the Reddit redesign is really good Conversely, if I think the reddit redesign is horrible, I guess I should stay well away? ;)
- 6y ago
- SoylentOrange 6y agoThis is so pointless I absolutely love it
- gnarbarian 6y agoI love stupid fun stuff like this.
- CGamesPlay 6y agoI was expecting the button to light up and having to wait before being taken to the top. Maybe an improvement for version 2.0!
- nirui 6y agoAnd then you have to select the floor before it's going up, Ha! 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".
- sergeykish 6y agoClose the doors, sometimes hangs, support button. Stairs and other passengers.
- keyle 6y agoThat's fun. Take that infinite scrolling pages!
- sidcool 6y agoThis is entertaining. HN continues to pleasantly surprise me.
- rgoulter 6y ago"Elevator" and "JS" reminds me of Elevator Saga. https://play.elevatorsaga.com/ https://play.elevatorsaga.com/
- volkanvardar 6y agoI was about to write the same thing. The perfect puzzle for a programmer.
- nsarafa 6y agoMade me laugh! Would be way more awesome if gates closed above the page like an old school elevator before it went back up
- xrd 6y agoHow many other people are quitting web development after seeing this? I think the work is done, there isn't anything else needed here.
- encom 6y agoWhat's the opposite of development? I think we need web un-development to get us out of this javascript tar pit.
- izzydata 6y agoClearly it would be velopment.
- imaunitard 6y ago"I'm a veloper" - Ralph Wiggum
- egypturnash 6y agoMaking actual stuff instead of a “content framework”.
- gchokov 6y agoIt woke up my wife, as I tried it on my phone when the stupid elevator music played it out loud :/ In all seriousness, I hope this will not become another 250kb JS framework we use in our projects..
- fergonco 6y agoSame here, it's 6.40am here and I am about to start my 2h sprint before my kid wakes up. I feel I deserve for browsing HN instead of being productive :D
- rkagerer 6y agoThanks I didn't notice there was music.
- fbnlsr 6y agoI had to stumble upon your comment to realize that thing made noise. I was wondering how a "scroll to top" function was at the top of HN.
- ss3000 6y agoThe music gave me a small heart attack as well since I was just watching a movie earlier and had my volume turned way up. Had a good laugh about it afterwards haha...
- esperent 6y agoIt's 1.77kb of JS. But in any case, I don't think you need to worry about many people using it.
- chefandy 6y agoFirst if all, fuck webpages that play sound unexpectedly. Secondly, what percentage of elevators even play music these days?
- reaperducer 6y agoSecondly, what percentage of elevators even play music these days? 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.
- kabacha 6y ago"back to top" is just such an epitome of how out of touch some modern design is. 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.
- MiddleEndian 6y agoBut if you make a really big button (or a button that appears out of nowhere on mouseover on PCs) that people frequently hit by accident, your "engagement" metric will improve, showing that the feature is valuable!
- dahauns 6y agoIt's funny because it's (probably) true. ...AARGH! No, scratch that. It's actually infuriating. :)
- MiddleEndian 6y agoThe worst offender of this right now is email programs. You go to click an entry in your email list and then suddenly you've archived it with a little icon that wasn't previously there.
- encom 6y agoA floating back to top button just means they don't want you to waste time reading the content. You should click around and view some more ads instead. 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.
- maverwa 6y agoI think its actually a result of people using only (or at least, most of the time) the mouse to browse the internet. If you just click from one link to another, pressing "home" is actually quite a far reach. There are people around that still think you have to drag the scrollbar. Sure, "home" is way faster, but a (well implemented) choice helps some and does not hurt.
- thunderbong 6y agoWarning - There's elevator music as well! Wish this was mentioned on the page, it was a bit embarrassing when it started playing in the middle of our daily standup!
- Wowfunhappy 6y agoI respect that it put you in a bind, but a warning would have totally ruined the joke for me.
- iso1631 6y agoMaybe you should have been standing up rather than idly surfing :D I always mute myself when I'm not speaking
- joe_momma 6y agoI expected a few stops along the way
- deleted 6y ago[deleted]
- Wowfunhappy 6y agoWe need a “ding!” sound effect when you get to the top!
- disillusioned 6y agoIt does?
- Wowfunhappy 6y agoHuh, that didn’t play on my iPhone. The music just stops.
- Gigablah 6y agoThe demo page needs a lot more floors.
- visarga 6y agowith fucking music, I wasn't prepared for that
- CptKriechstrom 6y agoyep .. almost blew my ears out :/
- mhd 6y agoWell, I just clicked the link to see if this also includes the Girl from Ipanema…
- Romanulus 6y agoImplement this on infinite scrolling sites with sounds of crying and screaming, then we're talkin'.
- jimmykang1016 6y agoscared the beejesus out of me haha
- nielsbot 6y agoWhat, no closing doors? ("The little lights, they’re not twinkling.")
- aabbcc1241 6y agoThat's the point of this library ? 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.
- anonytrary 6y agoHe did it for fun. From the Github: > 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!
- aabbcc1241 6y agoI missed the music! This is awesome
- kens 6y agoIs there any way to tell Chrome not to make sound unless I explicitly want it? Maybe I have less tolerance than most people, but I just can't stand it when my computer makes unexpected noise.
- WrtCdEvrydy 6y agoRight click mute tab (i think it might be experimental)
- theon144 6y agoHaha, it used not to be, but then Google crippled the feature. Firefox is looking better by the day.
- hackerman123469 6y agoI have issues with Firefox as well. 1 problem in a browser is most definitely not enough to discourage it. - I use both btw.
- rnotaro 6y agoGoogle changed it for "Mute website" when right-clicking a tab and it's not experimental. It's better than "Mute tab" because it's persistant over multiple sessions.
- the_cramer 6y agoYour tolerance seems right to me. I've got a german chrome so menu names might not be correct. Options->Data protection and security scroll all the way down to "content"->Additional content settings->Sound Here you can do stuff. edit: readability
- bbx 6y agoThere is a setting or an extension I use to mute all sites by default. You can then whitelist domains one by one. It’s a lifesaver.
- vishwajeetv 6y agoThis is fun, but on the serious note, we should not be modifying the scroll behaviour of the browser in any way. It is not as usable.
- anonytrary 6y agoIt's not a bad argument. Similarly, I think everyday life would also be confusing if the laws of physics changed depending on what restaurant you walked into.
- enriquto 6y agoIn a few years mankind will "discover" the scroll bar and the inventor will be hailed a hero.
- baylearn 6y agoThanks, you made my day.
- noodlesUK 6y agoAnd here I was thinking that websites didn’t play sound without a nag prompt on iOS...
- dellinspiron 6y agoA real elevator would have stopped at each level.
- numlock86 6y agoCan we just go back to buttons that _jump_ straight to the top instead of scrolling? Please? What problem is this even trying to solve?
- fbnlsr 6y agoThat's what I did on my blog [1]. I tried different methods and realized that it should be a simple link that jumps you straight to the top and nothing fancy. The only JavaScript used it to determine when to display the link. [1] https://www.primative.net/blog/how-to-get-rid-of-the-flash-of-unstyled-content/ https://www.primative.net/blog/how-to-get-rid-of-the-flash-o...
- cool-RR 6y agoThe "back to top" functionality is so useful in web pages. I wish they would make a dedicated button on keyboards that just takes you to the top of the page. Better yet, it can work in other apps too! It could, for example, take you to the beginning of a line when you're writing text. 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.
- supermatt 6y agoCant tell if this is sarcasm or not, but "Home" key does this...
- jspash 6y agoThe Home key is fine if you're on a PC. On a Mac the only time you'll see one is on some extended external keyboards. It's rare, if nonexistent on Mac laptops. 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.
- itskwanyall 6y agoI’m normally a macOS guy but I’m currently using windows full time to give WSL a proper chance. The thing I miss most is CMD+Arrow to go to the start/end of something. I think it’s a beautiful system, alt+arrow to jump a word, cmd+arrow to jump to the start/end. The home/end keys are always so hard to find especially when they could be anywhere depending on your keyboard
- deadbunny 6y agoI'm not a Mac user so I may be missing something but can't you do that with Ctrl+left/right?
- 6y ago
- INTPenis 6y agoCould have done without the music in a coffee shop right now. :) I normally always have my laptop on mute, because I'm paranoid about bothering people.
- dfee 6y agoI think the music was the punchline.
- beshrkayali 6y agoPlaying music is a terrible idea.
- dfee 6y agoThat’s the punchline.
- FriendlyNormie 6y agoSound warning? Shithead.
- scared2 6y agoNice one. Something important missing in this framework is a logic to check the number of people in the elevator. You should use webRTC to count the number of users using the elevator. And if it is more than 8 it should sound alarm!
- scared2 6y agoSo the modified algorithm will be as follows. When the user clicks elevator, it first sends a distributed query to all browsers and each browser replies with 0, if elevator is not being used, or 1 when it is used. After the polling is done, it sums all responses. If sum_resp_elev<8:move() else Ring_alarm()
- sriku 6y agoNope. When you're at the bottom of the page, you should first have to call the elevator. Then it should stop at all those levels at which other people have also called it before coming to your position. Then you get a chance to be kicked out for being overweight.
- ara24 6y agoDon't use it in case of a fire
- baybatu 6y agoI have just found a website for author: https://www.usa.gov/find-a-job https://www.usa.gov/find-a-job
- notfound404 6y agoJust wondering, is it possible to add a global 'back to top' button on mobile? Shall the browser implement it?
- deleted 6y ago[deleted]
- firasd 6y agoFor those that don't know: on iPhone, touching the top (like near the front facing camera) works like a jump to top button in many contexts.
- mafriese 6y agoThere is a bug when it's finished and you instantly scroll down and press the button again that it then won't play the arrive sound if it arrives.
- sideproject 6y agoHahaha. Nice one. As soon as the muzak came on, I had to chuckle. :)
- dmos62 6y agoBack to the top buttons are a symptom of the system-within-a-system feature of Web. The Web page isn't a document: it's a system, a virtual machine. Just like running another OS in VirtualBox implies bad interoperability and a lot of duplicated effort with the host OS, so too does running web pages. In a quest to be everything, Web became a bogged down, developer-time devouring beast. It can do almost anything, but you don't want to do anything on it.
- sergeykish 6y agoIt means universal, think smalltalk. Has ups and downs - not much integration with a host comes with independence from a host. IE was created because Microsoft feared web would make OS inconsiderable. There was bold claim even before Netscape's Constellation [1]. So everything goes like it was predicted years ago. [1] https://people.apache.org/~jim/NewArchitect/webrevu/1997/02_07/developers/02_07_97_2.html https://people.apache.org/~jim/NewArchitect/webrevu/1997/02_...
- genezeta 6y agoJust in case author reads this... 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.
- OakNinja 6y agoFeedback: The back to to top button gets obscured by the navigation keys on iPhone. Also, the page would benefit from a more fitting viewport on small devices.
- fnordsensei 6y agoVery good, but it should also be non-functioning 60% of the time due to repairs and/or inspections.
- esperent 6y agoI'm trying to think of times when I've seen a non-functional elevator and can't think of one.
- hknapp 6y agoTry living in an eight story crapartment and you'll understand.
- 52-6F-62 6y agoCome live in my building... we're usually operating at half-capacity. Presently we're down to 1/4 elevators for a 32-story residential building. It's a little on the frustrating side. Our elevators break down quarterly, and for some reason the wait for Otis-approved parts is weeks to months at a time.
- chrisBob 6y agoIf your elevator is closed 60% of the time for repairs please don’t use it.
- deleted 6y ago[deleted]
- kube-system 6y agoI'd rather ride an elevator that is closed 60% of the time for repairs than an elevator that is closed 0% of the time for repairs.
- throwaway092318 6y agoThis explains a lot about your username!
- globular-toast 6y agoUgh, I thought I had tabs muted by default in my browser... Clearly I was mistaken. Turns out I need an extension for it. But now I have ugly mute symbols on every single tab which isn't "default" at all. What I want is sound symbols on tabs that I have expressly un-muted.
- jaifraic 6y agoWith Chromium based browsers you should be able to set every website to be muted at first. You'll only see a mute symbol on the tab when the tab tries to play sound. If there is no sound at all, there shouldn't be an icon.
- globular-toast 6y agoThat does sound like what I want. This is the first time I've heard of a compelling reason to use Chromium over Firefox. Hope I can find a decent solution for Firefox.
- ybbond 6y agosound alert really needed there. I was shocked, but that was a fun one, I laughed too.
- codetrotter 6y agoI thought “behaves like a real elevator” meant that it would make stops along the way. Oh well ¯\_(ツ)_/¯
- realYitzi 6y agowow. When I have the time I'll have to add a janky gate that closes but you can still see the text passing by. Can also be a bit bumpy when it passes "floors".
- carlhjerpe 6y agoNobody went through source and noticed the Dalek hiding in the comments? Made my day.
- retpirato 6y agoI did.
- alpaca128 6y agoI have never needed a "back to top" button in a web browser. However on almost all sites that offer one I've been missing a "jump to where I just was before I misclicked" button. Those endless, highly volatile feeds that often can't even keep the ordering of content between page refreshes are annoying.
- Tade0 6y agoGrowing up in a post-communist country I have very different expectations regarding how an elevator operates, namely that instead of a smooth start/stop it should have two speeds - the slower used for stopping exclusively.
- mysterydip 6y agoThis is so useful and silly I love it. Would have been perfect for my late 90s geocities site, had the functionality existed back then.
- jaekash 6y agoWow that button is like a portal straight to hell, well done I guess. Most soul destroying thing I have yet encountered.
- raobit 6y agonice tune though while going to top
- raobit 6y agonice tune though while going to top !!
- arrayjumper 6y agoNow we need a go to bottom button.
- leonardteo 6y agoA lot of people already mentioned here the Home button. Anecdote: for years we kept getting users asking for a back to top button and we always told them to just use the Home button and they thought it was the most amazing thing ever. Most of our users are on Windows. 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....
- kevincox 6y agoI don't know why this is "thanks to webmail". At least firefox can handle this perfectly fine. That being said seeing the email is nice anyways in case you need to share it with someone or type it into your phone.
- leonardteo 6y agoTo clarify, all browsers CAN handle the mailto link as long as the user configures it to open the correct email client. That’s key because there’s many oblivious users who don’t even know about this setting (we know from the number of support requests we get from users angry that the contact link they created on their websites “don’t work”!). :) 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. :)
- kevincox 6y agoI still don't see how webmail has anything to do with it. In fact opening Gmail prompts me to make it my default mail handler. 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)
- andai 6y agoHad my volume turned up, Christ this nearly gave me a heart attack.
- XCSme 6y agoI expected it to stop at each floor. :(
- neop1x 6y agoNot enough procrastination already?
- annaixx 6y agoHello my hot photos are here .. http://69chat.club http://69chat.club username annaxx))
- annaixx 6y agoHello my hot photos are here .. http://69-chat.club http://69-chat.club username annaxx))
- annaixx 6y agoHello... my hot photos are here .. http://69-chat.club http://69-chat.club username annaxx
- annaazzx 6y agoHello my hot photos are here .. http://69chat.club http://69chat.club username annaxx))
- annaaa6 6y agoHi.. My hot photos are here... http://69chat.club http://69chat.club My nickname annaxx
- alan_n 6y agoI thought this was going to scroll up to each heading and stop scrolling if you touched the screen. Now that would have been useful. Otherwise I tend to hate scroll to top buttons. I'm always accidentally touching them and usually they won't stop till you're at the top. It's terrible.
- Sodman 6y agoI love the Dalek Easter Egg in the js source code
- rglover 6y agoThat was charming. Always a fan of little doodles like this that are completely unnecessary but you're glad they exist.
- QuadrupleA 6y agoCute gag, but why is this top story? Not that there's anything wrong with /r/ProgrammerHumor but I go to HN for different reasons.
- trevordixon 6y agoBecause a few hundred people upvoted it over the last few hours. That I know for sure, though I can't speak to their reasons for visiting HN in the first place.
- annaaia 6y agomy hot photos are here... http://69chat.club http://69chat.club my nickname annaxx
- rickyplouis 6y agoIf this were a chrome extension, I'd be down.
- Nebasuke 6y agoCute, but the movement actually made me feel nauseous.
- LordFast 6y agoScrolling back to top like an animal? No thanks, I just refresh the page instead as a civilized person would do.
- just-ok 6y agoWhich only works if haven’t hit any in-page anchor links ;) otherwise, you’d snap right back to a particular section after a refresh.
- pikuseru 6y agodouble tap the status bar on iOS
- retpirato 6y agoIs there any way to make this work as a bookmarklet that I could just click to use on any site? === 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/dbepggeogbaibhgnhhndojpepiihcmeb 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.
- sv3k 6y agoI don't like "back to top" buttons because they take visible space and could be anywhere (if any) depending on the website. I don't like Cmd+Up keystrokes either on my mac. 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 https://github.com/sv3k/topscroll After some time, you get used to it on reflexes level.
- retpirato 6y agovimium does that & a lot more.
- t0astbread 6y agoI'm on mobile, does this framework at least disable the home button? I would consider that a must-have for elevator frameworks.
- infogulch 6y agoI prefer rockets to elevators: https://factorio.com/blog/post/fff-353 https://factorio.com/blog/post/fff-353
- _theory_ 6y agoGosh, I could press that button all day.