From bbbe22c48d665a149620f54be80c594852f098c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 3 Sep 2019 21:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E9=87=8D=E6=9E=84layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/layer/{next.wc => core.wc} | 367 ++++++++--------- src/layer/index.js | 696 +-------------------------------- 3 files changed, 166 insertions(+), 899 deletions(-) rename src/layer/{next.wc => core.wc} (66%) diff --git a/package.json b/package.json index d8be235..024a476 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "license": "MIT", "dependencies": {}, "devDependencies": { - "anot": "^2.0.0", + "anot": "^2.1.1", "chalk": "^2.4.2", "chokidar": "^1.7.0", "es.shim": "^1.1.2", diff --git a/src/layer/next.wc b/src/layer/core.wc similarity index 66% rename from src/layer/next.wc rename to src/layer/core.wc index 880ea2b..7b9063e 100644 --- a/src/layer/next.wc +++ b/src/layer/core.wc @@ -33,11 +33,10 @@ color: #666; font-size: 14px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); - // opacity: 0; + transition: opacity 0.2s ease-in-out, left 0.2s ease-in-out, + right 0.2s ease-in-out, top 0.2s ease-in-out, bottom 0.2s ease-in-out; + opacity: 0; - &.shift { - transition: all 0.5s ease-out; - } &.scale { transform: scale(1.01); transition: transform 0.1s linear; @@ -84,6 +83,31 @@ padding: 0; border: 0; resize: none; + background: #fff; + } + + ::slotted(&__toast) { + display: flex; + align-items: center; + width: 300px; + padding: 0 10px !important; + border-radius: 4px; + } + + ::slotted(&__toast.style-info) { + border: 1px solid nth($cp, 3); + background: nth($cp, 2); + color: nth($cgr, 3); + } + ::slotted(&__toast.style-warn) { + border: 1px solid #faebb4; + background: #fffbed; + color: nth($co, 3); + } + ::slotted(&__toast.style-error) { + border: 1px solid #f5c4c4; + background: #fef0f0; + color: nth($cr, 1); } } @@ -148,13 +172,6 @@ height: 100%; background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(5px); - - &.shift { - transition: all 0.5s ease-out; - } - &.inner { - position: absolute; - } } :host([type='alert']), @@ -170,6 +187,15 @@ } } } +:host([type='toast']) { + .layer { + box-shadow: none; + + &__content { + min-height: 40px; + } + } +}