TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Slalom – creating declarative touch interactions with constraints

96 pointsby i_am_ralphtover 10 years ago

7 comments

thomasfoster96over 10 years ago
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 未加载
panicover 10 years ago
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 未加载
kabesover 10 years ago
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!
forrestthewoodsover 10 years ago
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-appover 10 years ago
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 :)
jamieomatthewsover 10 years ago
These are awesome. Would be cool to see more docs on the constraints themselves, if possible
评论 #8882886 未加载
thoughtpaletteover 10 years ago
Those are some amazing examples. Super impressive.
评论 #8882830 未加载