Readit News logoReadit News
gregsadetsky · 2 years ago
Hey all, I wrote to dang a few months ago -- the non sharp upvote button was bothering me on mobile (and desktop when zoomed in), and I felt like the Y could be sharper too. These were the only elements that were fuzzy - everything else is text, and scaled perfectly!

We collab'ed on it together (more praise for dang as if he needs it -- he was incredible through and through) and I'm so happy to see it live!!

I built two micro tools to help nail it down if anyone is curious (aka make it visually seamless):

https://gregsadetsky.github.io/yc-logo-svg-comparison-editor...

https://gregsadetsky.github.io/yc-vote-button-editor/

(check the top right of both pages to see the UI controls)

Uh... AMA? Suggestions? Thoughts?

Thanks for the support -- so far nobody hates it? Does anyone hate it?

Cheers!

tomxor · 2 years ago
Nice work!

My only suggestion is to optimise it, which we have :) (Lifting this from lower down in the thread). The following SVG fragment is a drop in replacement for the <img> tag and produces the same result, albeit completely symmetrical as a side effect of quantising the coordinates:

    <svg width="18" height="18" viewBox="-32 -32 64 64"
     style="background: #f60; border: 1px white solid;">
     <path fill="#fff" d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/>
    </svg>
This reduces the total payload from 1448 bytes to 172 bytes including whitespace (I ungolfed it slightly to make it less hacky). By comparing both the inline <img> tag, and the svg file and it's HTTP header (which disappears when you inline).

bambax · 2 years ago
Choosing a viewBox of size 64 as you have, is a much better choice than 100, because 64 is a power of 2. Symmetry is hard to achieve by hand with a path, and even harder if the origin is at the top left (0,0) instead of in the center (as you also have), because it's obvious that -3 is symmetrical to 3, and less immediately obvious that 47 is the opposite of 53 for example.

That said, if working entirely by hand, using elementary shapes can be easier to write and understand (I think); here's an attempt with using one rectangle three times for the Y (and another rectangle to mask the edges at the top):

    <svg width="18" height="18" viewBox="-32 -32 64 64" 
        style="background: #f60; border: 1px white solid;">
        <rect x="-3" y="-2"  width="6" height="24" fill="white" id="rc1"/>
        <use href="#rc1" y="-22" transform="rotate(-34) scale(1, 1.2)" id="rc2"/>
        <use href="#rc2" transform="scale(-1,1)"/>
        <rect x="-30" y="-30" width="60" height="12" fill="#f60"/>
        </svg>

miken123 · 2 years ago
But is it an optimisation to send the SVG contents in every request, instead of just letter the browser cache the image?
javifu · 2 years ago
This one is based on yours, which is quite elegant, and the total payload is only 115B:

  <svg viewBox="-32-32 64 64">
   <path fill="#f60" d="m-31-31H31V31H-31z M0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/>
  </svg>

nailer · 2 years ago
What does “ungolfed” mean?
colanderman · 2 years ago
The Y shape is visibly different to me, even at 18 px. In the new version, the "leg" is longer and the "arms" shorter and at a more obtuse angle to each other. Compare vs. the favicon: https://news.ycombinator.com/favicon.ico

Manually tracing the favicon in Inkscape (and correcting what I believe to be an unintentional asymmetry) gives me this: https://news.ycombinator.com/item?id=35894797

The vote buttons look great. I noticed-but-didn't-notice after seeing this post.

EDIT: vs. the favicon, on my screen, the new version is "bolder" as well.

entrepy123 · 2 years ago
Correct. Also, at 1x (which is what matters the most on desktop & mobile for me, I think) the bottom-most extent of the "leg" is not far enough down. There is too much orange under the leg. There should be more white at the bottom. The Y is getting crunched or fuzzed out at 1x. The Y is not prominent enough. The whole point is the Y. It used to not look floating like this. It should be crisp and clear and that trademark shape.

"A" for effort and constant improvement and all that, but iteration required, I think.

