Skip to content

Commit 8248cf4

Browse files
committed
chore: updated to Angular 14; bumped library version to 9.x; updated README
1 parent cea39e9 commit 8248cf4

File tree

9 files changed

+8492
-9201
lines changed

9 files changed

+8492
-9201
lines changed

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Animated scrolling functionality for angular written in pure typescript with no
1212
## Features
1313

1414
- flexible: trigger scroll animations after component load, server response, etc.
15-
- easy-to-use directive: scroll to an element referenced in the href-attribute
15+
- easy-to-use directive: scroll to an element referenced in the href-attribute
1616
(`href="#mytarget`) just by adding `pageScroll` directive
17-
- customizable: adjust duration, offset or whether scrolling stops if the user interrupts
17+
- customizable: adjust duration, offset or whether scrolling stops if the user interrupts
1818
([read more](https://github.com/Nolanus/ngx-page-scroll/wiki/Scroll-Interruption-Interference))
1919
- use custom easing functions to calculate the scroll position over time
20-
- works across routes (scrolls to target element as soon as the
20+
- works across routes (scrolls to target element as soon as the
2121
routing has finished) and in both directions (horizontal/vertical)
2222

2323
## Table of contents
@@ -47,7 +47,8 @@ Install later versions in case your app is not running the very latest angular v
4747

4848
| ngx-page-scroll/ngx-page-scroll-core version | compatible angular version | Documentation |
4949
| -------------------------------------------- | -------------------------- | -------------------------------------------------------------------------- |
50-
| v8.x | v13 | [README](README.md) |
50+
| v9.x | v14 | [README](README.md) |
51+
| v8.x | v13 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v8.0.0/README.md) |
5152
| v7.x | v12, v11, v10, v9, v8 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v7.0.6/README.md) |
5253
| v6.x | v8, v7 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v6.0.2/README.md) |
5354
| v5.x | v6 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v5.0.1/README.md) |
@@ -89,18 +90,18 @@ import { PageScrollService } from 'ngx-page-scroll-core';
8990
export class MyComponent {
9091
constructor(private pageScrollService: PageScrollService, @Inject(DOCUMENT) private document: any) {
9192
}
92-
93+
9394
ngOnInit(): void {
9495
this.pageScrollService.scroll({
9596
document: this.document,
9697
scrollTarget: '.theEnd',
9798
});
9899
}
99100
}
100-
```
101+
```
101102

102-
Note: The `scroll()` method is a shorthand from creating a `PageScrollInstance` (an object encapsulating all information
103-
relevant for performing a scroll animation) using `PageScrollService#create` and starting it using
103+
Note: The `scroll()` method is a shorthand from creating a `PageScrollInstance` (an object encapsulating all information
104+
relevant for performing a scroll animation) using `PageScrollService#create` and starting it using
104105
the `PageScrollService#start` method.
105106

106107
### Configuration
@@ -120,8 +121,8 @@ object.
120121

121122
## Directive
122123

123-
For ease of use a directive `pageScroll` exists, which allows you to quickly add scroll animations to your angular app by
124-
adding a property to your existing HTML a-tags. It can also work cross-routes, meaning it will start the scroll animation
124+
For ease of use a directive `pageScroll` exists, which allows you to quickly add scroll animations to your angular app by
125+
adding a property to your existing HTML a-tags. It can also work cross-routes, meaning it will start the scroll animation
125126
after the target route has been loaded.
126127
It utilizes the ngx-page-scroll-core module for that, thus requires it as a peer dependency.
127128

@@ -147,11 +148,11 @@ export class AppModule {
147148
}
148149
```
149150

150-
### Usage
151+
### Usage
151152

152-
In your template you may add the `pageScroll` attribute to elements with an `href` attribute pointing towards an id on
153+
In your template you may add the `pageScroll` attribute to elements with an `href` attribute pointing towards an id on
153154
the same page (e.g. `#theId`). The `onClick` event will be interrupted and the scroll animation starts.
154-
Alternatively you may set the optional `pageScrollTarget` property to a valid css selector to specify the
155+
Alternatively you may set the optional `pageScrollTarget` property to a valid css selector to specify the
155156
target element to scroll to.
156157

