MobileAlert.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class='modal' :class='{ "is-active": isModalActive }'>
  3. <div class='modal-background'></div>
  4. <div class='modal-card'>
  5. <header class='modal-card-head'>
  6. <button class='delete' @click='toggleModal()'></button>
  7. </header>
  8. <section class='modal-card-body'>
  9. <h5>Musare doesn't work very well on mobile right now, we are working on this!</h5>
  10. </section>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import io from '../../io';
  16. export default {
  17. data() {
  18. return {
  19. isModalActive: false
  20. }
  21. },
  22. ready: function () {
  23. let _this = this;
  24. if (!localStorage.getItem('mobileOptimization')) {
  25. this.toggleModal();
  26. localStorage.setItem('mobileOptimization', true);
  27. }
  28. },
  29. methods: {
  30. toggleModal: function () {
  31. let _this = this;
  32. _this.isModalActive = !_this.isModalActive;
  33. if (_this.isModalActive) {
  34. setTimeout(() => {
  35. this.isModalActive = false;
  36. }, 4000);
  37. }
  38. }
  39. },
  40. events: {
  41. closeModal: function() {
  42. this.isModalActive = false;
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang='scss' scoped>
  48. @media (min-width: 735px) {
  49. .modal {
  50. display: none;
  51. }
  52. }
  53. .modal-card {
  54. margin: 0 20px !important;
  55. }
  56. .modal-card-head {
  57. border-bottom: none;
  58. background-color: ghostwhite;
  59. padding: 15px;
  60. }
  61. .delete {
  62. background: transparent;
  63. right: 0;
  64. position: absolute;
  65. &:hover { background: transparent; }
  66. &:before, &:after { background-color: #bbb; }
  67. }
  68. </style>