All Projects β†’ koddr β†’ A2hs.js

koddr / A2hs.js

Licence: mit
πŸ“² A useful modern JavaScript solution that helps your website users to add (install) a progressive web application (PWA) to the Home Screen of their mobile iOS devices.

Programming Languages

javascript
184084 projects - #8 most used programming language
js
455 projects

Projects that are alternatives of or similar to A2hs.js

Sort Visualizer
This is a web app built to visualize classic sorting algorithms such as insertion sort, merge sort, quick sort, heap sort, etc. The entire app is built with only React; no other third-party JS or CSS library has been used.
Stars: ✭ 41 (-63.72%)
Mutual labels:  pwa, css3, progressive-web-app
Demo Progressive Web App
πŸŽ‰ A demo for progressive web application with features like offline, push notifications, background sync etc,
Stars: ✭ 798 (+606.19%)
Mutual labels:  pwa, css3, progressive-web-app
Opennote
OpenNote was built to be an open web-based alternative to Microsoft OneNote (T) and EverNote.
Stars: ✭ 1,489 (+1217.7%)
Mutual labels:  pwa, progressive-web-app
Ionic Pwa
πŸš€ Build a Progressive Web App with Ionic and Angular. Push Notifications. Deployed to Firebase Hosting. The Complete guide to build your PWA. Service Workers. Lighthouse. Web Manifest
Stars: ✭ 87 (-23.01%)
Mutual labels:  pwa, progressive-web-app
Meteor Apollo Starter Kit
Meteor, Apollo, React, PWA, Styled-Components boilerplate
Stars: ✭ 91 (-19.47%)
Mutual labels:  pwa, progressive-web-app
Device
Light weight tool for detecting the current device and screen size written in swift.
Stars: ✭ 1,503 (+1230.09%)
Mutual labels:  iphone, ipad
Jotify
Sticky notes reimagined - written in Swift
Stars: ✭ 79 (-30.09%)
Mutual labels:  iphone, ipad
Stencil
A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
Stars: ✭ 9,880 (+8643.36%)
Mutual labels:  pwa, progressive-web-app
Gmimagepicker.xamarin
Port of the original GMImagePicker component to Xamarin.iOS
Stars: ✭ 65 (-42.48%)
Mutual labels:  iphone, ipad
Pwa Asset Generator
Automates PWA asset generation and image declaration. Automatically generates icon and splash screen images, favicons and mstile images. Updates manifest.json and index.html files with the generated images according to Web App Manifest specs and Apple Human Interface guidelines.
Stars: ✭ 1,787 (+1481.42%)
Mutual labels:  pwa, progressive-web-app
Vue Pwa Asset Generator
PWA asset generator perfect with VueJS framework (but useful for all PWA!)
Stars: ✭ 97 (-14.16%)
Mutual labels:  pwa, progressive-web-app
Canijailbreak.com
a website which tells you whether you can jailbreak your iOS device.
Stars: ✭ 112 (-0.88%)
Mutual labels:  iphone, ipad
Pwa Badge
Badging for PWA app icons, Like Native Apps
Stars: ✭ 78 (-30.97%)
Mutual labels:  pwa, progressive-web-app
Beer
The source code for the Progressive Beer app!
Stars: ✭ 73 (-35.4%)
Mutual labels:  pwa, progressive-web-app
Pwa Boilerplate
✨ PWA Boilerplate is highly scalable and is designed to help you kick-start your next project πŸ”­.
Stars: ✭ 82 (-27.43%)
Mutual labels:  pwa, progressive-web-app
The forge
Our groundbreaking, lightning fast PWA CLI tool
Stars: ✭ 70 (-38.05%)
Mutual labels:  pwa, progressive-web-app
Colors App
🎨 A PWA for copying values from popular color palettes. Supports HEX, RGB, and HSL formats.
Stars: ✭ 90 (-20.35%)
Mutual labels:  pwa, progressive-web-app
Ionic Stencil Hn App
Ionic Stencil HackerNews App
Stars: ✭ 105 (-7.08%)
Mutual labels:  pwa, progressive-web-app
React Adventure
β›° React high-ending architecture & patterns ready for use. Made for big and small projects. PWA Ready.
Stars: ✭ 62 (-45.13%)
Mutual labels:  pwa, progressive-web-app
Deckdeckgo
The web open source editor for presentations
Stars: ✭ 1,117 (+888.5%)
Mutual labels:  pwa, progressive-web-app

