1 | # <a href="https://tripetto.com/"><img src="https://unpkg.com/tripetto/assets/banner.svg" alt="Tripetto"></a>
|
2 |
|
3 | Tripetto is a full-fledged form kit. Rapidly build and run smart flowing forms and surveys. Drop the kit in your codebase and use all of it or just the parts you need. The visual [**builder**](https://www.npmjs.com/package/tripetto) is for form building, and the [**runners**](https://www.npmjs.com/package/tripetto-runner-foundation) are for running those forms in different UI variants. It is entirely extendible and customizable. Anyone can build their own building [**blocks**](https://docs.tripetto.com/guide/blocks) (e.g., question types) or runner UI's.
|
4 |
|
5 | # Autoscroll runner
|
6 | [![Version](https://img.shields.io/npm/v/tripetto-runner-autoscroll.svg)](https://www.npmjs.com/package/tripetto-runner-autoscroll)
|
7 | [![License](https://img.shields.io/npm/l/tripetto-runner-autoscroll.svg)](https://opensource.org/licenses/MIT)
|
8 | [![Downloads](https://img.shields.io/npm/dt/tripetto-runner-autoscroll.svg)](https://www.npmjs.com/package/tripetto-runner-autoscroll)
|
9 | [![Pipeline status](https://gitlab.com/tripetto/runners/autoscroll/badges/master/pipeline.svg)](https://gitlab.com/tripetto/runners/autoscroll/commits/master)
|
10 | [![Follow us on Twitter](https://img.shields.io/twitter/follow/tripetto.svg?style=social&label=Follow)](https://twitter.com/tripetto)
|
11 |
|
12 | # Purpose
|
13 | This package is a UI for running Tripetto forms and surveys that uses a scroll effect (either vertical or horizontal) to display the questions and elements (so called blocks).
|
14 |
|
15 | [![Try the demo](https://unpkg.com/tripetto/assets/button-demo.svg)](https://tripetto.gitlab.io/runners/autoscroll/)
|
16 |
|
17 | # Get started
|
18 | There are multiple options how you can use this runner. From plain old HTML to [React](https://reactjs.org/) or using imports.
|
19 |
|
20 | ## Option A: Embed in HTML using CDN
|
21 | You need to import the [runner foundation](https://www.npmjs.com/package/tripetto-runner-foundation) script and the autoscroll runner script:
|
22 | ```html
|
23 | <script src="https://unpkg.com/tripetto-runner-foundation"></script>
|
24 | <script src="https://unpkg.com/tripetto-runner-autoscroll"></script>
|
25 | <script>
|
26 | TripettoAutoscroll.run({
|
27 | definition: /** Supply a form definition here. */,
|
28 | onSubmit: function(instance) {
|
29 | // Implement your response handler here.
|
30 |
|
31 | // For this example we output all exportable fields to the browser console
|
32 | console.dir(TripettoRunner.Export.exportables(instance));
|
33 |
|
34 | // Or output the data in CSV-format
|
35 | console.dir(TripettoRunner.Export.CSV(instance));
|
36 | }
|
37 | });
|
38 | </script>
|
39 | ```
|
40 |
|
41 | [![Try demo on CodePen](https://unpkg.com/tripetto/assets/button-codepen.svg)](https://codepen.io/tripetto/pen/KEYrVm)
|
42 |
|
43 | ## Option B: Using React
|
44 | 1. Install the required packages from npm:
|
45 | ```bash
|
46 | $ npm install tripetto-runner-foundation tripetto-runner-autoscroll react react-dom
|
47 | ```
|
48 | 2. Use the React component:
|
49 | ```typescript
|
50 | import ReactDOM from "react-dom";
|
51 | import { AutoscrollRunner } from "tripetto-runner-autoscroll";
|
52 | import { Export } from "tripetto-runner-foundation";
|
53 |
|
54 | ReactDOM.render(
|
55 | <AutoscrollRunner
|
56 | definition={/** Supply a form definition here. */}
|
57 | onSubmit={instance => {
|
58 | // Implement your response handler here.
|
59 |
|
60 | // For this example we output all exportable fields to the browser console
|
61 | console.dir(Export.exportables(instance));
|
62 |
|
63 | // Or output the data in CSV-format
|
64 | console.dir(Export.CSV(instance));
|
65 | }}
|
66 | />,
|
67 | document.getElementById("your-element")
|
68 | );
|
69 | ```
|
70 |
|
71 | ## Option C: Import from npm
|
72 | 1. Install the required packages from npm:
|
73 | ```bash
|
74 | $ npm install tripetto-runner-foundation tripetto-runner-autoscroll react react-dom
|
75 | ```
|
76 | 2. Import the runner:
|
77 | ```typescript
|
78 | import { run } from "tripetto-runner-autoscroll";
|
79 | import { Export } from "tripetto-runner-foundation";
|
80 |
|
81 | run({
|
82 | definition: /** Supply a form definition here. */,
|
83 | onSubmit: instance => {
|
84 | // Implement your response handler here.
|
85 |
|
86 | // For this example we output all exportable fields to the browser console
|
87 | console.dir(Export.exportables(instance));
|
88 |
|
89 | // Or output the data in CSV-format
|
90 | console.dir(Export.CSV(instance));
|
91 | }
|
92 | });
|
93 | ```
|
94 |
|
95 | # Documentation
|
96 | The complete Tripetto documentation can be found at [docs.tripetto.com](https://docs.tripetto.com).
|
97 |
|
98 | # Support
|
99 | Run into issues or bugs? Report them [here](https://gitlab.com/tripetto/runners/autoscroll/issues) and we'll look into them.
|
100 |
|
101 | For general support contact us at [support@tripetto.com](mailto:support@tripetto.com). We're more than happy to assist you.
|
102 |
|
103 | # License
|
104 | [![License](https://img.shields.io/npm/l/tripetto.svg)](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode)
|
105 |
|
106 | You are allowed to use this package without a license (and free of charge) as long as you keep the Tripetto branding enabled (which is the default mode). When you want to remove the branding, you need a (paid) license to do so.
|
107 |
|
108 | # Contributors
|
109 | - [Hisam Fahri](https://gitlab.com/hisamafahri) (Indonesian translation)
|
110 | - [Krzysztof Kamiński](https://gitlab.com/kriskaminski) (Polish translation)
|
111 |
|
112 | # About us
|
113 | If you want to learn more about Tripetto or contribute in any way, visit us at [Tripetto.com](https://tripetto.com/).
|