Skip to content

AndrewJBateman/ionic-angular-btmdrawer

Repository files navigation

⚡ Ionic Angular Audio Reproduction

📄 Table of contents

📚 General info

  • Ion-button and gestures used to open or close a drawer with text

📷 Screenshots

screenshot

📶 Technologies

💾 Setup

  • npm i
  • ionic serve to start the server on localhost://8100

💻 Code Examples

  • extract from drawer.component.ts to gently open or close the drawer when HTML button is toggled
// Function activated by html button to open drawer if closed and vice-versa
 // ViewChild 'drawer' used with the read: ElementRef metadata property above
 toggleDrawer() {
  const drawer = this.drawer.nativeElement;
  this.openState.emit(!this.isOpen);

  if (this.isOpen) {
   drawer.style.transition = '.4s ease-out';
   drawer.style.transform = '';
   this.isOpen = false;
  } else {
   drawer.style.transition = '.4s ease-in';
   drawer.style.transform = `translateY(${-this.openHeight}px)`;
   this.isOpen = true;
  }
 }

🆒 Features

  • SCSS makes drawer open and close gently

📋 Status & To-do list

  • Status: Working.
  • To-do: Button text can be linked to drawer status so it says 'open drawer' when drawer closed and 'close drawer' when drawer open. Other scss effects could be added to make the drawer opening/closing more fun.

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact

  • Repo created by ABateman, email: gomezbateman@gmail.com

About

📋 Ionic Angular app to display a sliding drawer pulled from the bottom of the screen using gestures

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published