Hacker News new | ask | show | jobs
TargetJ: New JavaScript framework that can animate anything (targetj.io)
2 points by ahmadwasfi 711 days ago
1 comments

I am excited to introduce TargetJ, a new JavaScript framework that can animate anything. I hope you find it useful for creating amazing web experiences. If you have any questions about the framework or want to share your thoughts, please leave a comment below. I’m eager to hear from you!

# The problem

Animating an object in JavaScript is quite challenging, and orchestrating intricate animations among multiple objects is even more complex. Additionally, existing frameworks address it by introducing extra complexity. Furthermore, there is no one single coherent software solution that addresses animation, controls program flow, handles events, and loads data from external APIs, etc.

# The solution

TargetJ simplifies development and animation by employing one concept across all aspects of the program. It is used in animation, controlling program flow, integrating APIs, and so on. This unified approach means that it is easy to learn and can solve complicated problems.

The novel concept that forms its core is called 'targets', Targets are used as the main building blocks of components instead of direct variables and methods. Each component in TargetJ is a set of targets.

# Brief overview of how it operates

Each target in TargetJ essentially has two variables: target and actual. The target can be a static value or a method, while the actual value is always represented as a value. When the target value does not equal the actual value, TargetJ will update the actual value iteratively until it matches the target value. This iteration is determined by two additional variables: steps and step interval. Steps dictate the number of iterations, and the step interval specifies the duration in milliseconds that the system waits before executing the next iteration.

To animate a variable, create a target after its name. There are default target names you can use to animate and impact the UI, such as x, y, width, height, opacity, scale, rotate, zIndex, html, style, css, scrollLeft, and scrollTop. You can also dynamically change how HTML elements are nested using the domHolder or domParent targets. Additionally, there are other target names for dynamic control, such as canHandleEvents to specify which events are handled and canHaveDom to determine if the object requires a DOM element.

A target has a simple life cycle by default: it is executed only once when enabled. The optional enabling method creates dependencies between targets and ensures they execute at precisely the right moment.

# Other features

As a result of using targets, we can develop web sites or apps that require minimal HTML, and CSS, eliminate the need for static HTML nesting, and control the execution flow based on timing, among other benefits.

Explore the full potential of TargetJ and dive into our interactive documentation at www.targetj.io.

If you want to make use of it, HN has a section for things you've made you want to show others and get feedback, 'Show HN', you just prefix your title with 'Show HN:', i.e. 'Show HN: [rest of your title].

More detailed explanation at https://news.ycombinator.com/showhn.html and https://news.ycombinator.com/item?id=22336638

You're probably better off posting the github repo link and including the links to the site/docs in your blurb/comment.

Thank you for the suggestion - definitely appreciated. I'll definitely look into it. I also appreciate the guidance and the links. I'll check them out before posting again. Thanks again!