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.

A Declarative Clock in Eve

5 pointsby dahjellealmost 9 years ago

2 comments

zubairqalmost 9 years ago
I tried the example: draw a clock hand &#x2F;&#x2F; Select all the clock hands hand = [#clock-hand angle length] &#x2F;&#x2F; Eve will maintain the following objects maintain &#x2F;&#x2F; Calculate x1, y2, x2, y2 for each hand hand := [#line, x1: 50, y1: 50,<p><pre><code> &#x2F;&#x2F; using angle and length x2: 50 + (length * sin(angle)), y2: 50 - (length * cos(angle))]</code></pre> draw a clock &#x2F;&#x2F; Select the current time [#time hours minutes seconds] &#x2F;&#x2F; Update the SVG as the time changes maintain &#x2F;&#x2F; Add an SVG element to the root of the DOM [#svg viewBox: &quot;0 0 100 100&quot;, width: &quot;300px&quot;, children:<p><pre><code> &#x2F;&#x2F; Add a clock face at (50,50) with radius 45. [#circle cx: 50, cy: 50, r: 45, fill: &quot;#0B79CE&quot;] &#x2F;&#x2F; Add the hours hand [#clock-hand angle: 30 * hours, length: 30, stroke: &quot;#023963&quot;] &#x2F;&#x2F; Add the minutes hand [#clock-hand angle: 6 * minutes, length: 40, stroke: &quot;#023963&quot;] &#x2F;&#x2F; Add the seconds hand [#clock-hand angle: 6 * seconds, length: 40, stroke: &quot;#ce0b46&quot;]] </code></pre> But I get the error:<p>Invalid function argument (passed string) Only expressions can be arguments to functions<p>14| x2: 50 + (length * sin(angle)),
zubairqalmost 9 years ago
Ok, so I just went through the examples and RFC... Eve is ###%%%!! amazing is all I can say!!! :)