TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Slalom – creating declarative touch interactions with constraints

96 点作者 i_am_ralpht超过 10 年前

7 条评论

thomasfoster96超过 10 年前
These are really awesome - a very big well done to the author.<p>Only this morning I was thinking of how to implement a few of these types of interactions for a web app I&#x27;m developing - I actually might adapt some of the source code for my uses (assuming that&#x27;s allowed under the License?).<p>If you&#x27;re still working on a syntax for this, maybe you&#x27;ll want to have a look at uilang or uiscript (both on Github) or Grid Style Sheets (<a href="http://gridstylesheets.org/" rel="nofollow">http:&#x2F;&#x2F;gridstylesheets.org&#x2F;</a>).
评论 #8887812 未加载
panic超过 10 年前
Neat! I love how the demos are inline with the exposition and code, and it&#x27;s striking how little code is necessary to make things go.<p>That said, this paragraph struck me as a great illustration of why I tend to prefer procedural layout systems to declarative ones, at least in production code:<p><i>Also note that there&#x27;s slip! If you drag from the middle of the box, you&#x27;ll see that the part of the image you grabbed slips out from under your finger. That&#x27;s because the manipulator is just operating on the box&#x27;s y coordinate. If we wanted to avoid slip then we&#x27;d have to create a new variable when the finger goes down, relate it to y (that is, fingery = box.y - 123 times scale, based on the current scale and finger start position) and then manipulate fingery instead of box.y. This isn&#x27;t very hard, but the current manipulator code doesn&#x27;t support it.</i><p>There will always be some situation the layout system&#x27;s designer didn&#x27;t predict. With procedural layout, you can write the procedure yourself. With declarative or constraint-based layout, you&#x27;re stuck, since there&#x27;s no way to express your special case in the limited language provided. Declarative systems are great for demos or rough prototypes, but when you want full control, there&#x27;s no substitute for the power of procedural code, IMO.
评论 #8883851 未加载
kabes超过 10 年前
This is one of the most awesome things for web-based GUIs ever. Performance seems to be decent on my mid-range to high-end mobile devices. Great work!
forrestthewoods超过 10 年前
This post is super cool and deserves more love. Physics constraints are super flexible. I&#x27;ve thought about using them for some pathfinding type work but have never tried. This is an even more far removed use. Very clever! I love it.
ux-app超过 10 年前
Awesome! This is incredibly cool. Thank you for putting it together. I cant wait to take a closer look at the code!<p>I&#x27;ve been meaning to get my head around cassowary for a while now. I think your project is the motivation I need to get to it :)
jamieomatthews超过 10 年前
These are awesome. Would be cool to see more docs on the constraints themselves, if possible
评论 #8882886 未加载
thoughtpalette超过 10 年前
Those are some amazing examples. Super impressive.
评论 #8882830 未加载