WIP modal test.

This commit is contained in:
bmauger 2022-05-20 09:19:04 -04:00
parent 719053c550
commit 5ee8d71252
2 changed files with 99 additions and 69 deletions

View file

@ -1,91 +1,115 @@
<template> <template>
<div v-if="isModalVisible" class="loading-modal-backdrop"> <div class="container modal-loader vh-100">
<div class="loading-modal"> <div class="row h-100 d-flex align-items-center">
<section class="loading-modal-body"> <div class="container-fluid">
<div class="modal-icon-container text-center"> <div class="row h-100">
<object type="image/svg+xml" :data="fmgAnimatedTransition"/> <div class="col text-center tagbg">
<div class="spinner-border text-danger" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div> </div>
</section> <div class="row">
<div class="col">
<p class="m-0 fs-5 d-flex position-absolute justify-content-center" id="text-1">
Assessing your damage...
</p>
<p class="m-0 fs-5 d-flex position-absolute justify-content-center" id="text-2">
Finding your glass...
</p>
<p class="m-0 fs-5 d-flex position-absolute justify-content-center" id="text-3">
Generating your quote...
</p>
<p class="m-0 fs-5 d-flex position-absolute justify-content-center" id="text-4">
Seriously... don't go...
</p>
</div>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
// load the path like this - <object> data attribute doesn't load the relative path correctly export default {
const FMGAnimatedTransition = require("@/assets/img/FMGTransitionAnimation.svg"); name: 'Modal',
export default { methods: {
name: 'Modal', showModal() {
data() { //Display modal
return { this.isModalVisible = true;
isModalVisible: false, //Force page reload on back button
fmgAnimatedTransition: FMGAnimatedTransition, window.addEventListener("pageshow", function(evt) {
}; if(evt.persisted){
},
methods: {
showModal() {
//Display modal
this.isModalVisible = true;
//Force page reload on back button
window.addEventListener("pageshow", function(evt) {
if(evt.persisted){
setTimeout(function(){ setTimeout(function(){
window.location.reload(); window.location.reload();
}, 10); }, 10);
} }
}, false); }, false);
},
}, },
}; },
};
</script> </script>
<style lang="scss"> <style lang="scss">
.loading-modal-backdrop { .modal-loader {
position: fixed; p {
top: 0; font-family: Roboto;
bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
background-color: #e5e5e5;
display: flex;
justify-content: center;
align-items: center;
z-index: 1050;
width: 100vw;
height: 100vh;
} }
.loading-modal { .tagbg {
position: absolute; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 32'%3e%3cpath d='M22.39 27.313a3.53 3.53 0 0 0 7.058 0' fill='%23fff'/%3e%3cpath d='M22.39 27.313a3.53 3.53 0 0 0 7.058 0' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M54.459 27.313a3.527 3.527 0 0 0 7.054 0' fill='%23fff'/%3e%3cpath d='M54.459 27.313a3.527 3.527 0 0 0 7.054 0' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M42.06.8c8.08 0 11.89.935 11.89.935 3.58.576 5.696 7.207 5.696 7.207h.727c0-2.427 1.302-2.397 2.341-2 .723.292 1.363.76 1.86 1.361 1.319 1.547.465 1.674.465 1.674h-5.067l3.846 3.01v12.016c0 2.41-2.029 2.31-2.029 2.31H22.338s-2.029.1-2.029-2.31V12.996l3.84-3.009H19.07s-.853-.127.466-1.674a4.693 4.693 0 0 1 1.86-1.361c1.032-.397 2.341-.427 2.341 2h.736s2.117-6.64 5.696-7.21c0 0 3.81-.942 11.89-.942Z' fill='%23fff' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M42.06 8.847c7.924 0 14.685.511 14.685.511 0-2.585-2.38-6.011-2.38-6.011S50.4 2.519 42.06 2.519s-12.303.828-12.303.828-2.38 3.426-2.38 6.011c0 0 6.76-.51 14.683-.51Z' fill='%23DA291C' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M35.277 16.523a62.558 62.558 0 0 1 13.277 0m3.276-.439s2.384-2.257 8.608-2.257c0 0 1.179 2.657-2.54 3.37m-25.894-1.113s-2.387-2.257-8.611-2.257c0 0-1.16 2.579 2.543 3.37m-3.546 5.856s21.52 3.647 39.123 0' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
background: #ffffff; background-repeat: no-repeat;
padding: 0 0 32px 0; background-position: center center;
box-shadow: 2px 2px 20px 1px; background-size: 96px;
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
border-radius: 4px;
top: 48px;
height: 186px;
width: 327px;
} }
.loading-modal-text { .spinner-border {
padding: 0 24px 0 24px; width: 6rem;
height: 6rem;
border: 0.35em solid currentColor;
border-right-color: transparent;
} }
.modal-icon-container { #text-1 {
margin: 15px auto; animation: 3s ease-in-out 5s normal forwards 1 fade1;
padding-bottom: 26px; }
#text-2 {
opacity: 0;
animation: 6s ease-in-out 7s normal forwards 1 fade2;
}
#text-3 {
opacity: 0;
animation: 6s ease-in-out 12s normal forwards 1 fade3;
}
#text-4 {
opacity: 0;
animation: 3s ease-in-out 17s normal forwards 1 fade4;
} }
.modal-icon-container img { @keyframes fade1 {
position: absolute; 0% { opacity:1; }
vertical-align: middle; 100% { opacity:0; }
border: 0;
width: 327px;
height: 186px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
} }
@keyframes fade2 {
0% { opacity:0; }
33% { opacity:1; }
66% { opacity:1; }
100% { opacity:0; }
}
@keyframes fade3 {
0% { opacity:0; }
33% { opacity:1; }
66% { opacity:1; }
100% { opacity:0; }
}
@keyframes fade4 {
0% { opacity:0; }
100% { opacity:1; }
}
}
</style> </style>

View file

@ -21,6 +21,7 @@ import analyticsMixin from "@/mixins/analytics-mixin";
// Components // Components
import ComponentTest from "@/layouts/component-test/component-test.vue"; import ComponentTest from "@/layouts/component-test/component-test.vue";
import FormTest from "@/layouts/form-test/form-test.vue"; import FormTest from "@/layouts/form-test/form-test.vue";
import Modal from "@/common-components/loading-modal/loading-modal.vue";
const routes = [ const routes = [
@ -34,6 +35,11 @@ const routes = [
name: "FormTest", name: "FormTest",
component: FormTest, component: FormTest,
}, },
{
path: "/loading-modal", // This is a temporary route for testing.
name: "Modal",
component: Modal,
},
{ {
path: "/", path: "/",
name: "root", name: "root",