Pusa 2.0

server-driven declarative UI engine

Examples

The section contains various examples of interactive usage of Pusa. All examples do not use specific JS code, only the framework library pusa.js.

The backend code of the examples is located in the file pusa_pages.

/* no custom js */

#1 Content Modification

This example demonstrates the ability to request and dynamically change content.

#2 Clipboard

Select any text on the page, click copy and paste. The marked text will be copied to the clipboard, sent to the backend, and after processing placed into the textarea.

#3 Cursor Coordinates

Move the cursor over the field. The backend handles the mousemove event and outputs the coordinates.

500 ms

#4 Forms

Fill out the form and submit it for processing. The backend will perform the operation and add the form to the table. In this example, the backend does not save the data

#5 Focus

Shown are ways to position the focus on elements for subsequent operations.

#6 Input vlidation

Demonstration of input validation.

#7 Scroll

Shows the ability to position an element on the page. Clicking will scroll the page to the uuid element.

#8 Load on scroll

Demonstration of dynamic content loading on scroll. Images are provided by the resource. https://picsum.photos

#9 Timer

The example allows you to start and stop the timer. Each timer call performs the next iteration with the backend, changing the state of the visual glitch generator.

Pusa Catlair 2009-2025 still@itserv.ru wiki.ru opennet.net