Skip to content

Commit 5db4174

Browse files
committed
First commit
0 parents  commit 5db4174

27 files changed

+11398
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode
2+
node_modules
3+
dist

LICENSE

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2018-present, Bourbon Ltd. All rights reserved.
2+
3+
You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
4+
copy, modify, and distribute this software in source code or binary form for use
5+
in connection with the web services and APIs provided by Bourbon Ltd.
6+
7+
This copyright notice shall be included in all copies or substantial portions of the software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
11+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
12+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Gist for Web
2+
3+
Gist enables you to create embeddable experiences that range from simple welcome messages to complex multi-step flows.
4+
5+
For installation guide, please follow our [documentation](https://docs.gist.build).

examples/index.html

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Gist for Web</title>
5+
<meta content="width=device-width, initial-scale=1" name="viewport" />
6+
<meta charset="utf-8" />
7+
<link href="styles.css" rel="stylesheet">
8+
</head>
9+
<body>
10+
<div id="banner"></div>
11+
<div class="row header">
12+
<h1>Gist for Web</h1>
13+
</div>
14+
<div class="row examples">
15+
<a href="#" class="button" onClick="showSimpleMessage()">Show Simple Message</a>
16+
<a href="#" class="button" onClick="showComplexMessage()">Show Complex Message</a>
17+
<a href="#" class="button" onClick="embedBanner()">Embed Banner</a>
18+
</div>
19+
<div class="row docs">
20+
<p>More information can be found on our <a target="_blank" href="https://docs.gist.build">docs</a>, if you have any question you can email us at <a target="_blank" href="mailto:[email protected]">[email protected]</a></p>
21+
</div>
22+
<script src="../dist/gist.js"></script>
23+
<script type="text/javascript">
24+
/*
25+
Dev Setup Options
26+
{ organizationId: "c6ff92b9-5607-4655-9265-f2588f7e3b58", useGuestSession: true, env: "local", logging: true }
27+
*/
28+
Gist.setup({ organizationId: "c6ff92b9-5607-4655-9265-f2588f7e3b58", logging: true });
29+
Gist.subscribeToTopic("announcements");
30+
Gist.setUserToken("BCD123");
31+
Gist.setCurrentRoute("home");
32+
33+
Gist.events.on("messageShown", message => {
34+
console.log(`onMessageShown: ${message.messageId} with instanceId: ${message.instanceId}`);
35+
});
36+
37+
Gist.events.on("messageDismissed", message => {
38+
console.log(`onMessageDismissed: ${message.messageId} with instanceId: ${message.instanceId}`);
39+
});
40+
41+
Gist.events.on("messageError", message => {
42+
console.log(`onMessageError: ${message.messageId} with instanceId: ${message.instanceId}`);
43+
});
44+
45+
Gist.events.on("messageAction", params => {
46+
console.log(`onMessageAction, Action: ${params.action} on route: ${params.message.currentRoute} with instanceId: ${params.message.instanceId}`);
47+
});
48+
49+
function showSimpleMessage() {
50+
Gist.showMessage({messageId: 'welcome', position: 'center'});
51+
}
52+
53+
function showComplexMessage() {
54+
Gist.showMessage(
55+
{
56+
messageId: 'artists',
57+
position: 'center',
58+
properties: {
59+
gist: { 'scale': true },
60+
title: 'Top Artists',
61+
list: [ { name: 'Beatles', discography: [ 'Please Please Me', 'With The Beatles', 'A Hard Day’s Night', 'Beatles For Sale', 'Help!', 'Rubber Soul', 'Revolver', 'Sgt Pepper’s Lonely Hearts Club Band', 'The Beatles', 'Yellow Submarine', 'Abbey Road', 'Let It Be' ] }, { name: 'The Doors', discography: ['The Doors', 'Strange Days', 'Waiting for the Sun', 'The Soft Parade', 'Absolutely Live', 'Morrison Hotel', 'L.A. Woman', 'Other Voices', 'Full Circle', 'An American Prayer'] }]
62+
}
63+
});
64+
}
65+
66+
function embedBanner() {
67+
// Loads example-banner message in element id "banner".
68+
Gist.embedMessage({ messageId: "example-banner" }, "banner");
69+
}
70+
</script>
71+
</body>
72+
</html>

examples/styles.css

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
html, body {
2+
padding: 0px;
3+
margin: 0px;
4+
font-family: Sans-Serif;
5+
font-weight: 400;
6+
font-size: 18px;
7+
line-height: 1.4;
8+
}
9+
10+
.row {
11+
margin: 0px 16px;
12+
display: flex;
13+
}
14+
15+
h1 {
16+
font-size: 34px;
17+
line-height: 1.5;
18+
}
19+
20+
.button {
21+
font-size: 15px;
22+
font-weight: bold;
23+
background-color: #f77f00;
24+
color: #fff;
25+
border-radius: 10px;
26+
min-width: 100px;
27+
padding: 10px;
28+
font-style: normal;
29+
text-decoration: none;
30+
margin-right: 16px;
31+
}
32+
33+
#banner {
34+
opacity: 0;
35+
transition: opacity 0.5s ease-in-out;
36+
}
37+
38+
#banner.gist-visible {
39+
opacity: 1;
40+
}

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Gist from './src/gist';
2+
export default Gist;

0 commit comments

Comments
 (0)