TASK: #120449 lockscreen样式调整

This commit is contained in:
duanzhijiang 2022-11-16 18:54:27 +08:00
parent e0a1a12fb5
commit 29b0b0859b
4 changed files with 21 additions and 15 deletions

View File

@ -48,6 +48,7 @@ export const autoPxStyle: CSSResult = css`
--auto-76px: calc(76px / var(--hostDevicePixelRatio)); --auto-76px: calc(76px / var(--hostDevicePixelRatio));
--auto-80px: calc(80px / var(--hostDevicePixelRatio)); --auto-80px: calc(80px / var(--hostDevicePixelRatio));
--auto-82px: calc(80px / var(--hostDevicePixelRatio)); --auto-82px: calc(80px / var(--hostDevicePixelRatio));
--auto-70px: calc(70px / var(--hostDevicePixelRatio));
--auto-72px: calc(72px / var(--hostDevicePixelRatio)); --auto-72px: calc(72px / var(--hostDevicePixelRatio));
--auto-76px: calc(76px / var(--hostDevicePixelRatio)); --auto-76px: calc(76px / var(--hostDevicePixelRatio));
--auto-80px: calc(80px / var(--hostDevicePixelRatio)); --auto-80px: calc(80px / var(--hostDevicePixelRatio));
@ -59,6 +60,7 @@ export const autoPxStyle: CSSResult = css`
--auto-116px: calc(116px / var(--hostDevicePixelRatio)); --auto-116px: calc(116px / var(--hostDevicePixelRatio));
--auto-128px: calc(128px / var(--hostDevicePixelRatio)); --auto-128px: calc(128px / var(--hostDevicePixelRatio));
--auto-129px: calc(129px / var(--hostDevicePixelRatio)); --auto-129px: calc(129px / var(--hostDevicePixelRatio));
--auto-140px: calc(140px / var(--hostDevicePixelRatio));
--auto-152px: calc(152px / var(--hostDevicePixelRatio)); --auto-152px: calc(152px / var(--hostDevicePixelRatio));
--auto-160px: calc(160px / var(--hostDevicePixelRatio)); --auto-160px: calc(160px / var(--hostDevicePixelRatio));
--auto-166px: calc(166px / var(--hostDevicePixelRatio)); --auto-166px: calc(166px / var(--hostDevicePixelRatio));
@ -82,6 +84,7 @@ export const autoPxStyle: CSSResult = css`
--auto-370px: calc(370px / var(--hostDevicePixelRatio)); --auto-370px: calc(370px / var(--hostDevicePixelRatio));
--auto-388px: calc(388px / var(--hostDevicePixelRatio)); --auto-388px: calc(388px / var(--hostDevicePixelRatio));
--auto-396px: calc(396px / var(--hostDevicePixelRatio)); --auto-396px: calc(396px / var(--hostDevicePixelRatio));
--auto-411px: calc(411px / var(--hostDevicePixelRatio));
--auto-418px: calc(418px / var(--hostDevicePixelRatio)); --auto-418px: calc(418px / var(--hostDevicePixelRatio));
--auto-436px: calc(436px / var(--hostDevicePixelRatio)); --auto-436px: calc(436px / var(--hostDevicePixelRatio));
--auto-440px: calc(440px / var(--hostDevicePixelRatio)); --auto-440px: calc(440px / var(--hostDevicePixelRatio));
@ -92,8 +95,10 @@ export const autoPxStyle: CSSResult = css`
--auto-520px: calc(520px / var(--hostDevicePixelRatio)); --auto-520px: calc(520px / var(--hostDevicePixelRatio));
--auto-524px: calc(520px / var(--hostDevicePixelRatio)); --auto-524px: calc(520px / var(--hostDevicePixelRatio));
--auto-534px: calc(534px / var(--hostDevicePixelRatio)); --auto-534px: calc(534px / var(--hostDevicePixelRatio));
--auto-543px: calc(543px / var(--hostDevicePixelRatio));
--auto-607px: calc(607px / var(--hostDevicePixelRatio)); --auto-607px: calc(607px / var(--hostDevicePixelRatio));
--auto-620px: calc(620px / var(--hostDevicePixelRatio)); --auto-620px: calc(620px / var(--hostDevicePixelRatio));
--auto-781px: calc(781px / var(--hostDevicePixelRatio));
--auto-815px: calc(815px / var(--hostDevicePixelRatio)); --auto-815px: calc(815px / var(--hostDevicePixelRatio));
} }
` `

View File

