Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 2.62 KB

README.md

File metadata and controls

81 lines (56 loc) · 2.62 KB

⚡ 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