A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ccamel/playground-binding.scala below:

ccamel/playground-binding.scala: My playground for playing with scala, scalajs and binding.scala

My playground I use for playing with fancy and exciting technologies. This one's for scala, scalajs and binding.scala.

The purpose of this playground is to explore, study and assess in the first place the binding.scala library, and secondly scalajs.

The showcases are intended to:

You can view and play the showcases here:

View !

All the showcases come in a SPA (100% clientside application).

The binding.scala route library is used to enable the navigation and maintain the link between URLs and pages to display.

Calc is a very simple and basic calculator.

Links:
Play | View Scalafiddle

The model is an immutable case class which holds the state of the calculator. The behaviour is implemented by this model as a partial function which accepts tokens (digit, operators).

The gui maintains the whole model in a single bindable variable, and every graphical element of the calculator (buttons, display) needing to be updated upon model change (reactive dom) is bound to that variable.

The idea under this showcase is to build a virtual matrix of cells, each cell having a color and is independently addressable.

Links:
Play | View Scalafiddle

The view consists in binding each cell to a dom element (actually a span or an SVG rect) in order to render the surface. As the matrix can have a significant number of cells (~2000), it allows to appreciate the performance of the binding.scala library to handle the situation.

Beside this, some (simple) demos have been implemented that play with the virtual screen. Each demo displays a form which allows to set some parameters whose values are taken in real time.

Simple loan calculator which determines the monthly payments on a loan.

Links:
Play | View Scalafiddle

Example of a simple tree view implementation with dynamic loading of elements.

Links:
Play | View Scalafiddle

The model is a simple recursive structure built with Vars (mutable and observable sequence of elements).

The view is bound to the model and react by displaying parts of the tree that have changed.

The Drag-me showcase is quite similar to elm drag but with more features.

It allows the user to select, move and resize a simple rectangle form.

Links:
Play | View Scalafiddle

The model is a simple structure holding both the basic geometric properties of the form (position and size) and the current edition mode (none, moving, resizing).

The view is bound to that model and react to reflect the change (selection, coordinates change, width/height change, etc.).

The virtual-list showcase is quite similar to virtual rendering 1000000 items.

The idea is to use a list that represents a subset of a larger set of data. That list is automatically updated on events (mouse move, drag, key up/down...), and the dom elements bound to the list items are refreshed accordingly.

Links:
Play | View Scalafiddle

The SVG-editor showcase is an improvement of the Drag-me showcase using full SVG shapes for drawing.

It allows the user to select, move and resize a simple rectangle form (more to come).

Links:
Play |

The build can be launched with:

Then, open ./dist/index.html file in your browser.

MIT © Chris Camel


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4