{"id":18614976,"url":"https://github.com/andrewjbateman/ionic-angular-parallax","last_synced_at":"2025-05-07T03:43:49.905Z","repository":{"id":52590780,"uuid":"308694299","full_name":"AndrewJBateman/ionic-angular-parallax","owner":"AndrewJBateman","description":":clipboard: Ionic app to display a parallax effect so scrolling makes an image move out of view slower than the actual content. Another great tutorial from Simon Grimm - see Readme for link","archived":false,"fork":false,"pushed_at":"2023-02-12T14:23:20.000Z","size":2660,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T03:43:40.923Z","etag":null,"topics":["angular","angular15","directives","dom-manipulation","html","ionic","parallax","scss-styles","simon-grimm-youtube","tutorial-code","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-30T17:05:13.000Z","updated_at":"2024-11-15T13:40:42.000Z","dependencies_parsed_at":"2024-11-07T03:41:09.289Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/ionic-angular-parallax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-parallax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-parallax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-parallax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-parallax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/ionic-angular-parallax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810272,"owners_count":21807759,"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":["angular","angular15","directives","dom-manipulation","html","ionic","parallax","scss-styles","simon-grimm-youtube","tutorial-code","typescript"],"created_at":"2024-11-07T03:27:40.508Z","updated_at":"2025-05-07T03:43:49.887Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","readme":"# :zap: Ionic Angular Parallax\n\n* Ionic app to display a parallax effect so scrolling makes an image move out of view slower than the actual content.\n* Another great tutorial from [Simon Grimm Youtube: 'Building an Ionic Parallax Image Effect'](https://www.youtube.com/watch?v=TsIVWQf1qNA\u0026t=62s).\n\n## :page_facing_up: Table of contents\n\n* [:zap: Ionic Angular Parallax](#zap-ionic-angular-parallax)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-do list](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* [Angular Attribute directive](https://angular.io/guide/attribute-directives) used to contain code to change the appearance of a DOM element.\n* [Ionic DomController](https://github.com/ionic-team/ionic-framework/blob/master/angular/src/providers/dom-controller.ts) used with Ion scroll event to read DOM header height and write DOM changes to transform image.\n\n## :camera: Screenshots\n\n![screenshot](./img/test.png)\n\n## :signal_strength: Technologies\n\n* [Ionic v6](https://ionicframework.com/)\n* [Ionic/angular v6](https://www.npmjs.com/package/@ionic/angular) Ionic Angular building blocks\n* [Angular v15](https://angular.io/)\n* [Ionic Native Splash Screen v5](@ionic-native/splash-screen) plugin to display and hide a splash screen during application launch. Not actually used yet here.\n\n## :floppy_disk: Setup\n\n* npm i to install dependencies\n* Type: 'ionic serve' to start the server on _localhost://8100\n\n## :computer: Code Examples\n\n* Extract from `parallax-header.directive.ts` component initialization [lifecycle hook](https://angular.io/guide/lifecycle-hooks) to get an element from the Home page by its class name.\n\n```typescript\nngOnInit() {\n    let content = this.element.nativeElement;\n    this.header = content.getElementsByClassName(\"parallax-image\")[0];\n\n    this.domCtrl.read(() =\u003e {\n      this.headerHeight = this.header.clientHeight;\n    });\n  }\n```\n\n## :cool: Features\n\n* Use of very compact code (not mine) to produce array list  `*ngFor=\"let i of [].constructor(30)\"` - see [:clap: Inspiration](#clap-inspiration) below\n* [Dom Controller read() and write() functions](https://github.com/ionic-team/ionic-framework/blob/master/angular/src/providers/dom-controller.ts) used so Ionic-Angular schedules read \u0026 write operations at the best time. On a related note: DOM updates are better done in batches using the Dom Controller - see [JOSH MORONY blog: Increasing Performance with Efficient DOM Writes in Ionic](https://www.joshmorony.com/increasing-performance-with-efficient-dom-writes-in-ionic-2/) for more on this.\n* Use of [webkitTransform translate3d function](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate3d) to manipulate the image to give the parallax effect.\n\n## :clipboard: Status \u0026 To-do list\n\n* Status: Working\n* To-do: Nothing\n\n## :clap: Inspiration\n\n* [Simon Grimm Youtube: 'Building an Ionic Parallax Image Effect'](https://www.youtube.com/watch?v=TsIVWQf1qNA\u0026t=62s)\n* [Ionic Academy: Building an Ionic Parallax Image Effect [v5]](https://ionicacademy.com/ionic-parallax-image/)\n* [Stackoverflow: 'Angular 2 - NgFor using numbers instead collections'](https://stackoverflow.com/questions/36354325/angular-2-ngfor-using-numbers-instead-collections)\n* [JOSH MORONY blog: Increasing Performance with Efficient DOM Writes in Ionic](https://www.joshmorony.com/increasing-performance-with-efficient-dom-writes-in-ionic-2/)\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-angular-parallax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fionic-angular-parallax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-angular-parallax/lists"}