diff --git a/demos/loading/index.ts b/demos/loading/index.ts new file mode 100644 index 0000000000..c6cb025a93 --- /dev/null +++ b/demos/loading/index.ts @@ -0,0 +1,125 @@ +import {App, Page, ActionSheet, Loading, NavController, ViewController, Platform} from 'ionic-angular'; + + +@Page({ + templateUrl: 'main.html' +}) +class E2EPage { + constructor(private nav: NavController, private platform: Platform) {} + + presentLoadingIos() { + let loading = Loading.create({ + spinner: 'ios', + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingDots() { + let loading = Loading.create({ + spinner: 'dots', + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingBubbles() { + let loading = Loading.create({ + spinner: 'bubbles', + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingCircles() { + let loading = Loading.create({ + spinner: 'circles', + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingCrescent() { + let loading = Loading.create({ + spinner: 'crescent', + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingDefault() { + let loading = Loading.create({ + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingCustom() { + let loading = Loading.create({ + spinner: 'hide', + content: ` +
+
+
+
This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.
`, + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + presentLoadingText() { + let loading = Loading.create({ + spinner: 'hide', + content: 'This will dismiss after 5 seconds, or you can click the backdrop to dismiss it now.', + enableBackdropDismiss: true, + duration: 5000 + }); + + this.nav.present(loading); + } + + goToPage2() { + this.nav.push(Page2); + } +} + +@Page({ + template: ` + + Page 2 + + Some content + ` +}) +class Page2 { + constructor(private nav: NavController, private platform: Platform) {} +} + +@App({ + template: '' +}) +class E2EApp { + root = E2EPage; +} + +document.body.innerHTML += '' diff --git a/demos/loading/main.html b/demos/loading/main.html new file mode 100644 index 0000000000..1292080be4 --- /dev/null +++ b/demos/loading/main.html @@ -0,0 +1,23 @@ + + Loading + + + + + + + + + + + + + + + + + + diff --git a/demos/loading/styles.css b/demos/loading/styles.css new file mode 100644 index 0000000000..48888095ba --- /dev/null +++ b/demos/loading/styles.css @@ -0,0 +1,59 @@ +.custom-spinner-container { + position: relative; + display: inline-block; + box-sizing: border-box; + width: 100%; + margin-bottom: 20px; +} + +.custom-spinner-box { + margin: 0 auto; + position: relative; + box-sizing: border-box; + border: 4px solid #000; + width: 60px; + height: 60px; + animation: spin 3s infinite linear; +} + +.custom-spinner-box:before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + box-sizing: border-box; + border: 4px solid #000; + width: 40px; + height: 40px; + animation: pulse 1.5s infinite ease; +} + +.wp .custom-spinner-box, +.wp .custom-spinner-box:before { + border-color: #fff; +} + +@-webkit-keyframes pulse { + 50% { + border-width: 20px; + } +} +@keyframes pulse { + 50% { + border-width: 20px; + } +} + +@-webkit-keyframes spin { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes spin { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +}