diff --git a/src/components/battery/battery-styles.ts b/src/components/battery/battery-styles.ts
index 75fadac..b94a4aa 100644
--- a/src/components/battery/battery-styles.ts
+++ b/src/components/battery/battery-styles.ts
@@ -18,8 +18,8 @@ export const sharedStyles: CSSResult = css`
#fafafa 20.46%,
#d5daf2 90.45%
);
- box-shadow: 0px 0.92vw 2.3vw rgba(0, 0, 0, 0.08);
- border-radius: 4.6vw;
+ box-shadow: 0px var(--shadow-one) var(--shadow-two) rgba(0, 0, 0, 0.08);
+ border-radius: var(--container-radius);
justify-content: space-between;
align-items: center;
overflow: hidden;
@@ -32,7 +32,6 @@ export const sharedStyles: CSSResult = css`
top: 0%;
bottom: 0%;
background: linear-gradient(152.36deg, #6be4d0 8.74%, #10a775 82.29%);
- border-radius: 4.6vw 0px 0px 4.6vw;
display: flex;
}
@@ -41,8 +40,7 @@ export const sharedStyles: CSSResult = css`
left: 12%;
font-style: normal;
font-weight: 400;
- font-size: 11.5vw;
- line-height: 15.18vw;
+ font-size: var(--number-size);
color: #ebc883;
}
@@ -50,8 +48,7 @@ export const sharedStyles: CSSResult = css`
position: absolute;
left: var(--percent-left);
font-weight: 400;
- font-size: 5.98vw;
- line-height: 5.98vw;
+ font-size: var(--percent-size);
color: #ebc883;
padding-block-start: 4.5%;
}
@@ -71,8 +68,8 @@ export const sharedStyles: CSSResult = css`
rgba(255, 255, 255, 0.5) 0%,
rgba(255, 255, 255, 0) 100%
);
- width: 5.52vw;
- height: 5.52vw;
+ width: var(--bubbles);
+ height: var(--bubbles);
border-radius: 50%;
opacity: 0.5;
animation: flying 10s ease-in infinite;
@@ -80,24 +77,24 @@ export const sharedStyles: CSSResult = css`
@keyframes flying {
0% {
- top: 90%;
+ bottom: -10%;
transform: translateX(0vw);
}
25% {
- transform: translateX(5.75vw);
+ transform: translateX(var(--first));
}
50% {
- transform: translateX(17.25vw);
+ transform: translateX(var(--second));
}
75% {
- transform: translateX(-5.75vw);
+ transform: translateX(var(--third));
}
88% {
- transform: translateX(-8.74vw);
+ transform: translateX(var(--forth));
}
100% {
- top: 0%;
- transform: translateX(-11.5vw);
+ bottom: 90%;
+ transform: translateX(var(--fifth));
}
}
@@ -106,8 +103,8 @@ export const sharedStyles: CSSResult = css`
animation-delay: 0s;
}
.bubbles:nth-child(2) {
- width: 4.14vw;
- height: 4.14vw;
+ width: var(--one);
+ height: var(--one);
left: 10%;
animation-duration: 8s;
animation-delay: 1s;
@@ -118,8 +115,8 @@ export const sharedStyles: CSSResult = css`
animation-delay: 2s;
}
.bubbles:nth-child(4) {
- width: 2.3vw;
- height: 2.3vw;
+ width: var(--two);
+ height: var(--two);
animation-duration: 6s;
animation-delay: 0s;
}
@@ -130,8 +127,8 @@ export const sharedStyles: CSSResult = css`
}
.bubbles:nth-child(6) {
left: 80%;
- width: 4.14vw;
- height: 4.14vw;
+ width: var(--one);
+ height: var(--one);
animation-duration: 6s;
animation-delay: 1s;
}
@@ -142,8 +139,8 @@ export const sharedStyles: CSSResult = css`
}
.bubbles:nth-child(8) {
right: 90%;
- width: 2.3vw;
- height: 2.3vw;
+ width: var(--two);
+ height: var(--two);
animation-duration: 9s;
animation-delay: 0s;
}
@@ -182,8 +179,8 @@ export const sharedStyles: CSSResult = css`
rgba(255, 255, 255, 0.5) 0%,
rgba(255, 255, 255, 0) 100%
);
- width: 5.52vw;
- height: 5.52vw;
+ width: var(--bubbles);
+ height: var(--bubbles);
border-radius: 50%;
opacity: 0.5;
animation: flying-vertical 10s ease-in infinite;
@@ -194,20 +191,20 @@ export const sharedStyles: CSSResult = css`
transform: translateY(0vw);
}
25% {
- transform: translateY(5.75vw);
+ transform: translateY(var(--first));
}
50% {
- transform: translateY(17.25vw);
+ transform: translateY(var(--second));
}
75% {
- transform: translateY(-5.75vw);
+ transform: translateY(var(--third));
}
88% {
- transform: translateY(-8.74vw);
+ transform: translateY(var(--forth));
}
100% {
left: 90%;
- transform: translateY(-11.5vw);
+ transform: translateY(var(--fifth));
}
}
@@ -216,8 +213,8 @@ export const sharedStyles: CSSResult = css`
animation-delay: 0s;
}
.bubbles_vertical:nth-child(2) {
- width: 4.14vw;
- height: 4.14vw;
+ width: var(--one);
+ height: var(--one);
top: 10%;
animation-duration: 8s;
animation-delay: 1s;
@@ -228,8 +225,8 @@ export const sharedStyles: CSSResult = css`
animation-delay: 2s;
}
.bubbles_vertical:nth-child(4) {
- width: 2.3vw;
- height: 2.3vw;
+ width: var(--two);
+ height: var(--two);
animation-duration: 6s;
animation-delay: 0s;
}
@@ -240,8 +237,8 @@ export const sharedStyles: CSSResult = css`
}
.bubbles_vertical:nth-child(6) {
top: 80%;
- width: 4.14vw;
- height: 4.14vw;
+ width: var(--one);
+ height: var(--one);
animation-duration: 6s;
animation-delay: 1s;
}
@@ -252,8 +249,8 @@ export const sharedStyles: CSSResult = css`
}
.bubbles_vertical:nth-child(8) {
bottom: 90%;
- width: 2.3vw;
- height: 2.3vw;
+ width: var(--two);
+ height: var(--two);
animation-duration: 9s;
animation-delay: 0s;
}
diff --git a/src/components/battery/battery.ts b/src/components/battery/battery.ts
index bf4d095..99fe8c5 100644
--- a/src/components/battery/battery.ts
+++ b/src/components/battery/battery.ts
@@ -1,6 +1,7 @@
import {html, LitElement, CSSResultArray} from 'lit'
import {customElement, property, query} from 'lit/decorators.js'
import {sharedStyles} from './battery-styles'
+import lightning from './svg/lightning.svg'
@customElement('star-battery')
export class StarBattery extends LitElement {
@@ -12,6 +13,8 @@ export class StarBattery extends LitElement {
@property({type: Boolean, reflect: true}) charge = false
+ @query('.container') _container: any
+
@query('.power') _power: any
@query('.percent') _percent: any
@@ -31,20 +34,18 @@ export class StarBattery extends LitElement {
if (newValue !== null) {
for (var i = 0; i < 20; i++) {
const bubbles = document.createElement('span')
- if (this.vertical == true) {
- bubbles.className = 'bubbles_vertical'
- this._power.append(bubbles)
- } else {
- bubbles.className = 'bubbles'
- this._power.append(bubbles)
- }
+ bubbles.className = 'bubbles'
+ this._container.append(bubbles)
}
} else {
- this._power.innerHTML = ''
+ this.shadowRoot
+ ?.querySelectorAll('.bubbles')
+ .forEach((span) => span.remove())
}
break
case 'percent':
if (newValue !== null) {
+ this.percent = newValue
this.style.setProperty('--power-right', 100 - this.percent + '%')
if (this.percent == 0) {
this.style.setProperty('--percent-left', '19.5%')
@@ -64,8 +65,29 @@ export class StarBattery extends LitElement {
}
}
- protected firstUpdated(): void {
- this.charge = true
+ protected resize() {
+ var width = this._container.clientWidth
+ this.style.setProperty('--number-size', width / 9 + 'px')
+ this.style.setProperty('--percent-size', width / 17.4 + 'px')
+ this.style.setProperty('--container-radius', width / 22.6 + 'px')
+ this.style.setProperty('--shadow-one', width / 113 + 'px')
+ this.style.setProperty('--shadow-two', width / 45.2 + 'px')
+ this.style.setProperty('--bubbles', width / 18.8 + 'px')
+ this.style.setProperty('--power-other', width / 18.8 + 'px')
+ this.style.setProperty('--one', width / 25 + 'px')
+ this.style.setProperty('--two', width / 45.2 + 'px')
+ this.style.setProperty('--first', width / 18.08 + 'px')
+ this.style.setProperty('--second', width / 6.03 + 'px')
+ this.style.setProperty('--third', -(width / 18.08) + 'px')
+ this.style.setProperty('--forth', -(width / 11.9) + 'px')
+ this.style.setProperty('--fifth', -(width / 9.04) + 'px')
+ }
+
+ protected firstUpdated() {
+ this.resize()
+ window.addEventListener('resize', () => {
+ this.resize()
+ })
}
render() {
@@ -75,7 +97,7 @@ export class StarBattery extends LitElement {
${Math.round(this.percent)}
%
-
+
`
diff --git a/src/components/battery/svg/lightning.svg b/src/components/battery/svg/lightning.svg
new file mode 100644
index 0000000..3502edc
--- /dev/null
+++ b/src/components/battery/svg/lightning.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/components/button/button.ts b/src/components/button/button.ts
index 6b145da..21a791d 100644
--- a/src/components/button/button.ts
+++ b/src/components/button/button.ts
@@ -40,6 +40,7 @@ export class StarButton extends StarBaseElement {
@property({type: String}) treatment = ''
@property({type: String}) icon = 'bug'
@property({type: String}) iconcolor = ''
+ @property({type: String}) fontsize = ''
getBaseButton(): HTMLTemplateResult {
return html`
@@ -59,9 +60,16 @@ export class StarButton extends StarBaseElement {
}
getIconOnlyButton(): HTMLTemplateResult {
- return html`
+ if(this.fontsize){
+ return html`
+
+ `
+ }else {
+ return html`
`
+ }
+
}
getConfirmButton(): HTMLTemplateResult {
diff --git a/src/components/digicipher/README.md b/src/components/digicipher/README.md
index c98032f..a9e8f11 100644
--- a/src/components/digicipher/README.md
+++ b/src/components/digicipher/README.md
@@ -14,14 +14,17 @@
```
```
-
-1. `saveMode` 属性代表存储模式,更改密码、确认密码后存储新密码
-
+2. `saveMode` 属性代表存储模式,更改密码、确认密码后存储新密码
```
```
-## 发送事件
+
+
+
+
+
+
解锁成功:`star-digicipher-unlocksuccess` **value:** `this.passwd`
解锁 5 次失败,跳转已锁定:`star-digicipher-locked` **value:** `false`
diff --git a/src/components/notification/notification.ts b/src/components/notification/notification.ts
index 747b31a..222e0a4 100644
--- a/src/components/notification/notification.ts
+++ b/src/components/notification/notification.ts
@@ -44,7 +44,7 @@ export class StarNotification extends LitElement {
// 仅more-notifiactions-first有
@property({type: String}) secondTitle = ''
@property({type: String}) secondText = ''
-
+ @property({type: Boolean}) isToast = false
@query('.notification') notification!: HTMLDivElement
@query('.btn-tool') btnTool!: HTMLDivElement
@query('.arrow-up') arrowUp!: HTMLDivElement
@@ -130,42 +130,75 @@ export class StarNotification extends LitElement {
this.notificationType == 'more-notifiactions'
? this.radiusType
: 'border-radius'
-
- return html`
-
-
-
-
-
${this.title}
-
- ${this.timestamp}
-
+ if (!this.isToast) {
+ return html`
+
+
+
+
+
${this.title}
+
+ ${this.timestamp}
+
+
+
+
${this.text}
+
+ ${arrowShow}
+
-
-
${this.text}
-
- ${arrowShow}
+
-
- `
+ `
+ }
}
getmorefirst(): HTMLTemplateResult | typeof nothing {
@@ -250,123 +283,92 @@ export class StarNotification extends LitElement {
@eventOptions({passive: false})
handleEvent(event: TouchEvent) {
- switch (event.type) {
- case 'touchstart':
- this.touchAction.start.clientX = event.touches[0].clientX
- this.btnTool.style.visibility = 'visiable'
- break
- case 'touchmove':
- event.preventDefault()
- let deleteBtn = this.btnTool.children[0] as HTMLElement
- let settingsBtn = this.btnTool.children[1] as HTMLElement
- this.touchAction.last.clientX = event.touches[0].clientX
- let touchPosX =
- this.touchAction.last.clientX - this.touchAction.start.clientX
- // if (Math.abs(touchPosX) > 266) {
- // touchPosX = 266;
- // }
-
- // this.notification.style.transform = 'translateX(' + touchPosX + 'px)';
- if (touchPosX < 0) {
- // if (Math.abs(touchPosX) > 18) {
- // (this.btnTool.children[1] as HTMLElement).style.visibility = "visible";
- // }
- // if (Math.abs(touchPosX) > 142) {
- // (this.btnTool.children[0] as HTMLElement).style.visibility = "visible";
+ if (!this.isToast) {
+ switch (event.type) {
+ case 'touchstart':
+ this.touchAction.start.clientX = event.touches[0].clientX
+ this.btnTool.style.visibility = 'visiable'
+ break
+ case 'touchmove':
+ event.preventDefault()
+ let deleteBtn = this.btnTool.children[0] as HTMLElement
+ let settingsBtn = this.btnTool.children[1] as HTMLElement
+ this.touchAction.last.clientX = event.touches[0].clientX
+ let touchPosX =
+ this.touchAction.last.clientX - this.touchAction.start.clientX
+ // if (Math.abs(touchPosX) > 266) {
+ // touchPosX = 266;
// }
- // if (Math.abs(touchPosX) > 222) {
- // (this.btnTool.children[1] as HTMLElement).style.opacity = "1";
- // (this.btnTool.children[0] as HTMLElement).style.opacity = "1";
- // }
- let translateX
- if (screen.width >= 900) {
- translateX = 266
- } else if (screen.width >= 600) {
- translateX = 133
- } else {
- translateX = 88
- }
- this.notification.style.transform =
- 'translateX(-' + translateX + 'px)'
- let self = this
- this.notification.addEventListener(
- 'transitionend',
- function tranEnd() {
- self.notification.removeEventListener('transitionend', tranEnd)
- deleteBtn.style.visibility = 'visible'
- settingsBtn.style.visibility = 'visible'
- deleteBtn.style.opacity = '1'
- settingsBtn.style.opacity = '1'
+ // this.notification.style.transform = 'translateX(' + touchPosX + 'px)';
+ if (touchPosX < 0) {
+ // if (Math.abs(touchPosX) > 18) {
+ // (this.btnTool.children[1] as HTMLElement).style.visibility = "visible";
+ // }
+ // if (Math.abs(touchPosX) > 142) {
+ // (this.btnTool.children[0] as HTMLElement).style.visibility = "visible";
+ // }
+
+ // if (Math.abs(touchPosX) > 222) {
+ // (this.btnTool.children[1] as HTMLElement).style.opacity = "1";
+ // (this.btnTool.children[0] as HTMLElement).style.opacity = "1";
+ // }
+ let translateX
+ if (screen.width >= 900) {
+ translateX = 266
+ } else if (screen.width >= 600) {
+ translateX = 133
+ } else {
+ translateX = 88
}
- )
- } else if (touchPosX > 0) {
- // if (touchPosX > 44) {
- // (this.btnTool.children[0] as any).style.opacity = 0.6;
- // }
-
- // if (touchPosX > 124) {
- // (this.btnTool.children[0] as any).style.visibility = "hidden";
- // }
-
- // if (touchPosX > 168) {
- // (this.btnTool.children[1] as any).style.opacity = 0.6;
- // }
-
- // if (touchPosX > 248) {
- // (this.btnTool.children[1] as any).style.visibility = "hidden";
- // }
- deleteBtn.style.visibility = 'hidden'
- settingsBtn.style.visibility = 'hidden'
- this.notification.style.transform = 'translateX(' + 0 + 'px)'
- }
- break
- case 'touchend':
- break
- case 'click':
- event.stopPropagation()
- let self = this
- let target = event.target as HTMLElement
- switch (target.dataset.icon) {
- case 'delete':
- target.setAttribute('clicked', 'true')
- target.addEventListener('transitionend', function tranEnd() {
- target.removeEventListener('transitionend', tranEnd)
- target.removeAttribute('clicked')
- self.dispatchEvent(
- new CustomEvent('notification-delete', {
- detail: {
- id: self.id,
- notification: self,
- },
- bubbles: true,
- composed: true,
- })
- )
- })
- break
- case 'settings':
- target.setAttribute('clicked', 'true')
- target.addEventListener('transitionend', function tranEnd() {
- target.removeEventListener('transitionend', tranEnd)
- target.removeAttribute('clicked')
- self.dispatchEvent(
- new CustomEvent('notification-settings-configure', {
- bubbles: true,
- composed: true,
- })
- )
- })
- break
- default:
- this.notification.setAttribute('clicked', 'true')
+ this.notification.style.transform =
+ 'translateX(-' + translateX + 'px)'
+ let self = this
this.notification.addEventListener(
'transitionend',
function tranEnd() {
self.notification.removeEventListener('transitionend', tranEnd)
- self.notification.removeAttribute('clicked')
+ deleteBtn.style.visibility = 'visible'
+ settingsBtn.style.visibility = 'visible'
+ deleteBtn.style.opacity = '1'
+ settingsBtn.style.opacity = '1'
+ }
+ )
+ } else if (touchPosX > 0) {
+ // if (touchPosX > 44) {
+ // (this.btnTool.children[0] as any).style.opacity = 0.6;
+ // }
+
+ // if (touchPosX > 124) {
+ // (this.btnTool.children[0] as any).style.visibility = "hidden";
+ // }
+
+ // if (touchPosX > 168) {
+ // (this.btnTool.children[1] as any).style.opacity = 0.6;
+ // }
+
+ // if (touchPosX > 248) {
+ // (this.btnTool.children[1] as any).style.visibility = "hidden";
+ // }
+ deleteBtn.style.visibility = 'hidden'
+ settingsBtn.style.visibility = 'hidden'
+ this.notification.style.transform = 'translateX(' + 0 + 'px)'
+ }
+ break
+ case 'touchend':
+ break
+ case 'click':
+ event.stopPropagation()
+ let self = this
+ let target = event.target as HTMLElement
+ switch (target.dataset.icon) {
+ case 'delete':
+ target.setAttribute('clicked', 'true')
+ target.addEventListener('transitionend', function tranEnd() {
+ target.removeEventListener('transitionend', tranEnd)
+ target.removeAttribute('clicked')
self.dispatchEvent(
- new CustomEvent('notification-click', {
+ new CustomEvent('notification-delete', {
detail: {
id: self.id,
notification: self,
@@ -375,11 +377,47 @@ export class StarNotification extends LitElement {
composed: true,
})
)
- }
- )
- break
- }
- break
+ })
+ break
+ case 'settings':
+ target.setAttribute('clicked', 'true')
+ target.addEventListener('transitionend', function tranEnd() {
+ target.removeEventListener('transitionend', tranEnd)
+ target.removeAttribute('clicked')
+ self.dispatchEvent(
+ new CustomEvent('notification-settings-configure', {
+ bubbles: true,
+ composed: true,
+ })
+ )
+ })
+ break
+ default:
+ this.notification.setAttribute('clicked', 'true')
+ this.notification.addEventListener(
+ 'transitionend',
+ function tranEnd() {
+ self.notification.removeEventListener(
+ 'transitionend',
+ tranEnd
+ )
+ self.notification.removeAttribute('clicked')
+ self.dispatchEvent(
+ new CustomEvent('notification-click', {
+ detail: {
+ id: self.id,
+ notification: self,
+ },
+ bubbles: true,
+ composed: true,
+ })
+ )
+ }
+ )
+ break
+ }
+ break
+ }
}
}
diff --git a/src/components/pattern-view/README.md b/src/components/pattern-view/README.md
index 9048422..6f89780 100644
--- a/src/components/pattern-view/README.md
+++ b/src/components/pattern-view/README.md
@@ -23,14 +23,20 @@
### 默认
-```
+```js
```
+### `saveMode` 属性代表存储模式,绘制图案、确认图案后存储新图案密码
+
+```js
+
+```
### 距离顶部的位置 `topDir` 默认`217.5px`
-```
+```js
```
+
diff --git a/src/components/pattern-view/pattern-view.ts b/src/components/pattern-view/pattern-view.ts
index 3446e03..bd926d5 100644
--- a/src/components/pattern-view/pattern-view.ts
+++ b/src/components/pattern-view/pattern-view.ts
@@ -1,4 +1,4 @@
-import {html, LitElement, css, PropertyValueMap} from 'lit'
+import {html, LitElement, css, CSSResultArray, PropertyValueMap} from 'lit'
import {customElement, property, query} from 'lit/decorators.js'
// import {sharedStyles} from './pattern-view-style'
@@ -13,6 +13,24 @@ export class StarPatternView extends LitElement {
canvas {
margin-top: var(--top-dir);
}
+ p {
+ position: absolute;
+ font-family: 'OPPOSans';
+ font-style: normal;
+ font-weight: 400;
+ color: #292929;
+ font-family: 'OPPOSans';
+ margin-top: 0;
+ color: #292929;
+ font-size: 20px;
+ height: 26.5px;
+ line-height: 26.5px;
+ width: 150px;
+ left: 50%;
+ top: 31%;
+ transform: translateX(-50%);
+ text-align: center;
+ }
`
// public static override get styles(): CSSResultArray {
// return [sharedStyles]
@@ -29,6 +47,8 @@ export class StarPatternView extends LitElement {
this.Draw()
}
}
+ @property({type: Boolean}) saveMode = false
+ @property({type: Boolean}) confirm = false
@property({type: Number}) top = 0
@property({type: Number}) R = 35
@property({type: Number}) X = 0
@@ -38,8 +58,11 @@ export class StarPatternView extends LitElement {
@property({type: Number}) OffsetX = document.body.offsetWidth / 3.5
@property({type: Number}) OffsetY = document.body.offsetWidth / 3.5
@property({type: Array}) circleArr: {X: number; Y: number}[] = []
- @property({type: Array}) pwdArr: number[] = []
- @property({type: Array}) passwdArr = [0, 1, 2, 5, 4, 3]
+ @property({type: Array}) passwd: number[] = []
+ @property({type: Array}) savewd: number[] = []
+ @property({type: Array}) passwdArr = []
+ @property({type: String}) mode = ''
+ @property({type: String}) changeText = ''
@property({type: String})
get topDir() {
return this._topDir
@@ -52,7 +75,7 @@ export class StarPatternView extends LitElement {
render() {
return html`
-
+
${this.changeText}