The #1 Way to Spice Up Your Designs (And Create a More Cohesive Brand)
在 UI 设计中如何更好的使用 motifs (小的视觉元素),既不喧宾夺主,又能体现 UI 设计的 consistency 一致性。在 foundationmedicine.com 网站看到它们将 hexagon 作为它们 UI 设计的 motif,这分别体现在:
- Logo
- 空白处的填充,space filling;
- 字体,GT Sectra,本身就具有六边形结构;
- 分割线;
- 诸如 qutation marks 这些小的 文字元素
同样的视觉设计,分析也可用在 The Intercept ,它们选取 command line 的下划线光标作为它们的 motif,在 Logo,字体,分割线等都有体现。同样在 CSS Tricks,则是把「橙黄渐变」作为一种 motif。
Level up your .sort game
关于 JavaScript 中 .sort()
方法的使用。其中提到的几点关键:
- While many of the ES5 array methods such as
.filter
,.map
, and.reduce
will return a new array and leave the original untouched,.sort
will sort the array in place. - 要想不让 original variable 发生改变,使用
...
; - Running functions before comparing values,这里存在一个小的 design pattern;
- 如何添加 tierbeaker,也就是当出现同样值是有没有第二比较规则,这里用到的
reduce
方法。 - 如何写一个随机排序;