Show HN: A travel tool to discover destinations based on your budget
Interesting. You certainly have a flair for design. I have some qualms about your execution though.<p>First things first, you have two versions of jQuery in your source code:<p><pre><code>    https:&#x2F;&#x2F;ajax.googleapis.com&#x2F;ajax&#x2F;libs&#x2F;jquery&#x2F;2.2.0&#x2F;jquery.min.js
    https:&#x2F;&#x2F;code.jquery.com&#x2F;jquery-latest.min.js
</code></pre>
Why?<p>--------<p>You&#x27;re using Javascript to alter text colors of your labels when the form input&#x2F;select element is hovered, but you&#x27;re using CSS :hover&#x2F;:focus&#x2F;:active states to govern background colors of the form fields.<p>So this means that I can hover one of the select elements, turning its label&#x27;s text red and its background white; then focus that select element when using it, and then move the mouse cursor away -- the label text remains white, and thus invisible until I focus on something else.<p>Here is a screenshot of what I am trying to describe:
<a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;uXqRpDE.png" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;uXqRpDE.png</a><p>It&#x27;s a complete waste of Javascript&#x27;s time to do such trivial things; the timing will be out of sync compared to the heavily optimised CSS transition; and it&#x27;s just bad coding to have two identical and connected tasks divided such that one is governed by the CSS and the other by jQuery soup. Good luck maintaining that.<p>Just use CSS to govern the hover states of the labels as well. It should be trivial to set up a transition as you did for the select element.<p>--------<p>I&#x27;ve been using the word &#x27;label&#x27;, but that&#x27;s not the element you&#x27;ve used, but rather the element you <i>should</i> be using instead of a <i>div</i> and <i>p</i>.<p><pre><code>    &lt;!-- BAD --&gt;
    &lt;div class=&quot;duration&quot;&gt;
      &lt;p&gt;HOLIDAY DURATION&lt;&#x2F;p&gt;
    &lt;&#x2F;div&gt;

    &lt;!-- GOOD --&gt;
    &lt;label class=&quot;duration&quot; for=&quot;dagen&quot;&gt;
      &lt;span&gt;HOLIDAY DURATION&lt;&#x2F;span&gt;
    &lt;&#x2F;label&gt;
</code></pre>
HTML5 has been designed for the provision of semantic meaning, it makes both your code clearer to you later down the line and also makes the site&#x2F;app more accessible.<p>--------<p>I concur with this comment by <i>nailer</i> a lot: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;reply?id=13461341&amp;goto=item?id=13458561#13461341" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;reply?id=13461341&amp;goto=item?i...</a><p>--------<p>Also, your Google Analytics tracking code is the first thing in the document. That&#x27;s not a great idea -- unless you think a page view should be registered even before the page has been, well, viewed. Most choose to stick the tracking code at the end of the body element, or as the last element of the head element, depending on how honestly they want to report on pageviews. Either way, the first thing that should be read by a browser is a charset declaration (utf-8).<p>--------<p>Also, in your CSS you have a bit that looks like this:<p><pre><code>    * {
      overflow: none;
    }
</code></pre>
There is no such thing, that&#x27;s just a CSS parser error. You can say <i>overflow: hidden</i>, but I&#x27;d be cautious about doing that. Generally speaking, if you have understood the CSS box model correctly, you should not need to govern the overflow of all of your elements like that. If yours is an edge case, where it&#x27;s necessary to have some overflow, you might want to consider setting <i>overflow-x: hidden; overflow-y: auto</i> on html&#x2F;body elements instead.<p>--------<p>Also, no offence, but that jQuery code is looking pretty smelly. I know you&#x27;re beginners, and you&#x27;ve accomplished something very cool here, you should be proud, but I can&#x27;t help but feel as though you&#x27;ve picked an approach to web development that you&#x27;ll want to <i>unlearn</i> if you are serious about web development.<p>I&#x27;m not talking about using React when I say that -- I tend to work without a framework of any kind, unless I&#x27;m working with a team. I&#x27;m talking about learning about function composition, and learning about functional programming techniques in general. It will cut your code down to size and make it much easier to navigate and debug.<p>React just so happens to force a functional approach to webdev, and it&#x27;s very trendy at the moment, so it might be worth your investing time to study it. Otherwise, Marijn Haverbeke&#x27;s book &#x27;Eloquent JavaScript&#x27; (eloquentjavascript.net) is a good thing to start off with. It doesn&#x27;t cover jQuery, and I think that&#x27;s why I always recommend it to anyone wishing to develop for the front-end: the last thing you should learn is jQuery, and then by the time you do come to learn it, you won&#x27;t need it.<p>--------<p>Also, 4 web fonts, 9+ weights? Yikes, bye bye 2G&#x2F;3G users. Still, if you must destroy people on slower connections, at least combine these as was intended:<p><pre><code>    &lt;!-- BAD --&gt;
    &lt;link href=&quot;https:&#x2F;&#x2F;fonts.googleapis.com&#x2F;css?family=Heebo:100,300,400&quot; rel=&quot;stylesheet&quot; type=&quot;text&#x2F;css&quot;&gt;
    &lt;link href=&quot;https:&#x2F;&#x2F;fonts.googleapis.com&#x2F;css?family=Karla&quot; rel=&quot;stylesheet&quot; type=&quot;text&#x2F;css&quot;&gt;
    &lt;link href=&quot;https:&#x2F;&#x2F;fonts.googleapis.com&#x2F;css?family=Quicksand:300,400,700&quot; rel=&quot;stylesheet&quot; type=&quot;text&#x2F;css&quot;&gt;
    &lt;link href=&quot;https:&#x2F;&#x2F;fonts.googleapis.com&#x2F;css?family=Open+Sans:300,600&quot; rel=&quot;stylesheet&quot; type=&quot;text&#x2F;css&quot;&gt;


    &lt;!-- GOOD --&gt;
    &lt;link href=&quot;https:&#x2F;&#x2F;fonts.googleapis.com&#x2F;css?family=Heebo:100,300,400|Open+Sans:300,600|Quicksand:300,400,700|Karla&quot; rel=&quot;stylesheet&quot;&gt;
</code></pre>
That will cut your HTTP requests down a bit, and make for less ugly code. Consider bundling each of your CSS source files together, unless you&#x27;re counting on HTTP&#x2F;2 to save the day.