A weird observation: At first, I didn't know how the "the Y is too fuzzy" problem (that I never had) could have been solved with a visibly much fuzzier replacement (shouldn't even say fuzzier, since the original was unfuzzy for me). Then I realized, I think it might have to do with solving the "fuzzy when zoomed" problem, without sufficiently regression testing the "do not degrade the non-zoomed look" checkbox. And, maybe SVG is good for large images, but not great for tiny ones (like this "Y" at 1x). Or something like that. I never zoom HN, so the fix does nothing for me, but I do notice the regression. I hope the feedback can be integrated somehow.

gregsadetsky · 2 years ago
Thanks for the feedback! Ah and I also see you generated svg output that would be a bit shorter and more accurate.

I’ll try to collect all notes and follow up on them. Thanks for this!

rcme · 2 years ago
Does the new icon need to match the old icon exactly? Was there something special about the arm length and angle?

Deleted Comment

rapnie · 2 years ago
Nice update. Btw. UX-wise on mobile the upvote / downvote arrows are so close together that you have to pinch-zoom first to be able to select the right one with your finger. A real improvement would be to add some extra spacing between them.. somehow, without spoiling visual appearance.
Falkon1313 · 2 years ago
Sure, this question's probably pretty basic. Why draw it out with paths and all that instead of something like the following? Do SVG text elements not scale well?

    <svg>
      <text class="logo">Y</text>
    </svg>
Or even just <span class="logo">Y</span> with the style providing color and border.

And the arrows could be text too: 🞁 and 🞃.

Just curious about why even make them images, given the note that "everything else is text, and scaled perfectly!"

hughw · 2 years ago
It's common to save the outline of text elements so that they don't have to ensure a certain font is present in the browser.
clone1018 · 2 years ago
Unsure why, but the arrow examples you have there show up as unicode code blocks for me in Firefox on a Mac. Probably one of the reasons not to use them like that!
thaumasiotes · 2 years ago
> Uh... AMA? Suggestions? Thoughts?

Now that the Y is SVG rather than being an image, it shouldn't be too tricky to adjust the background color from orange to whatever the user has set for their topbar? I use blue for the topbar, and it kind of annoys me that the logo stays orange.

Heck, my instinct tells me that if we're lucky a transparent background would do the job without needing to make the SVG dynamically defined.

Edit: I see you're drawing the background color over the Y to give it flat tops. That makes the transparent background difficult. But I'd still like it if the background color was taken from the user's topcolor instead of always being orange.

bluehex · 2 years ago
I made my top bar the same as the page color, so that might make the logo basically invisible for me or others with a brighter color defined.
Tesl · 2 years ago
How are you changing it? I don't see an option anywhere...?
behnamoh · 2 years ago
Please leave some space between the upvote and downvote buttons. I often hit the wrong button with my big thumbs…
nvy · 2 years ago
There is an "unvote" clickable link/button available if you tap the timestamp, though I agree HN isn't great UX on mobile.
aembleton · 2 years ago
I seperated them by adding the following line to my uBO filters:

  news.ycombinator.com##.votearrow:style(margin-bottom:12px !important;)
I've also added the following lines to highlight comments that I've upvoted or downvoted to make it easier to see:

  news.ycombinator.com##a[id^="un"]:has-text(unvote):upward(4):style(border-left: 1ch solid green !important; padding-left: 1ch !important;)
  news.ycombinator.com##a[id^="un"]:has-text(undown):upward(4):style(border-left: 1ch dotted red !important; padding-left: 1ch !important;)

joveian · 2 years ago
Or just add the text "upvote" and "downvote" where "unvote" or "undown" currently appear after voting (and maybe move "on: ..." to a new line in the individual post view). I've found the text navigation (root|parent|prev|next) to be excellent and the text upvote and downvote would fit in well.
Affric · 2 years ago
Hey Greg,

Thanks for dropping in. It looks… unsettling! Like any UI change.

I am sure we will look back on the old page as it appeared someday and wonder how anyone tolerated such a thing.

My question is: how long was it bothering you before you emailed dang? How did you put it forward? Was it essentially an email version of a bug report?

gregsadetsky · 2 years ago
As long as I’ve been surfing on a high resolution mobile device I think..! It might have been a few years ago.

I wrote an email which felt like throwing a bottle to the sea - this is/was a very non urgent issue. I described what was going on, included screenshots, and I did a prototype of an svg version which I also included.

As an active-ish member of this community, it felt nice to try to make it 0.000001% better ha :)