@ -46,6 +46,7 @@ export const sharedStyles: CSSResult = css`
p { p {
position: absolute; position: absolute;
font-family: 'OPPOSans'; font-family: 'OPPOSans';
font-size: var(--auto-40px);
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
color: #292929; color: #292929;
@ -58,9 +59,9 @@ export const sharedStyles: CSSResult = css`
} }
button { button {
position: relative; position: relative;
width: 70px; width: var(--auto-140px);
height: 70px; height: var(--auto-140px);
font-size: var(--auto-36px); font-size: var(--auto-70px);
border-radius: 50%; border-radius: 50%;
border: none; border: none;
/*button背景无色*/ /*button背景无色*/
@ -94,13 +95,13 @@ export const sharedStyles: CSSResult = css`
} }
#textcenter { #textcenter {
text-align: center; text-align: center;
font-size: var(--auto-40px);
display: flex;
justify-content: center;
} }
.topText { .topText {
font-size: 20px;
height: var(--auto-53px); height: var(--auto-53px);
line-height: var(--auto-53px); line-height: var(--auto-53px);
width: var(--auto-160px);
left: calc(50% - var(--auto-160px) / 2);
top: 31%; top: 31%;
} }
.spanContainer { .spanContainer {

View File

@ -1,8 +1,8 @@
import {css, CSSResult} from 'lit' import {css, CSSResult} from 'lit'
export const sharedStyles: CSSResult = css` export const sharedStyles: CSSResult = css`
:host { /* :host {
--top-dir: 40%; --top-dir: 40%;
} } */
canvas { canvas {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
@ -15,7 +15,6 @@ export const sharedStyles: CSSResult = css`
} }
p { p {
position: absolute; position: absolute;
width: var(--auto-160px);
line-height: var(--auto-53px); line-height: var(--auto-53px);
font-size: var(--auto-40px); font-size: var(--auto-40px);
height: var(--auto-53px); height: var(--auto-53px);
@ -32,7 +31,7 @@ export const sharedStyles: CSSResult = css`
} }
#canvasdown { #canvasdown {
position: relative; position: relative;
top: var(--top-dir); top: var(--auto-781px);
} }
.textTop { .textTop {
top: 31%; top: 31%;

View File

@ -9,7 +9,7 @@ import {sharedStyles} from './pattern-view-style.js'
@customElement('star-pattern-view') @customElement('star-pattern-view')
export class StarPatternView extends StarBaseElement { export class StarPatternView extends StarBaseElement {
_topDir: string = '' /* _topDir: string = '' */
_getRed: boolean = false _getRed: boolean = false
public static override get styles(): CSSResultArray { public static override get styles(): CSSResultArray {
@ -17,6 +17,7 @@ export class StarPatternView extends StarBaseElement {
} }
@query('canvas') canvas!: HTMLCanvasElement @query('canvas') canvas!: HTMLCanvasElement
@query('.textTop') saveP!: HTMLParagraphElement @query('.textTop') saveP!: HTMLParagraphElement
@query('#canvasdown') canvasdown!: HTMLDivElement
@property({attribute: false}) cxt!: CanvasRenderingContext2D @property({attribute: false}) cxt!: CanvasRenderingContext2D
@property({type: Boolean}) @property({type: Boolean})
get getRed() { get getRed() {
@ -48,7 +49,7 @@ export class StarPatternView extends StarBaseElement {
@property({type: String}) changeText = '' @property({type: String}) changeText = ''
@property({type: String}) cancel = '取消' @property({type: String}) cancel = '取消'
@property({type: String}) lessfourinfo = '' @property({type: String}) lessfourinfo = ''
@property({type: String}) /* @property({type: String})
get topDir() { get topDir() {
return this._topDir return this._topDir
} }
@ -56,7 +57,7 @@ export class StarPatternView extends StarBaseElement {
this.style.setProperty('--top-dir', value) this.style.setProperty('--top-dir', value)
this._topDir = value this._topDir = value
this.top = parseInt(this._topDir) this.top = parseInt(this._topDir)
} } */
render() { render() {
if (!this.saveMode) { if (!this.saveMode) {
@ -99,8 +100,8 @@ export class StarPatternView extends StarBaseElement {
): void { ): void {
//settings中图形密码上下的文字以及图形密码的位置都有所变化 //settings中图形密码上下的文字以及图形密码的位置都有所变化
if (this.saveMode) { if (this.saveMode) {
this.topDir = '34%' this.canvasdown.style.setProperty('top', 'var(--auto-543px)')
this.saveP.style.setProperty('top', '27.8%') this.saveP.style.setProperty('top', 'var(--auto-411px)')
} }
//canvas的高度和宽度都是 //canvas的高度和宽度都是
this.canvas.width = this.canvasWidth this.canvas.width = this.canvasWidth