157158
```typescript
@@ -171,8 +172,8 @@ export class MyComponent {
171172
### Directive API
172173

173174
Additional attributes may be set on an DOM element using the `pageScroll` directive for customization.
174-
They take precedence over the default settings specified in `PageScrollConfig` class. Thereby it is
175-
possible to have all page scroll-animations last e.g. 2 seconds, but a specific one should be performed with a custom easing function and a duration
175+
They take precedence over the default settings specified in `PageScrollConfig` class. Thereby it is
176+
possible to have all page scroll-animations last e.g. 2 seconds, but a specific one should be performed with a custom easing function and a duration
176177
of only 1 second.
177178

178179
#### PageScroll properties
@@ -184,7 +185,7 @@ of only 1 second.
184185
| `pageScrollHorizontal` | boolean | false | Whether the scroll should happen in vertical direction (`false`, default) or horizontal (`true`).
185186
| `pageScrollOffset` | number | 0 | Pixels to offset from the top of the element when scrolling to (positive value = scrolling will stop given pixels atop the target element).
186187
| `pageScrollDuration` | number | 1250 | Duration in milliseconds the whole scroll-animation should last.
187-
| `pageScrollSpeed` | number | - | Speed in Pixel/Second the animation should take. Only applied if no duration is set.
188+
| `pageScrollSpeed` | number | - | Speed in Pixel/Second the animation should take. Only applied if no duration is set.
188189
| `pageScrollInView` | boolean | true | Whether the scroll animation should happen even when the scroll target is already inside the view port (`true`). Set to `false` to skip scroll animation if target is already in view.
189190
| `pageScrollInterruptible` | boolean | true | Whether the scroll animation should stop if the user interferes with it (`true`) or not (`false`).
190191
| `pageScrollAdjustHash` | boolean | false | Whether the [routes hash/fragment](https://angular.io/docs/ts/latest/guide/router.html#!#query-parameters) should be updated to reflect to section that has been scrolled to
@@ -198,17 +199,17 @@ of only 1 second.
198199

199200
#### Example
200201

201-
The following example will check whether the route _Home_ is currently loaded.
202-
If this is true, the scroll-animation will be performed with the default
203-
properties. If a different route is loaded, a subscription for route changes
204-
will be made and the scroll-animation will be performed as soon as the new
202+
The following example will check whether the route _Home_ is currently loaded.
203+
If this is true, the scroll-animation will be performed with the default
204+
properties. If a different route is loaded, a subscription for route changes
205+
will be made and the scroll-animation will be performed as soon as the new
205206
route is loaded.
206207

207208
```html
208209
<a pageScroll [routerLink]="['Home']" href="#myanchor">Go there</a>
209210
```
210211

211-
Overriding all possible properties. `doSmth()` and `myEasing` are
212+
Overriding all possible properties. `doSmth()` and `myEasing` are
212213
defined in the component
213214

214215
```html
@@ -227,7 +228,7 @@ defined in the component
227228
if ((t /= d / 2) < 1) {
228229
return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
229230
}
230-
231+
231232
return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
232233
}
233234

angular.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
},
3939
"configurations": {
4040
"production": {
41+
"baseHref": "/ngx-page-scroll/",
4142
"fileReplacements": [
4243
{
4344
"replace": "src/environments/environment.ts",
@@ -189,8 +190,9 @@
189190
}
190191
}
191192
},
192-
"defaultProject": "ngx-page-scroll-demo",
193193
"cli": {
194-
"defaultCollection": "@angular-eslint/schematics"
194+
"schematicCollections": [
195+
"@angular-eslint/schematics"
196+
]
195197
}
196198
}

0 commit comments

Comments
 (0)