tasuki · 2 years ago
I hated the pixelated up/down buttons. Thank you for the vectors!
autoexec · 2 years ago
I noticed this when the logo was missing (I have SVG disabled in the browser for security reasons). upvote/downvote buttons are totally invisible to me now as well and unlike the logo in the corner they don't show up as broken, just missing (although they can still be clicked on)

I don't expect many people will have these issues, I know I'm running in a very locked down environment that most people wouldn't want to put up with, and it shouldn't be very hard for me to fix this with a little custom css, I just thought I'd give the feedback since I was impacted and I do try to encourage sites to fail gracefully.

dredmorbius · 2 years ago
Nice, and thanks.

I'll say as someone who began on HN feeling contrarian and somewhat underepresented in viewpoint that dang is exceptionally responsive to all manner of suggestions. Not all have been implemented, though a few I've suggested have been picked up. Collapsable comments being one that comes to mind.

Hacking on HN itself can be fun. (I've got a few CSS tweaks linked from my profile page, so far no take-up, though I much prefer how the site looks using them.) That includes a dark mode, which though I don't usually use it, testing just now ... it's not bad if I may say so myself.

Your SVG tweak reminds me that it's possible to do such things in CSS (inline data attributes) as well.

javifu · 2 years ago
A bolder reinterpretation of your "Y" adding rotational symmetry.

  <svg viewBox="0 0 64 64">
   <path d="m1 1v62h62v-62z" fill="#f60" stroke="#fff" stroke-width="1"/>
   <path id="|" d="m32 28v28" stroke="#fff" stroke-width="8"/>
   <use transform="rotate(120 32 28)" xlink:href="#|"/>
   <use transform="rotate(240 32 28)" xlink:href="#|"/>
  </svg>

layer8 · 2 years ago
The downvote button always renders slightly larger for me than the upvote button. I suppose that's not intentional? 8)
ehPReth · 2 years ago
Hmm, it's the same svg (https://news.ycombinator.com/triangle.svg) with the same votearrow CSS class on it; the down one just has an additional rotate180 class on it:

    .rotate180 {
      -webkit-transform: rotate(180deg);  /* Chrome and other webkit browsers */
      -moz-transform:    rotate(180deg);  /* FF */
      -o-transform:      rotate(180deg);  /* Opera */
      -ms-transform:     rotate(180deg);  /* IE9 */
      transform:         rotate(180deg);  /* W3C complaint browsers */
    
      /* IE8 and below */
      -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=-1, M12=0, M21=0, M22=-1, DX=0, DY=0, SizingMethod='auto expand')";
    }

on smaller screens (@media only screen and (min-width : 300px) and (max-width : 750px)) you additionally get:

    .votearrow { transform: scale(1.3,1.3); margin-right: 6px; }
    .votearrow.rotate180 {
          -webkit-transform: rotate(180deg) scale(1.3,1.3);  /* Chrome and other webkit browsers */
          -moz-transform:    rotate(180deg) scale(1.3,1.3);  /* FF */
          -o-transform:      rotate(180deg) scale(1.3,1.3);  /* Opera */
          -ms-transform:     rotate(180deg) scale(1.3,1.3);  /* IE9 */
          transform:         rotate(180deg) scale(1.3,1.3);  /* W3C complaint browsers */
    }
same scale, though

somedude895 · 2 years ago
> I built two micro tools to help nail it down if anyone is curious (aka make it visually seamless)

Huh I would have thought they'd have some sort of document somewhere that gives clear dimensions and angles of the logo. Did someone just draw that freehand in Photoshop, saved it to png and then that was that?

H8crilA · 2 years ago
I mean, when you first build something like this and you have no idea whether it will die in 6 months or live the next 20 years, do you really want to bother with the logo's format?
starmftronajoll · 2 years ago
They look great to me. Thanks for sprucing them up
gardenhedge · 2 years ago
Do you know Dang irl? Most suggestions for HN get ignored. This isn't a criticism, just an observation.
gregsadetsky · 2 years ago
I don’t. I cold emailed him and absolutely didn’t expect a reply. This was also many many months ago.
altairprime · 2 years ago
Is it intentionally a very bright orange to stand out from the background?
layer8 · 2 years ago
Might be inconsistent color space handling on your browser.
joshxyz · 2 years ago
finally, new and improved upvote buttons for people with fat fingers like me

