Skip to content

Commit

Permalink
Merge pull request #5 from maxime1992/feat/use-angular-cli-and-upgrad…
Browse files Browse the repository at this point in the history
…e-to-v8

feat: upgrade to Angular 8.x

This closes #4
  • Loading branch information
maxime1992 authored Jun 11, 2019
2 parents 1269638 + 43a7f5c commit efd863f
Show file tree
Hide file tree
Showing 60 changed files with 8,470 additions and 3,271 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
63 changes: 38 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
# Node
node_modules/*
npm-debug.log
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# TypeScript
src/*.js
src/*.map
src/*.d.ts
# dependencies
/node_modules

# JetBrains
.idea
# profiling files
chrome-profiler-events.json
speed-measure-plugin.json

# IDEs and editors
/.idea
.project
.settings
.idea/*
*.iml
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# VS Code
# IDE - VSCode
.vscode/*
.history
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Windows
Thumbs.db
Desktop.ini
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# Mac
# System Files
.DS_Store
**/.DS_Store

# Ngc generated files
**/*.ngfactory.ts

# Build files
dist/*
Thumbs.db
34 changes: 0 additions & 34 deletions .npmignore

This file was deleted.

27 changes: 27 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# angular gitignore
# see https://github.com/prettier/prettier/issues/2294

## compiled output
/dist
/tmp
/out-tsc

## dependencies
/node_modules

## IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.vscode/*
.history

# auto-generated files
/angular.json
/.angular-cli.json
/package-lock.json
/yarn.lock
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "ignore"
}
3 changes: 3 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pkgRoot": "dist/ngx-hover-opacity"
}
30 changes: 28 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
language: node_js
sudo: false

language: node_js
node_js:
- '4.2.1'
- '10'

cache: yarn

install:
- yarn --frozen-lockfile --non-interactive --no-progress

script:
# lint
- yarn run demo:lint:check
- yarn run prettier:check
# build
- yarn run lib:build:prod
- yarn run demo:build:prod --progress=false --base-href "https://cloudnc.github.io/ngx-hover-opacity/"
# publish to npm
- yarn global add cpy-cli --ignore-engines
- cpy README.md dist/ngx-hover-opacity
- test $TRAVIS_BRANCH = "master" && yarn run semantic-release || echo "Skipping deploy"

deploy:
skip_cleanup: true
provider: pages
github_token: $GH_TOKEN
local_dir: dist/ngx-hover-opacity-demo
on:
branch: master
7 changes: 0 additions & 7 deletions .yo-rc.json

This file was deleted.

41 changes: 14 additions & 27 deletions README.MD → README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# ngx-hover-opacity
This librairy aims to provide a simple way to "disable" an entire HTML element.

For example, if you display a given resource and suddenly it is not available anymore (deleted on the server and you just received an event).
Should you redirect the user to the home page? If he was reading it, it's a little brutal, isn't it?
This librairy aims to provide a simple way to visually "disable" an entire HTML element.

Instead of that, you might want to take a breath and do not remove the element right away.
Just hover it, with a nice opacity so the user cannot interact with it anymore.
For example, if you display a given resource and suddenly it's not available anymore (deleted on the server and you just received an event).
Should you redirect the user to the home page? If he was reading it, it's a little rough, isn't it?

Instead of that, you might want to hover it, with a nice opacity, so the user cannot interact with it anymore.
(Maybe you could also let him know what's happening with a message, but it's up to you).

## Demo:
## Demo:

ngx-hover-opacity set to **OFF**
![An MdCard from material with ngx-hover-opacity set to OFF](https://user-images.githubusercontent.com/4950209/29740631-2ee2ca28-8a5b-11e7-9f61-19681ab07fbd.png)
![A MatCard from material with ngx-hover-opacity set to OFF](https://user-images.githubusercontent.com/4950209/29740631-2ee2ca28-8a5b-11e7-9f61-19681ab07fbd.png)

ngx-hover-opacity set to **ON**
![An MdCard from material with ngx-hover-opacity set to ON](https://user-images.githubusercontent.com/4950209/29740633-4446d972-8a5b-11e7-9c61-f231d40d803a.png)
![A MatCard from material with ngx-hover-opacity set to ON](https://user-images.githubusercontent.com/4950209/29740633-4446d972-8a5b-11e7-9c61-f231d40d803a.png)

You can also [try it live on Stackblitz!](https://stackblitz.com/edit/angular-se17ec)

Expand All @@ -25,7 +25,9 @@ To install this library, run:
```bash
$ yarn add ngx-hover-opacity
```

or

```bash
$ npm install ngx-hover-opacity --save
```
Expand All @@ -37,26 +39,23 @@ From your Angular module (`AppModule` for example):
```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// import the module
import { NgxHoverOpacityModule } from 'ngx-hover-opacity';

@NgModule({
declarations: [
AppComponent
],
declarations: [AppComponent],
imports: [
BrowserModule,

// specify it as an import
NgxHoverOpacityModule
NgxHoverOpacityModule,
],
providers: [],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule { }
export class AppModule {}
```

Once your library is imported, you can use the component `ngx-hover-opacity` in your Angular application:
Expand All @@ -67,18 +66,6 @@ Once your library is imported, you can use the component `ngx-hover-opacity` in
</ngx-hover-opacity>
```

## Development

To generate all `*.js`, `*.d.ts` and `*.metadata.json` files:

```bash
$ yarn run build
```
or
```bash
$ npm run build
```

## License

MIT © [Maxime ROBERT](mailto:[email protected])
Loading

0 comments on commit efd863f

Please sign in to comment.