{"id":22821834,"url":"https://github.com/toriphes/ion-header-scroll-opacity","last_synced_at":"2025-04-23T03:09:38.538Z","repository":{"id":32570567,"uuid":"137271415","full_name":"toriphes/ion-header-scroll-opacity","owner":"toriphes","description":"Change header background opacity on content scroll","archived":false,"fork":false,"pushed_at":"2023-02-28T04:28:00.000Z","size":5595,"stargazers_count":8,"open_issues_count":16,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T03:09:35.685Z","etag":null,"topics":["directive","ionic","opacity","scroll"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toriphes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-13T21:10:00.000Z","updated_at":"2022-03-23T19:35:52.000Z","dependencies_parsed_at":"2023-02-17T22:31:00.264Z","dependency_job_id":null,"html_url":"https://github.com/toriphes/ion-header-scroll-opacity","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toriphes%2Fion-header-scroll-opacity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toriphes%2Fion-header-scroll-opacity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toriphes%2Fion-header-scroll-opacity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toriphes%2Fion-header-scroll-opacity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toriphes","download_url":"https://codeload.github.com/toriphes/ion-header-scroll-opacity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360494,"owners_count":21417721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["directive","ionic","opacity","scroll"],"created_at":"2024-12-12T16:09:07.070Z","updated_at":"2025-04-23T03:09:38.522Z","avatar_url":"https://github.com/toriphes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/l/ion-header-scroll-opacity.svg)](https://www.npmjs.com/package/ion-header-scroll-opacity/)\n[![npm](https://img.shields.io/npm/dt/ion-header-scroll-opacity.svg)](https://www.npmjs.com/package/ion-header-scroll-opacity)\n[![npm](https://img.shields.io/npm/dm/ion-header-scroll-opacity.svg)](https://www.npmjs.com/package/ion-header-scroll-opacity)\n\n# ion-header-scroll-opacity\n\nNow compatible with Ionic 4 🎉.\n\nChange header background opacity on content scroll.\n\n## install\n\n```bash\nnpm i ion-header-scroll-opacity --save\n```\n\nIf you are using Ionic 3 install `ion-header-scroll-opacity@^1.0.0` and use to the [ion-header-scroll-opacit#ionic-3 ](https://github.com/toriphes/ion-header-scroll-opacity/tree/ionic-3) branch for reference.\n\n## Import directive\n\nImport the `IonHeaderScrollOpacityModule` into the your page module\n\n```typescript\nimport { IonHeaderScrollOpacityModule } from \"ion-header-scroll-opacity\";\n\n@NgModule({\n  [...]\n  imports: [IonHeaderScrollOpacityModule],\n  [...]\n})\nexport class HomePageModule {}\n```\n\n## Usage\n\nPut the `header-scroll-opacity` directive on the ion-header element.\n\n### Directive Input\n\n| Input         | Description                                                        | Default value |\n| ------------- | ------------------------------------------------------------------ | ------------- |\n| ionContentRef | `ion-content` reference                                            | _none_        |\n| scrollAmount  | Amount of pixel to be scrolled in order end the opacity transition | 88            |\n| isTransparent | If true the header background starts with opacity=0                | true          |\n\n```html\n\u003cion-header scrollOpacity [ionContentRef]=\"mycontent\"\u003e\n  \u003cion-toolbar color=\"primary\"\u003e\n    \u003cion-title\u003e\n      Do scroll\n    \u003c/ion-title\u003e\n  \u003c/ion-toolbar\u003e\n\u003c/ion-header\u003e\n\n\u003cion-content #mycontent [scrollEvents]=\"true\"\u003e\n  ...long scrolling content...\n\u003c/ion-content\u003e\n```\n\n**Remember** to set `[scrollEvents]=\"true\"` on the ion-content component otherwise the directive will not work.\n\n### Tip\n\nAdd the `fullscreen` attribute to the `ion-content` element and add some css style to make a good effect\n\n```css\n.scroll-content {\n  padding-top: 0px !important;\n}\n```\n\n## Demo\n\n![Demo](./ion-header-scroll-opacity.gif \"Demo\")\n\n## Contribute\n\nAny pull-request and issues are wellcome\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoriphes%2Fion-header-scroll-opacity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoriphes%2Fion-header-scroll-opacity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoriphes%2Fion-header-scroll-opacity/lists"}