thank u

Dead Comment

dack · 2 years ago
I find it funny that everyone is bikeshedding the symmetry of the "arms" and the length of the "leg" on the logo in an attempt to be pixel-perfect with the original low-res image.

While it's fine and funny to be doing so - I can't help but realize how little any of this matters. Imagine an alternate reality where the icon was changed for SVG and not announced. There might be 2 people max that complain about it for a day, and then it would blow over and be the new normal.

Also imagine if a whole stylistic remake of the website was done - I doubt anyone would notice if the icon was ever so slightly different.

Reminds me of memes about how a 10 line PR gets 10 comments, but a 1,000 line PR gets an "LGTM"

Dead Comment

phoe-krk · 2 years ago
Here it is, in its full glory!

    <?xml version="1.0" encoding="utf-8"?>
    <svg viewBox="0 0 100 100" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
      <rect x="0" y="0" width="100" height="100" fill="rgb(255, 102, 0)"></rect>
      <path d="M 50 77 L 50 50 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt">
      </path>
      <path d="M 94.93056731583404 35.622745513916016 L 71.2454833984375 71.2454833984375 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt" transform="matrix(1 0 0 1 -21.2455 -21.2455)">
      </path>
      <path d="M -78.93056731583404 36.17028045654297 L -55.67118835449219 71.79300689697266 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt" transform="matrix(1 0 0 1 105.396 -21.7213)">
      </path>
      <rect transform="" width="100" height="23.742591024555463" stroke-width="1" stroke="none" fill="#FF6600" stroke-opacity="1" fill-opacity="1" stroke-linecap="butt" stroke-linejoin="miter" >
      </rect>
    </svg>

jjcm · 2 years ago
Interesting, I never realized the Y wasn't symmetrical. The left branch is slightly lower and to the left of the right branch in the Y. This also creates a gap in the center of it at high resolutions: https://i.imgur.com/vwPnz2j.png

If this wasn't intentional, here's a symmetrical version:

    <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
        <rect width="100" height="100" fill="#FF6600"/>
        <path fill-rule="evenodd" clip-rule="evenodd" d="M62.1762 23.7426H72.6857L54.3948 51.6515V76.9391H45.6048V51.6554L27.3143 23.7426H37.8233L49.9988 42.3233L62.1762 23.7426Z" fill="white"/>
    </svg>

TimTheTinker · 2 years ago
Perhaps the asymmetry is there to subtly evoke a dip and recovery of a company's stock price. The subtext could be "we build resilient companies".
throwaway290 · 2 years ago
Fun fact: "Y" in your comment is not symmetrical either. Letter shapes are usually not symmetrical, Y/X/etc. even in gothic sans typefaces add asymmetries that make text easier to read.
Quindecillion · 2 years ago
Imperfections in vector images make me twitch
5- · 2 years ago
that's a lot of svg! svgo suggests the following without any manual tinkering:

  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="#F60" d="M0 0h100v100H0z"/><path fill="none" stroke="#FFF" stroke-width="8.79" d="M50 77V50m23.69-35.62L50 50M26.47 14.45l23.25 35.62"/><path fill="#F60" d="M0 0h100v23.74H0z"/></svg>

tomxor · 2 years ago
I see your 258 byte svgo version and raise it my 171 byte hand optimized version:

    <svg viewBox="-32 -32 64 64" xmlns="http://www.w3.org/2000/svg"><path fill="#f60" d="M-32-32h64v64h-64z"/><path fill="#fff" d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>

willis936 · 2 years ago
Transport compression should get it most of the way there, no? I think having human readable vector graphics is nice.
layer8 · 2 years ago
Why use such un-round numbers though?
goodrubyist · 2 years ago
so many butts!
perihelions · 2 years ago
For the benefit of people who don't follow such things attentively: /y18.svg has been /y18.gif for — at least 16 years, as a lower bound [0]. Some have filed bug reports [1] about it. The old one was rasterized and slightly fuzzy when zoomed.

[0] https://hn.algolia.com/?query=y18.gif&type=all

[1] https://news.ycombinator.com/item?id=21544141 ("Can whoever is in charge of HN's site design convert this to an SVG image?" 'octosphere, 3 years ago)

