Demo page UI and basic example
Browse files- demo/base.scss +21 -4
- demo/demo.js +0 -16
- demo/demo.scss +36 -13
- demo/emoji.js +28 -0
- index.html +28 -14
- src/sholo.scss +6 -2
- webpack.config.dev.js +1 -0
demo/base.scss
CHANGED
@@ -13,7 +13,9 @@ $heading-font-weight: 700;
|
|
13 |
|
14 |
* {
|
15 |
-webkit-font-smoothing: antialiased;
|
16 |
-
-moz-osx-font-smoothing: grayscale
|
|
|
|
|
17 |
}
|
18 |
|
19 |
*, *:before, *:after {
|
@@ -32,8 +34,8 @@ body {
|
|
32 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
33 |
font-size: 16px;
|
34 |
line-height: 1.4;
|
35 |
-
color:
|
36 |
-
background-color: #
|
37 |
overflow-x: hidden;
|
38 |
}
|
39 |
|
@@ -47,6 +49,7 @@ label {
|
|
47 |
|
48 |
p {
|
49 |
margin-top: 0;
|
|
|
50 |
}
|
51 |
|
52 |
hr {
|
@@ -54,7 +57,9 @@ hr {
|
|
54 |
margin: $global-guttering*1.25 0;
|
55 |
border: 0;
|
56 |
border-bottom: 1px solid #eaeaea;
|
57 |
-
|
|
|
|
|
58 |
}
|
59 |
|
60 |
h1, h2, h3, h4, h5, h6 {
|
@@ -107,6 +112,18 @@ h6, .h6 {
|
|
107 |
font-size: $global-font-size-h6;
|
108 |
}
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
.container {
|
111 |
display: block;
|
112 |
margin: auto;
|
|
|
13 |
|
14 |
* {
|
15 |
-webkit-font-smoothing: antialiased;
|
16 |
+
-moz-osx-font-smoothing: grayscale;
|
17 |
+
margin: 0;
|
18 |
+
padding: 0;
|
19 |
}
|
20 |
|
21 |
*, *:before, *:after {
|
|
|
34 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
35 |
font-size: 16px;
|
36 |
line-height: 1.4;
|
37 |
+
color: white;
|
38 |
+
background-color: #2E2E30;
|
39 |
overflow-x: hidden;
|
40 |
}
|
41 |
|
|
|
49 |
|
50 |
p {
|
51 |
margin-top: 0;
|
52 |
+
margin-bottom: 20px;
|
53 |
}
|
54 |
|
55 |
hr {
|
|
|
57 |
margin: $global-guttering*1.25 0;
|
58 |
border: 0;
|
59 |
border-bottom: 1px solid #eaeaea;
|
60 |
+
background: url(https://i.imgur.com/MoU1Mn4.png) repeat-y;
|
61 |
+
height: 5px;
|
62 |
+
background-size: cover;
|
63 |
}
|
64 |
|
65 |
h1, h2, h3, h4, h5, h6 {
|
|
|
112 |
font-size: $global-font-size-h6;
|
113 |
}
|
114 |
|
115 |
+
ul li, ol li {
|
116 |
+
list-style-type: none;
|
117 |
+
line-height: 1.5;
|
118 |
+
}
|
119 |
+
|
120 |
+
blockquote {
|
121 |
+
background: #f5f3f1;
|
122 |
+
padding: 10px;
|
123 |
+
margin-bottom: 35px;
|
124 |
+
border-radius: 10px;
|
125 |
+
}
|
126 |
+
|
127 |
.container {
|
128 |
display: block;
|
129 |
margin: auto;
|
demo/demo.js
CHANGED
@@ -14,22 +14,6 @@ sholo.defineSteps([
|
|
14 |
position: 'bottom',
|
15 |
},
|
16 |
},
|
17 |
-
{
|
18 |
-
element: '.btn__example',
|
19 |
-
popover: {
|
20 |
-
title: 'Adding Introductions',
|
21 |
-
description: 'You can use it to add popovers on top of the website',
|
22 |
-
position: 'left',
|
23 |
-
},
|
24 |
-
},
|
25 |
-
{
|
26 |
-
element: '.btn__light',
|
27 |
-
popover: {
|
28 |
-
title: 'Adding Introductions',
|
29 |
-
description: 'You can use it to add popovers on top of the website',
|
30 |
-
position: 'rig',
|
31 |
-
},
|
32 |
-
},
|
33 |
{
|
34 |
element: '.section__how',
|
35 |
popover: {
|
|
|
14 |
position: 'bottom',
|
15 |
},
|
16 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
{
|
18 |
element: '.section__how',
|
19 |
popover: {
|
demo/demo.scss
CHANGED
@@ -9,10 +9,20 @@ $dark-button-text: #ffffff !default;
|
|
9 |
$light-button-bg: #f5f5f5 !default;
|
10 |
$light-button-text: #2d2d2d !default;
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
.page-wrap {
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
16 |
}
|
17 |
|
18 |
.btn {
|
@@ -21,27 +31,40 @@ $light-button-text: #2d2d2d !default;
|
|
21 |
border-radius: 3px;
|
22 |
|
23 |
&.btn__dark {
|
24 |
-
|
25 |
-
color:
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
}
|
33 |
|
34 |
section {
|
35 |
-
margin-bottom:
|
36 |
}
|
37 |
|
38 |
.section__header {
|
39 |
-
margin:
|
40 |
text-align: center;
|
41 |
display: block;
|
42 |
-
padding: 10px
|
43 |
|
44 |
h1 {
|
45 |
font-size: $logo-font-size;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
}
|
|
|
9 |
$light-button-bg: #f5f5f5 !default;
|
10 |
$light-button-text: #2d2d2d !default;
|
11 |
|
12 |
+
img.emoji {
|
13 |
+
height: 1em;
|
14 |
+
width: 1em;
|
15 |
+
margin: 0 .05em 0 .1em;
|
16 |
+
vertical-align: -0.1em;
|
17 |
+
}
|
18 |
+
|
19 |
.page-wrap {
|
20 |
+
width: 500px;
|
21 |
+
margin: 50px auto;
|
22 |
+
background: white;
|
23 |
+
padding: 10px 30px;
|
24 |
+
border-radius: 5px;
|
25 |
+
color: #333333;
|
26 |
}
|
27 |
|
28 |
.btn {
|
|
|
31 |
border-radius: 3px;
|
32 |
|
33 |
&.btn__dark {
|
34 |
+
color: #FFFFFF;
|
35 |
+
background-color: #F44336;
|
36 |
+
padding: 0 18px;
|
37 |
+
height: 40px;
|
38 |
+
line-height: 40px;
|
39 |
+
border-radius: 20px;
|
40 |
+
cursor: pointer;
|
41 |
+
transition: background-color 0.2s, color 0.2s;
|
42 |
+
font-weight: 500;
|
43 |
+
width: 240px;
|
44 |
+
font-size: 17px;
|
45 |
+
margin: auto;
|
46 |
+
display: block;
|
47 |
}
|
48 |
}
|
49 |
|
50 |
section {
|
51 |
+
margin-bottom: $global-guttering*1.25;
|
52 |
}
|
53 |
|
54 |
.section__header {
|
55 |
+
margin: 10px 0 30px;
|
56 |
text-align: center;
|
57 |
display: block;
|
58 |
+
padding: 10px;
|
59 |
|
60 |
h1 {
|
61 |
font-size: $logo-font-size;
|
62 |
+
|
63 |
+
.emoji {
|
64 |
+
font-size: 45px;
|
65 |
+
top: -4px;
|
66 |
+
margin-right: 3px;
|
67 |
+
position: relative;
|
68 |
+
}
|
69 |
}
|
70 |
}
|
demo/emoji.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Just for the sake of styling page
|
2 |
+
/* eslint-disable */
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Determine if this browser supports emoji.
|
6 |
+
*
|
7 |
+
* Modified from https://gist.github.com/mwunsch/4710561
|
8 |
+
* and probobly originally github's javascript source
|
9 |
+
*/
|
10 |
+
function doesSupportEmoji() {
|
11 |
+
let context;
|
12 |
+
if (!document.createElement('canvas').getContext) return;
|
13 |
+
context = document.createElement('canvas').getContext('2d');
|
14 |
+
if ((typeof context.fillText) !== 'function') {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
let smile = String.fromCharCode(55357) + String.fromCharCode(56835);
|
19 |
+
|
20 |
+
context.textBaseline = "top";
|
21 |
+
context.font = "32px Arial";
|
22 |
+
context.fillText(smile, 0, 0);
|
23 |
+
return context.getImageData(16, 16, 1, 1).data[0] !== 0;
|
24 |
+
}
|
25 |
+
|
26 |
+
if (!doesSupportEmoji()) {
|
27 |
+
twemoji.parse(document.body);
|
28 |
+
}
|
index.html
CHANGED
@@ -11,21 +11,32 @@
|
|
11 |
<body>
|
12 |
<div class="page-wrap">
|
13 |
<section class="section__header" data-sholo="Hey welcome to presenter!">
|
14 |
-
<h1>
|
15 |
-
<p class="text-muted">A light-weight, no-dependency, vanilla JavaScript library to
|
16 |
-
|
17 |
-
<a href="javascript:void(0)" class="btn btn__example btn__dark">Show an Example</a>
|
18 |
-
<a href="javascript:void(0)" class="btn btn__light">Learn More</a>
|
19 |
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<section class="section__purpose">
|
21 |
-
<
|
22 |
-
<
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
</section>
|
|
|
27 |
<section class="section__how">
|
28 |
-
<
|
29 |
<p>Ever heard of magic? ...it is not that, it just uses some canvas manipulation to put the focus on some
|
30 |
element</p>
|
31 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
@@ -33,21 +44,21 @@
|
|
33 |
reprehenderit tempora!</p>
|
34 |
</section>
|
35 |
<section class="section__examples">
|
36 |
-
<
|
37 |
<p>Here are some of the examples</p>
|
38 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
39 |
ipsa molestias, natus nulla odit optio pariatur perspiciatis, quae quam quasi quibusdam recusandae repellendus
|
40 |
reprehenderit tempora!</p>
|
41 |
</section>
|
42 |
<section class="section__learn">
|
43 |
-
<
|
44 |
<p>Here are some of the examples</p>
|
45 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
46 |
ipsa molestias, natus nulla odit optio pariatur perspiciatis, quae quam quasi quibusdam recusandae repellendus
|
47 |
reprehenderit tempora!</p>
|
48 |
</section>
|
49 |
<section class="section__contributing">
|
50 |
-
<
|
51 |
<p>Here are some of the examples</p>
|
52 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
53 |
ipsa molestias, natus nulla odit optio pariatur perspiciatis, quae quam quasi quibusdam recusandae repellendus
|
@@ -55,7 +66,10 @@
|
|
55 |
</section>
|
56 |
</div>
|
57 |
|
|
|
|
|
58 |
<script src="./dist/sholo.js"></script>
|
59 |
<script src="./dist/demo.js"></script>
|
|
|
60 |
</body>
|
61 |
</html>
|
|
|
11 |
<body>
|
12 |
<div class="page-wrap">
|
13 |
<section class="section__header" data-sholo="Hey welcome to presenter!">
|
14 |
+
<h1><span class="emoji">👨🔧️</span> Driver</h1>
|
15 |
+
<p class="text-muted">A light-weight, no-dependency, vanilla JavaScript library to drive the user's focus across the page</p>
|
16 |
+
<a href="javascript:void(0)" class="btn btn__example btn__dark">Quick Example</a>
|
|
|
|
|
17 |
</section>
|
18 |
+
|
19 |
+
<blockquote>
|
20 |
+
<p>A lightweight (~4kb gzipped) yet powerful JavaScript engine that helps you drive the user's focus on page.</p>
|
21 |
+
<p class="zero-bottom">Some sample use-cases can be creating powerful feature introductions, call-to-action components, focus shifters etc.</p>
|
22 |
+
</blockquote>
|
23 |
+
|
24 |
<section class="section__purpose">
|
25 |
+
<h3>Features</h3>
|
26 |
+
<ul>
|
27 |
+
<li>Highlight any item on page</li>
|
28 |
+
<li>Block user interactions</li>
|
29 |
+
<li>Create feature introductions</li>
|
30 |
+
<li>User Friendly – Controllable by keys</li>
|
31 |
+
<li>Free for personal and commercial use</li>
|
32 |
+
<li>Lightweight – Only ~4kb when gzipped</li>
|
33 |
+
<li>Supports all major browsers</li>
|
34 |
+
<li></li>
|
35 |
+
</ul>
|
36 |
</section>
|
37 |
+
<hr>
|
38 |
<section class="section__how">
|
39 |
+
<h3>How does it do that?</h3>
|
40 |
<p>Ever heard of magic? ...it is not that, it just uses some canvas manipulation to put the focus on some
|
41 |
element</p>
|
42 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
|
|
44 |
reprehenderit tempora!</p>
|
45 |
</section>
|
46 |
<section class="section__examples">
|
47 |
+
<h3>Can you show some Examples?</h3>
|
48 |
<p>Here are some of the examples</p>
|
49 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
50 |
ipsa molestias, natus nulla odit optio pariatur perspiciatis, quae quam quasi quibusdam recusandae repellendus
|
51 |
reprehenderit tempora!</p>
|
52 |
</section>
|
53 |
<section class="section__learn">
|
54 |
+
<h3>I want to learn more</h3>
|
55 |
<p>Here are some of the examples</p>
|
56 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
57 |
ipsa molestias, natus nulla odit optio pariatur perspiciatis, quae quam quasi quibusdam recusandae repellendus
|
58 |
reprehenderit tempora!</p>
|
59 |
</section>
|
60 |
<section class="section__contributing">
|
61 |
+
<h3>Contributing</h3>
|
62 |
<p>Here are some of the examples</p>
|
63 |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi assumenda, at consectetur cupiditate inventore
|
64 |
ipsa molestias, natus nulla odit optio pariatur perspiciatis, quae quam quasi quibusdam recusandae repellendus
|
|
|
66 |
</section>
|
67 |
</div>
|
68 |
|
69 |
+
<script src="//twemoji.maxcdn.com/2/twemoji.min.js?2.5"></script>
|
70 |
+
|
71 |
<script src="./dist/sholo.js"></script>
|
72 |
<script src="./dist/demo.js"></script>
|
73 |
+
<script src="./dist/emoji.js"></script>
|
74 |
</body>
|
75 |
</html>
|
src/sholo.scss
CHANGED
@@ -2,6 +2,7 @@ div#sholo-popover-item {
|
|
2 |
display: none;
|
3 |
position: absolute;
|
4 |
background: white;
|
|
|
5 |
margin: 0;
|
6 |
padding: 15px;
|
7 |
border-radius: 5px;
|
@@ -87,18 +88,21 @@ div#sholo-popover-item {
|
|
87 |
}
|
88 |
|
89 |
.sholo-popover-title {
|
90 |
-
font
|
91 |
margin: 0 0 5px;
|
92 |
font-weight: bold;
|
93 |
display: block;
|
94 |
position: relative;
|
|
|
|
|
95 |
}
|
96 |
|
97 |
.sholo-popover-description {
|
98 |
margin-bottom: 0;
|
99 |
-
font
|
100 |
line-height: 1.5;
|
101 |
color: #2d2d2d;
|
102 |
font-weight: normal;
|
|
|
103 |
}
|
104 |
}
|
|
|
2 |
display: none;
|
3 |
position: absolute;
|
4 |
background: white;
|
5 |
+
color: #2d2d2d;
|
6 |
margin: 0;
|
7 |
padding: 15px;
|
8 |
border-radius: 5px;
|
|
|
88 |
}
|
89 |
|
90 |
.sholo-popover-title {
|
91 |
+
font: 19px/normal sans-serif;
|
92 |
margin: 0 0 5px;
|
93 |
font-weight: bold;
|
94 |
display: block;
|
95 |
position: relative;
|
96 |
+
line-height: 1.5;
|
97 |
+
zoom: 1;
|
98 |
}
|
99 |
|
100 |
.sholo-popover-description {
|
101 |
margin-bottom: 0;
|
102 |
+
font: 14px/normal sans-serif;
|
103 |
line-height: 1.5;
|
104 |
color: #2d2d2d;
|
105 |
font-weight: normal;
|
106 |
+
zoom: 1;
|
107 |
}
|
108 |
}
|
webpack.config.dev.js
CHANGED
@@ -50,6 +50,7 @@ module.exports = {
|
|
50 |
}),
|
51 |
new CopyWebpackPlugin([
|
52 |
'./demo/demo.js',
|
|
|
53 |
]),
|
54 |
],
|
55 |
stats: {
|
|
|
50 |
}),
|
51 |
new CopyWebpackPlugin([
|
52 |
'./demo/demo.js',
|
53 |
+
'./demo/emoji.js',
|
54 |
]),
|
55 |
],
|
56 |
stats: {
|