Skip to content

Commit 369ff2d

Browse files
authored
Merge pull request #7 from iamvijaydev/develop
Develop
2 parents e806a1a + 1c85790 commit 369ff2d

23 files changed

+729
-265
lines changed

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
ng Augment Native scroll [![npm version](https://badge.fury.io/js/ng-augment-native-scroll.svg)](https://badge.fury.io/js/ng-augment-native-scroll) [![Bower version](https://badge.fury.io/bo/ng-augment-native-scroll.svg)](https://badge.fury.io/bo/ng-augment-native-scroll)
22
========================
3-
_This is a angular (v1.x) port of the original experiments with [augment native scroll](https://github.com/iamvijaydev/augment-native-scroll)_
3+
This module aims to augment native scroll to provide few neat features. The features available as directives, are applied intelligently, based on the user device. Touch or non-touch. _This is a angular (v1.x) port of the original experiments with [augment native scroll](https://github.com/iamvijaydev/augment-native-scroll)._
44

5-
This module aims to provides few directives to augment native scroll:
5+
###Connect Scrolls
6+
It can connect two or more scrollable areas so that they all scroll as one. Wrap each scrollable area with `scrollArea` directive, then wrap them all with `connectScrolls` directive. `connectScrolls` connects scrollable areas within `scrollArea`. For non-touch devices it can also apply kinetic scrolling.
67

7-
* `connectScrolls` will connect scrolls within `scrollArea` so that they scroll synchronously. Meaning if one scrolls other will too. For non-touch devices it can also apply kinetic scroll. Here's an [example](https://iamvijaydev.github.io/ng-augment-native-scroll/examples/connectedScrolls.html).
8-
* `kineticScroll` will apply touch-device-like smooth and kinetic scroll to native scroll. You can (mouse) click-hold to drag the scroll and release-flick to auto-scroll just like a kinetic scroll on touch devices. Here's an [example](https://iamvijaydev.github.io/ng-augment-native-scroll/examples/kineticScroll.html).
8+
[Demo](https://iamvijaydev.github.io/ng-augment-native-scroll/examples/connectedScrolls.html) | [Usage](https://github.com/iamvijaydev/ng-augment-native-scroll/tree/develop#connectscroll-and-scrollarea-directive-usage)
9+
10+
###Kinetic Scroll
11+
It will apply touch-device-like smooth and kinetic scroll to native scroll. You can (mouse) click-hold to drag the scroll and release-flick to auto-scroll just like a kinetic scroll on touch devices. Just wrap the scrollable area with `kineticScroll` directive.
12+
13+
[Demo](https://iamvijaydev.github.io/ng-augment-native-scroll/examples/connectedScrolls.html) | [Usage](https://github.com/iamvijaydev/ng-augment-native-scroll/tree/develop#kineticscroll-directive-usage)
914

1015
**NOTE: Kinetic scroll with mouse events will be applied to non-touch devices only. It will NOT be applied on touch devices.**
1116

1217

18+
1319
# Installation and usage
1420
###Via yarn or npm:
1521
```shell
@@ -22,9 +28,7 @@ $ npm install ng-augment-native-scroll --save
2228
Then use it as:
2329
```javascript
2430
var angular = require('angular');
25-
angular.module('mainApp', [
26-
require('ng-augment-native-scroll')
27-
]);
31+
angular.module('mainApp', [ require('ng-augment-native-scroll') ]);
2832
```
2933
###Via bower:
3034
```
@@ -35,21 +39,22 @@ Then use it as:
3539
var angular = require('angular');
3640
var ngAugmentNativeScroll = require('./bower_components/ng-augment-native-scroll/src');
3741

38-
angular.module('mainApp', ['ngAugmentNativeScroll']);
42+
angular.module('mainApp', ['ng-augment-native-scroll']);
3943
```
40-
You can also use it in the old fashion way as:
44+
You can also include it in the old fashion way as:
4145
```html
4246
<script src="/bower_components/ng-augment-native-scroll/dist/ngAugmentNativeScroll.js"></script>
4347
<!-- or -->
4448
<script src="/bower_components/ng-augment-native-scroll/dist/ngAugmentNativeScroll.min.js"></script>
4549
```
4650

4751
###Direct use:
48-
Download the files as [zip](https://github.com/iamvijaydev/ng-augment-native-scroll/archive/v0.13.2.zip) or [tar.gz](https://github.com/iamvijaydev/ng-augment-native-scroll/archive/v0.13.2.tar.gz). Include it in your HTML file and use it in your script file as shown below:
49-
```
52+
Download the files as [zip](https://github.com/iamvijaydev/ng-augment-native-scroll/archive/v0.15.0.zip) or [tar.gz](https://github.com/iamvijaydev/ng-augment-native-scroll/archive/v0.15.0.tar.gz). Include it in your HTML file and use it in your script file as shown below:
53+
```html
5054
// template.html
51-
<script src="path/to/file" charset="utf-8"></script>
52-
55+
<script src="<path-to-folder>/dist/ngAugmentNativeScroll.js" charset="utf-8"></script>
56+
```
57+
```javascript
5358
// main.js
5459
angular.module('mainApp', ['ng-augment-native-scroll']);
5560
```

dist/ng-augment-native-scroll.js

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
1-
/*!
2-
* v0.14.1
3-
*
4-
* MIT License
5-
*
6-
* Copyright (c) 2017 Vijay Dev (http://vijaydev.com/)
7-
*
8-
* Permission is hereby granted, free of charge, to any person obtaining a copy
9-
* of this software and associated documentation files (the "Software"), to deal
10-
* in the Software without restriction, including without limitation the rights
11-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
* copies of the Software, and to permit persons to whom the Software is
13-
* furnished to do so, subject to the following conditions:
14-
*
15-
* The above copyright notice and this permission notice shall be included in all
16-
* copies or substantial portions of the Software.
17-
*
18-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24-
* SOFTWARE.
25-
*
26-
*/
271
(function webpackUniversalModuleDefinition(root, factory) {
282
if(typeof exports === 'object' && typeof module === 'object')
293
module.exports = factory(require("angular"));
@@ -691,11 +665,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
691665
/* 7 */
692666
/***/ (function(module, exports, __webpack_require__) {
693667

694-
function main () {
695-
'use strict';
668+
"use strict";
696669

697-
var moduleName = 'ng-augment-native-scroll';
670+
671+
function main () {
698672
var angular = __webpack_require__(6);
673+
var moduleName = 'ng-augment-native-scroll';
699674

700675
angular.module(moduleName, [])
701676
.factory('augNsUtils', __webpack_require__(1))

dist/ng-augment-native-scroll.min.js

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ng-augment-native-scroll.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/connectedScrolls.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" ng-app="app">
2+
<html lang="en" ng-app="exampleApp">
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -8,8 +8,8 @@
88
<link rel="stylesheet" href="./css/styles.css">
99
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,400i,700" rel="stylesheet">
1010
</head>
11-
<body>
12-
<div ng-controller="ExampleApp.Controller">
11+
<body class="no-overflow">
12+
<div ng-controller="connectScrollsExample">
1313
<connect-scrolls options="options">
1414
<scroll-area>
1515
<div id="list" class="brand-scrollbar">
@@ -38,8 +38,6 @@
3838
</connect-scrolls>
3939
<span ng-include="'interact-methods.html'"></span>
4040
</div>
41-
<script src="./lib/angular.stable.min.js" charset="utf-8"></script>
42-
<script src="../dist/ng-augment-native-scroll.min.js" charset="utf-8"></script>
43-
<script src="./scripts/connectScrollsExample.js" charset="utf-8"></script>
41+
<script src="./scripts/exampleApp.bundle.js" charset="utf-8"></script>
4442
</body>
4543
</html>

examples/css/styles.css

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ body {
1313
font-family: 'Roboto Condensed', sans-serif;
1414
position: relative;
1515
user-select: none;
16+
}
17+
18+
.no-overflow {
1619
overflow: hidden;
1720
}
1821

@@ -508,3 +511,160 @@ p {
508511
.form-input:focus {
509512
border: 1px solid #c876ff;
510513
}
514+
515+
516+
strong {
517+
font-weight: 600;
518+
}
519+
520+
.markdown-body {
521+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
522+
font-size: 16px;
523+
line-height: 1.5;
524+
word-wrap: break-word;
525+
background-color: #fff;
526+
}
527+
528+
.markdown-body p {
529+
margin-top: 0;
530+
margin-bottom: 16px;
531+
}
532+
533+
.markdown-body>*:first-child {
534+
margin-top: 0 !important;
535+
}
536+
537+
.markdown-body h1 {
538+
margin-top: 24px;
539+
margin-bottom: 16px;
540+
font-weight: 600;
541+
line-height: 1.25;
542+
padding-bottom: 0.3em;
543+
font-size: 2em;
544+
border-bottom: 1px solid #eee;
545+
}
546+
547+
.markdown-body ul {
548+
margin-top: 0;
549+
margin-bottom: 16px;
550+
padding-left: 2em;
551+
}
552+
553+
.markdown-body ul li {
554+
display: list-item;
555+
text-align: -webkit-match-parent;
556+
}
557+
558+
.markdown-body code {
559+
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
560+
padding: 0;
561+
padding-top: 0.2em;
562+
padding-bottom: 0.2em;
563+
margin: 0;
564+
font-size: 85%;
565+
background-color: rgba(0,0,0,0.04);
566+
border-radius: 3px;
567+
}
568+
569+
.markdown-body h3 {
570+
margin-top: 24px;
571+
margin-bottom: 16px;
572+
font-weight: 600;
573+
line-height: 1.25;
574+
font-size: 1.25em;
575+
}
576+
577+
.markdown-body .highlight {
578+
margin-bottom: 16px;
579+
}
580+
581+
.markdown-body pre {
582+
word-wrap: normal;
583+
margin-top: 0;
584+
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
585+
}
586+
587+
.markdown-body .highlight pre, .markdown-body pre {
588+
padding: 16px;
589+
overflow: auto;
590+
font-size: 85%;
591+
line-height: 1.45;
592+
background-color: #f7f7f7;
593+
border-radius: 3px;
594+
}
595+
596+
.markdown-body .highlight pre {
597+
margin-bottom: 0;
598+
word-break: normal;
599+
}
600+
601+
.markdown-body pre code, .markdown-body pre tt {
602+
display: inline;
603+
max-width: auto;
604+
padding: 0;
605+
margin: 0;
606+
overflow: visible;
607+
line-height: inherit;
608+
word-wrap: normal;
609+
background-color: transparent;
610+
border: 0;
611+
}
612+
613+
.markdown-body pre>code {
614+
padding: 0;
615+
margin: 0;
616+
font-size: 100%;
617+
word-break: normal;
618+
white-space: pre;
619+
background: transparent;
620+
border: 0;
621+
}
622+
623+
.pl-c {
624+
color: #969896;
625+
}
626+
.pl-k {
627+
color: #a71d5d;
628+
}
629+
.pl-c1, .pl-s .pl-v {
630+
color: #0086b3;
631+
}
632+
.pl-s, .pl-pds, .pl-s .pl-pse .pl-s1, .pl-sr, .pl-sr .pl-cce, .pl-sr .pl-sre, .pl-sr .pl-sra {
633+
color: #183691;
634+
}
635+
.pl-smi, .pl-s .pl-s1 {
636+
color: #333;
637+
}
638+
.pl-e, .pl-en {
639+
color: #795da3;
640+
}
641+
.pl-ent {
642+
color: #63a35c;
643+
}
644+
645+
table {
646+
border-spacing: 0;
647+
border-collapse: collapse;
648+
}
649+
650+
.markdown-body table {
651+
margin-top: 0;
652+
margin-bottom: 16px;
653+
display: block;
654+
width: 100%;
655+
overflow: auto;
656+
}
657+
658+
.markdown-body table tr {
659+
background-color: #fff;
660+
border-top: 1px solid #ccc;
661+
}
662+
663+
.markdown-body table th, .markdown-body table td {
664+
padding: 6px 13px;
665+
border: 1px solid #ddd;
666+
}
667+
668+
.markdown-body table th {
669+
font-weight: 600;
670+
}

examples/index.html

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/kineticScroll.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" ng-app="app">
2+
<html lang="en" ng-app="exampleApp">
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -8,8 +8,8 @@
88
<link rel="stylesheet" href="./css/styles.css">
99
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,400i,700" rel="stylesheet">
1010
</head>
11-
<body>
12-
<div ng-controller="ExampleApp.Controller">
11+
<body class="no-overflow">
12+
<div ng-controller="kineticScrollExample">
1313
<kinetic-scroll options="options">
1414
<div id="table" class="alone brand-scrollbar">
1515
<table>
@@ -28,8 +28,6 @@
2828
</kinetic-scroll>
2929
<span ng-include="'interact-methods.html'"></span>
3030
</div>
31-
<script src="./lib/angular.stable.min.js" charset="utf-8"></script>
32-
<script src="../dist/ng-augment-native-scroll.min.js" charset="utf-8"></script>
33-
<script src="./scripts/kineticScrollExample.js" charset="utf-8"></script>
31+
<script src="./scripts/exampleApp.bundle.js" charset="utf-8"></script>
3432
</body>
3533
</html>

0 commit comments

Comments
 (0)