nmstoker · 2 years ago
Excellent.

Now if the mobile view could space items out a touch more so I don't periodically fat thumb the tiny flag/hide article links it would be perfect!

ericpauley · 2 years ago
The accidental Hide is the worst because you can’t just undo… it’s gone (unless you go to the Hidden page)!
Waterluvian · 2 years ago
My weekly accidental “flag” scares me the most. What if I don’t notice it?!
ISL · 2 years ago
A long-press for flagging/hiding would be great (or even a confirmation-screen).
bigmattystyles · 2 years ago
Or accidentally logging out when you wanted to click on your profile to see if your comments had any responses / votes.
sokoloff · 2 years ago
Why not click on "threads" in the top bar?
selcuka · 2 years ago
Shameless plug: You can improve the mobile view a bit using this userscript (works on Firefox Mobile + Tampermonkey):

https://gist.github.com/selcuk/00948de9717b25d0d5e824c3e80da...

ta8903 · 2 years ago
Going to take a while getting used to, but thanks.
vermilingua · 2 years ago
I thought I was the only one
aembleton · 2 years ago
If you are running Firefox then you can add the following uBO rules to help: https://news.ycombinator.com/item?id=35899184
eastof · 2 years ago
Commenting from Materialistic on Android, it's a great app ime.
ukuina · 2 years ago
I use Octal on iOS. Highly recommended.
cratermoon · 2 years ago
HN on mobile is a usability nightmare.
brettermeier · 2 years ago
I would make the fold-a-post-button a bit bigger and with more space to the left. The rest seems clickable to me.
colanderman · 2 years ago
The proportions have changed. Compare e.g.: https://news.ycombinator.com/favicon.ico

EDIT: since we're code golfing/bikeshedding, here's my own attempt, which matches the original proportions [1].

    <?xml version="1.0"?>
    <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 192 192">
      <rect x="4" y="4" width="188" height="188" fill="#f60" stroke="#fff" stroke-width="8"/>
      <path d="m 57,47 h 15 l 24,50 24,-50 h 15 L 102,109 v 40 H 90 v -40 z" fill="#fff"/>
    </svg>
[1] Actually, the original is slightly asymmetric -- the right leg is slightly narrower. I've "corrected" this, making the right leg mirror the left.

skeoh · 2 years ago
Golfing SVG happens to be one of my passions. Your path definition can be further reduced to

    m57 47h15l24 50 24-50h15l-33 62v40h-12v-40z

asdfman123 · 2 years ago
Wow, let's not get carried away with crazy new technologies and radical redesigns.
inferiorhuman · 2 years ago
Oh that ship already sailed. Click on the "parent" link. Notice that it breaks your browser history now because instead of being a link to an element in the document it runs some javascript to scroll the page… commence teeth gnashing.
loh · 2 years ago
This is why, on almost every website I visit where I know I'll be opening multiple links (which would normally require hitting the back button to view them all), I just open every link in a new tab and then close the tab when finished.

I suspect many people use HN (and similar) this way.

It's always a fun time when I occasionally use the browser/website "as intended" and hit the back button, but the scroll position has been completely lost so it takes a bit to find the exact place I was looking originally.

whalesalad · 2 years ago
Now we just need the little up and down arrows to go SVG and HN can look crisp at any resolution.
kmstout · 2 years ago
Why work so hard?

  ▲  U+25B2  BLACK UP-POINTING TRIANGLE
  ▼  U+25BC  BLACK DOWN-POINTING TRIANGLE
[0] https://en.wikipedia.org/wiki/Geometric_Shapes_(Unicode_bloc...

Wowfunhappy · 2 years ago
I feel like this unicode approach may be a better fit for how the rest of Hacker News is constructed (e.g. the use of the pipe character).
inferiorhuman · 2 years ago
At least for me those are different sizes.
Tronno · 2 years ago
Well, have I got some news for you!

https://news.ycombinator.com/triangle.svg

crazygringo · 2 years ago
...and it's already implemented! I thought this day would never come.
cantSpellSober · 2 years ago
If it's just a background-image, why not just build the triangle in CSS? Saves a network request (and a whopping 525 bytes)
Glyptodon · 2 years ago
I just want them bigger on mobile.

Deleted Comment