by gregsadetsky · 3y ago · 0 comments
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!
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).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><svg width="18" height="18" viewBox="-32 -32 64 64" style="background:#f60;border:1px #fff solid;"><rect x="-3" y="-2" width="6" height="24" fill="#fff" 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>
Is it really worth it? Is it?!?!
But the other side of this is cache latency, this depends on the caching policy defined in the http header, for example some modes require validating caches with the server which incurs a round trip even if it doesn't require always reloading the resource. If it's fully offline caching then as a sibling comment pointed out, disk caching is not free either, under some threshold (which definitely applies here) inline is going to be the fastest way to get an svg rendering.
<svg viewBox="-32-32 64 64">
<path fill="#f60" d="m-31-31H31V31H-31z M0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/>
</svg> <path fill="white" d="M-32-32 h64 v64 h-64 z"/>
Spaces can be deleted of course."Ungolfed" in this context means that it was cleaned up to make it more readable, at the expense of adding a few more bytes to the size.
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.
"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.
I’ll try to collect all notes and follow up on them. Thanks for this!
The top of the "Y", at least optically, doesn't seem to extend as far in the PNG, and the intersection of the top legs seems to start higher in the SVG - it looks much higher in the 1x, IMO. I'm sure part of this is just the challenge/inherent mismatch of using a vector to "match" a lossy-compressed raster depiction of text.
That said I did this for fun and I don't imagine it will ever bother me - the sharpness is nice! Thank you!
<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!"
It all appears to be Verdana, which has near 100% support across Windows and Mac.
https://www.cssfontstack.com/Verdana
I think the parent's solution (given the simple nature of the logo), is the best way to go.
Parent comment used much newer characters 🞁 and 🞃, BLACK {UP/DOWN}-POINTING ISOSCELES RIGHT TRIANGLE (U+1F781, U+1F783). These were added in Unicode 7, June 2014, where the others have been around for thirty years. I’m mildly surprised at lack of font support on macOS. For me they’re being rendered with Noto Sans Math, and completely wrong: they’re not being drawn as right-angled triangles at all (the angle is about 53° rather than 90°)! I’m guessing the commenter also had a bad font on them, because as a right angle it’d look all wrong for this purpose. (I’ve filed a bug report at https://github.com/notofonts/math/issues/47. Curiously, Noto Sans Symbols 2 also includes the character and gets its shape right, but Noto Sans Math is higher in the font fallback list (`fc-match sans-serif --all`: 881 lines, NotoSansMath-Regular.ttf is 52nd and NotoSansSymbols2-Regular.ttf is 89th.)
There are also ⯅ and ⯆, BLACK {UP/DOWN}-POINTING TRIANGLE CENTRED (U+2BC5, U+2BC6). And more, but of roughly-these-sized ones, these are the ones.
There are lots of triangles in Unicode.
There are lots of triangles and also arrows, so commonness of font support would definitely be something to be careful of.
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.
You should see a field labeled `topcolor`. You can set the color of the topbar through that.
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;)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?
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 :)
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.
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.
<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> .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, thoughHuh 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?
thank u