Hello,
I am using ionic to deploy a website and an app using the same base code. Is there a way to have a splashscreen working on the website version ?
During the module loading my page stay blank where I would like to display something like “Loading modules” so the website doesn’t look broken for the first few seconds.
Thanks.
Sujan12
November 15, 2017, 11:52am
2
You might want to look into modifying your index.html to do this.
pwespi
November 15, 2017, 12:33pm
3
As @Sujan12 said, you can put your custom loading content inside <ion-app></ion-app> in index.html.
For example:
<ion-app>
<style>
.loading {
width: 80px;
height: 80px;
margin: 200px auto;
background-color: #333;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
}
@-webkit-keyframes sk-scaleout {
0% {
-webkit-transform: scale(0)
}
100% {
-webkit-transform: scale(1.0);
opacity: 0;
}
}
@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
}
100% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
opacity: 0;
}
}
</style>
<div class="loading"></div>
</ion-app>
Or for an example of an animated svg, see:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic Twitter PWA</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4e8ef7">
<!--<link href="build/main.css" rel="stylesheet">-->
<link href="build/main.css" rel="preload" as="style">
<link href="build/polyfills.js" rel="preload" as="script">
<link href="build/vendor.js" rel="preload" as="script">
<link href="build/main.js" rel="preload" as="script">
</head>
This file has been truncated. show original
Thanks for the solution. I need to put it just before < ion-app > and it works well.