Authored by 郭成尧

modal

@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
9 -  
10 const $ = require('yoho-jquery'); 9 const $ = require('yoho-jquery');
11 const template = require('components/modal.hbs'); 10 const template = require('components/modal.hbs');
12 const Overlay = require('./overlay'); 11 const Overlay = require('./overlay');
  1 +@import "vue-overlay";
  2 +
  3 +.modal {
  4 + position: fixed;
  5 + margin: 0 auto;
  6 + background: #fcfcfc;
  7 + width: 512px;
  8 + z-index: 1001;
  9 + left: 50%;
  10 + top: 50%;
  11 + transform: translate(-50%, -50%);
  12 +
  13 + h2 {
  14 + font-size: 36px;
  15 + text-align: center;
  16 + margin-top: 48px;
  17 + margin-bottom: 0;
  18 + }
  19 +
  20 + p {
  21 + font-size: 30px;
  22 + text-align: center;
  23 + margin: 20px 40px 48px;
  24 + }
  25 +
  26 + hr {
  27 + border: none;
  28 + border-top: 1px solid #e0e0e0;
  29 + margin: 0;
  30 + }
  31 +
  32 + .button-group {
  33 + justify-content: space-around;
  34 + align-items: stretch;
  35 + height: 88px;
  36 + text-align: center;
  37 +
  38 + a.modal-button {
  39 + width: 49%;
  40 + height: 100%;
  41 + display: inline-block;
  42 + text-align: center;
  43 + color: #b0b0b0;
  44 + font-size: 30px;
  45 + line-height: 88px;
  46 + font-weight: bold;
  47 + }
  48 +
  49 + a.modal-button:last-of-type {
  50 + color: #4a90e2;
  51 + }
  52 +
  53 + :not(:first-child) {
  54 + border-left: 1px solid #e0e0e0;
  55 + }
  56 + }
  57 +}
  58 +
  59 +.animation-target {
  60 + animation: animation 1000ms linear both;
  61 +}
  62 +
  63 +/* stylelint-disable */
  64 +
  65 +/* Generated with Bounce.js. Edit at http://goo.gl/W7f9he */
  66 +@keyframes animation {
  67 + 0% {
  68 + transform: translate(-50%, -50%) matrix3d(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  69 + }
  70 +
  71 + 4.3% {
  72 + transform: translate(-50%, -50%) matrix3d(0.757, 0, 0, 0, 0, 0.757, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  73 + }
  74 +
  75 + 8.61% {
  76 + transform: translate(-50%, -50%) matrix3d(0.939, 0, 0, 0, 0, 0.939, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  77 + }
  78 +
  79 + 12.91% {
  80 + transform: translate(-50%, -50%) matrix3d(1.026, 0, 0, 0, 0, 1.026, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  81 + }
  82 +
  83 + 17.22% {
  84 + transform: translate(-50%, -50%) matrix3d(1.047, 0, 0, 0, 0, 1.047, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  85 + }
  86 +
  87 + 28.33% {
  88 + transform: translate(-50%, -50%) matrix3d(1.01, 0, 0, 0, 0, 1.01, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  89 + }
  90 +
  91 + 39.44% {
  92 + transform: translate(-50%, -50%) matrix3d(0.997, 0, 0, 0, 0, 0.997, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  93 + }
  94 +
  95 + 61.66% {
  96 + transform: translate(-50%, -50%) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  97 + }
  98 +
  99 + 83.98% {
  100 + transform: translate(-50%, -50%) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  101 + }
  102 +
  103 + 100% {
  104 + transform: translate(-50%, -50%) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  105 + }
  106 +}
  107 +
  108 +/* stylelint-enable */
  1 +.overlay {
  2 + position: fixed;
  3 + background: #000;
  4 + opacity: 0;
  5 + left: 0;
  6 + top: 0;
  7 + width: 100%;
  8 + height: 100%;
  9 + z-index: 1000;
  10 +}
  11 +
  12 +.overlay-fade-in {
  13 + opacity: 0.5;
  14 + transition: opacity 0.1s linear;
  15 +}
  16 +
  17 +.overlay-fade-out {
  18 + opacity: 0;
  19 + transition: opacity 0.1s linear;
  20 +}
  21 +
  22 +.overlay-in {
  23 + opacity: 0.5;
  24 + transition: opacity 0.1s linear;
  25 +}
  26 +
  27 +.overlay-out {
  28 + opacity: 0;
  29 + transition: opacity 0.1s linear;
  30 +}
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 'use strict'; 54 'use strict';
55 const $ = require('yoho-jquery'); 55 const $ = require('yoho-jquery');
56 const tip = require('plugin/tip'); 56 const tip = require('plugin/tip');
57 - const Modal = require('plugin/modal'); 57 + const Modal = require('plugin/modal2');
58 58
59 module.exports = { 59 module.exports = {
60 data() { 60 data() {
@@ -136,6 +136,8 @@ @@ -136,6 +136,8 @@
136 }; 136 };
137 </script> 137 </script>
138 <style> 138 <style>
  139 + @import "common/vue-modal.css";
  140 +
139 $black: #000; 141 $black: #000;
140 $white: #fff; 142 $white: #fff;
141 143