diff --git a/src/components/clock/clock-style.ts b/src/components/clock/clock-style.ts
index a52b9fc..f22f6dd 100644
--- a/src/components/clock/clock-style.ts
+++ b/src/components/clock/clock-style.ts
@@ -69,7 +69,7 @@ export const sharedStyles: CSSResult = css`
width: var(--autoPoint);
height: var(--autoPoint);
position: absolute;
- left: 50%;
+ right: 50%;
top: 0;
background: linear-gradient(
90deg,
@@ -77,7 +77,7 @@ export const sharedStyles: CSSResult = css`
rgba(245, 245, 245, 0.01) 100%
);
border-radius: 50%;
- transform: translate(50%, 0);
+ transform: translate(-50%, 0);
}
.star-clock-hour-hand {
position: absolute;
diff --git a/src/components/clock/clock.ts b/src/components/clock/clock.ts
index e8c2a3c..c358d56 100644
--- a/src/components/clock/clock.ts
+++ b/src/components/clock/clock.ts
@@ -28,7 +28,8 @@ export class StarClock extends LitElement {
if (val.constructor.toString().includes('String')) {
val.toString().length <= 13 ? (val = Number(val)) : ''
}
- val && this.dateUpdated(val)
+ // val && this.dateUpdated(val)
+ val && setInterval(()=>{this.dateUpdated(new Date())}, 1000)
}
@query('.star-clock')
@@ -41,7 +42,7 @@ export class StarClock extends LitElement {
(item) => html`
@@ -68,8 +69,7 @@ export class StarClock extends LitElement {
>
`
@@ -124,7 +124,7 @@ export class StarClock extends LitElement {
// 秒针
if (secondTime === 0) {
this.rotateSecond = 360
- setTimeout(() => {
+ window.setTimeout(() => {
this.rotateSecond = 0
}, 930)
} else {
diff --git a/src/test/panels/clock/clock.ts b/src/test/panels/clock/clock.ts
index ab6b4dd..78ce2f7 100644
--- a/src/test/panels/clock/clock.ts
+++ b/src/test/panels/clock/clock.ts
@@ -47,12 +47,12 @@ export class PanelClock extends LitElement {
}
static styles = css``
protected firstUpdated() {
- setInterval(()=>{
+ // setInterval(()=>{
this.clockTest1.date = new Date()
this.clockTest2.date = new Date()
this.clockTest3.date = new Date()
this.clockTest4.date = new Date()
- }, 1000)
+ // }, 1000)
}
}
declare global {