πŸ“² a2hs.js

Add progressive web application (PWA) to Home Screen on iOS

iPhone X mockup a2hs.js

npm version bundle size code style: prettier license twit link

A useful modern JavaScript solution that helps your website users to add (install) a progressive web application (PWA) to the Home Screen of their mobile iOS devices. Designed for the latest 4 major versions of iOS Safari 9.x-12.2+.

The Why?

As you probably know, iOS Safari doesn't have a built-in pop-up window with a suggestion to install a progressive web app on an iPhone/iPad (like Google Chrome). The a2hs.js project easily solves this problem!

Also, it's lightweight, production-ready, zero-configuration, has no dependencies and perfectly works with all of popular JavaScript frontend frameworks.

Install

[email protected]:~$ npm install --save a2hs.js

Usage

/**
 * Import a2hs.js
 */
import AddToHomeScreen from "a2hs.js";

/**
 * Simple (with default config) init
 */
AddToHomeScreen();

/**
 * Advanced (with your config) init
 */
AddToHomeScreen({
  brandName: "Demo",
  fontFamily: "Tahoma, sans-serif",
  backgroundColor: "red",
  color: "white",
  // ... see full list of config options below
});

Config

config example

~ Description Default
backgroundColor Background color for container #f9f9f9
padding Padding for container 10px
shadowColor Shadow color for top of container #e9e9e9
shadowSize Shadow size for top of container 10px
fontFamily Font family for content in container -apple-system, sans-serif
color Font color for content in container #5d5d5d
fontSize Font size for content in container 0.9rem
brandName Brand for default htmlContent ""
logoImage Logo for container inline SVG
htmlContent Content for container with HTML Install <strong>{{brandName}} web app</strong> on your iOS device: tap share and <strong>Add to Home Screen</strong> ↓

Demo

demo

PWA logo

The content container, by default, attached to bottom of iOS device screen (used CSS property position: fixed). The container will not be displayed:

  • If user opened website, as a progressive web app (PWA);
  • If user clicked once on content container (used localStorage for save state);

Demo on localhost

[email protected]:~$ git clone https://github.com/koddr/a2hs.js.git && cd a2hs.js
[email protected]:a2hs.js$ npm install
[email protected]:a2hs.js$ npm start

  Server running at http://localhost:1234 
  ✨  Built in 18ms.

πŸ–₯ Desktop Google Chrome:

  1. Then, go to Developer Tools on opened page http://localhost:1234;
  2. Switch to Device toolbar and choose iPhone in Emulated Devices select;
  3. β†Ί Refresh page;

Live demo

Go to private mode on your iOS Safari and open True web artisans website.

Animation

/**
 * Add slide animation when loading a2hs.js container:
 * slideUp, slideDown, slideLeft, slideRight
 *
 * Params: 
 *  animation speed (example: 0.7s)
 */

.a2hs__container {
  animation: slideUp 0.7s ease;
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(240px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-240px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeft {
  0% {
    opacity: 0;
    transform: translateX(240px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  0% {
    opacity: 0;
    transform: translateX(-240px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

Size limit report

[email protected]:~$ npm run size

  ✨ Built in 234ms.

  dist/index.js.map    5.68 KB     5ms
  dist/index.js        3.72 KB    13ms

  Time limit:   50 ms
  Package size: 1.29 KB with all dependencies, minified and gzipped
  Loading time: 26 ms   on slow 3G
  Running time: 21 ms   on Snapdragon 410
  Total time:   47 ms

Thanks to Andrey Sitnik @ai/size-limit.

Developers

Project assistance

If you want to say Β«thank youΒ» or/and support active development a2hs.js:

  1. Add a GitHub Star to project.
  2. Twit about project on your Twitter.
  3. Donate some money to project author via PayPal: @paypal.me/koddr.
  4. Join DigitalOcean at our referral link (your profit is $100 and we get $25).

Thanks for your support! 😘 Together, we make this project better every day.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].