Skip to content

Commit

Permalink
Merge branch 'main' into feat/polling-interval
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVidra authored Mar 2, 2024
2 parents c7fdc4a + 4cd9c17 commit 4aff735
Show file tree
Hide file tree
Showing 34 changed files with 1,096 additions and 597 deletions.
16 changes: 16 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Flows examples

This directory contains examples of flows that can be used as a starting point for your own Flows implementation.

## Examples

- [React Next.js](./react-nextjs) - A simple example of how to use Flows with React and Next.js.
- [JavaScript](./javascript) - A simple example of how to use Flows with vanilla JavaScript.

## Reporting Issues

We actively encourage our community to raise issues and provide feedback. If you find an issue, please let us know by raising an issue in the repository.

An issue can be raised by clicking the 'Issues' tab at the top of the repository, followed by the Green 'New issue' button.

When submitting an issue, please thoroughly and concisely describe the problem you are experiencing so that we may easily understand and resolve the issue in a timely manner.
3 changes: 3 additions & 0 deletions examples/javascript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pnpm-lock.yaml
package-lock.json
yarn.lock
5 changes: 5 additions & 0 deletions examples/javascript/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/javascript/favicon.ico
Binary file not shown.
233 changes: 233 additions & 0 deletions examples/javascript/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Flows - JavaScript example</title>
<meta
name="description"
content="Flows lets you build any onboarding you want. Guide users, increase feature adoption, and improve revenue."
/>

<!-- How you would use Flows in your own code -->
<!-- Make sure to lock specific version to avoid braking changes. Visit https://flows.sh/docs for more info. -->
<script defer src="https://unpkg.com/@flows/js@latest/dist/index.global.js"></script>
<script type="module">
flows.init({
projectId: "e7d8eb63-7670-4da1-b0e0-d2d3331d108b",
flows: [
{
id: "local-flow",
clickElement: "#start-local",
frequency: "every-time",
steps: [
{
title: "Welcome to Flows!",
body: "This is a demo of a local flow loaded from the codebase. Flows offer cloud flows as well, which can be updated without needing code changes.",
},
{
title: "This is a tooltip",
body: "It can have an overlay...",
targetElement: "#file1",
overlay: true,
},
{
title: "...or not",
body: "You can customize the tooltip to your liking.",
targetElement: "#file1",
},
{
title: "You can also wait for a click",
body: "Just like this! Click the button to continue.",
targetElement: "#upload",
overlay: true,
wait: {
clickElement: "#upload",
},
hideNext: true,
},
{
title: "Or you can branch out with forks",
body: "Click on one of the files to continue.",
targetElement: ".app-files",
overlay: true,
wait: [
{
clickElement: "#file1",
targetBranch: 0,
},
{
clickElement: "#file2",
targetBranch: 1,
},
{
clickElement: "#file3",
targetBranch: 2,
},
{
clickElement: "#file4",
targetBranch: 3,
},
],
hideNext: true,
},
[
[
{
title: "You clicked on FunnyCat.jpg",
body: "With forks, you can create multiple branches to tailor the onboarding to user actions.",
targetElement: "#file1",
overlay: true,
},
],
[
{
title: "You clicked on ImportantDoc.pdf",
body: "With forks, you can create multiple branches to tailor the onboarding to user actions.",
targetElement: "#file2",
overlay: true,
},
],
[
{
title: "You clicked on CoolVideo.mp4",
body: "With forks, you can create multiple branches to tailor the onboarding to user actions.",
targetElement: "#file3",
overlay: true,
},
],
[
{
title: "You clicked on DankMeme.png",
body: "With forks, you can create multiple branches to tailor the onboarding to user actions.",
targetElement: "#file4",
overlay: true,
},
],
],
{
title: "That was the basics of Flows!",
body: "You can create complex onboarding flows with Flows or a simple tour. If you liked what you saw, sign up and start creating your own flows.",
hideNext: true,
hidePrev: true,
footerActions: {
center: [
{
label: "Learn more",
external: true,
href: "https://flows.sh/docs",
variant: "secondary",
},
{
label: "Sign up",
external: true,
href: "https://app.flows.sh/signup",
},
],
},
},
],
},
],
})
</script>
</head>

<body>
<main>
<div class="header">
<div class="header-inner-wrap">
<div class="callout">
<h1>Flows JavaScript example</h1>
<p>
Get started at&nbsp;
<a
href="https://flows.sh/?utm_source=demos&utm_campaign=javascript"
target="_blank"
class="link"
>
flows.sh
</a>
</p>
</div>
<a
href="https://flows.sh/?utm_source=demos&utm_campaign=javascript"
target="_blank"
class="logo"
>
<img src="/logo.svg" alt="FlowsJS" height="36" />
</a>
</div>
</div>
<div class="main-wrapper">
<div class="flows-launch-wrapper">
<button id="start-cloud">Launch Cloud flow</button>
<button id="start-local">Launch Local flow</button>
</div>
<div class="app-wrapper">
<div class="app-header">
<p class="app-logo">DropCrate</p>
<button class="btn-secondary" id="upload">
Upload file
</button>
</div>
<div class="app-content">
<p class="app-list-title">Your files</p>
<div class="app-files">
<div class="app-file-item" id="file1">
FunnyCat.jpg
</div>
<div class="app-file-item" id="file2">
ImportantDoc.pdf
</div>
<div class="app-file-item" id="file3">
CoolVideo.mp4
</div>
<div class="app-file-item" id="file4">
DankMeme.png
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="footer-inner-wrap">
<a
class="footer-link"
href="https://flows.sh/docs/?utm_source=demos&utm_campaign=javascript"
target="_blank"
>
<h2 class="footer-heading">Docs</h2>
<p class="footer-link-text">Learn how to use Flows to build user onboarding.</p>
</a>
<a
class="footer-link"
href="https://app.flows.sh/signup/?utm_source=demos&utm_campaign=javascript"
target="_blank"
>
<h2 class="footer-heading">Sign up</h2>
<p class="footer-link-text">Create a Flows account and start creating flows.</p>
</a>
<a
class="footer-link"
href="https://github.com/RBND-studio/flows-js/tree/main/examples"
target="_blank"
>
<h2 class="footer-heading">See other demos</h2>
<p class="footer-link-text">Visit our GitHub repo to see other examples.</p>
</a>
<a
class="footer-link"
href="https://github.com/RBND-studio/flows-js/tree/main/examples/javascript"
target="_blank"
>
<h2 class="footer-heading">See source code</h2>
<p class="footer-link-text">
Visit our GitHub repo to what makes this example tick.
</p>
</a>
</div>
</div>
</main>
</html>
19 changes: 19 additions & 0 deletions examples/javascript/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vanilla-js-example",
"name": "javascript-example",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
Loading

0 comments on commit 4aff735

Please sign in to comment.