|
|
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
|
|
|
import { TimeFormatter } from "@/utils/time_format";
|
|
|
import Rings, { BgRing, CurrentDot, RealRing, RingCommon } from './Rings';
|
|
|
import { getBgRing, getCommon, getDot, getReal, getTarget } from "../hooks/RingData";
|
|
|
-
|
|
|
+import './Clock.scss'
|
|
|
export default function Component() {
|
|
|
const [checkData, setCheckData] = useState(null)
|
|
|
|
|
|
@@ -27,7 +27,7 @@ export default function Component() {
|
|
|
//外环
|
|
|
function bigRing() {
|
|
|
var common = getCommon(null, true)
|
|
|
- common.radius = 111;
|
|
|
+ common.radius = 126;
|
|
|
common.lineWidth = 28;
|
|
|
var bgRing = getBgRing()
|
|
|
if (!checkData) {
|
|
|
@@ -37,7 +37,7 @@ export default function Component() {
|
|
|
var current_record = (checkData as any).current_record
|
|
|
var currentDot1 = getDot((checkData as any).current_record, true)
|
|
|
var targetBigRing1 = getTarget((checkData as any).current_record, true)
|
|
|
- targetBigRing1.color = 'rgba(170,255,0,0.1)'
|
|
|
+ targetBigRing1.color = 'rgba(170,255,0,0.4)'
|
|
|
if (current_record.status == 'ONGOING') {
|
|
|
var realRing1 = getReal((checkData as any).current_record, true, false)
|
|
|
|
|
|
@@ -57,18 +57,20 @@ export default function Component() {
|
|
|
var current_record = (checkData as any).current_record
|
|
|
if (current_record.scenario == 'FAST_SLEEP') {
|
|
|
var common = getCommon(null, false)
|
|
|
- common.radius = 80;
|
|
|
- common.lineWidth = 20;
|
|
|
+ common.radius = 90;
|
|
|
+ common.lineWidth = 28;
|
|
|
var bgRing = getBgRing()
|
|
|
var realRing = getReal((checkData as any).current_record, false, false)
|
|
|
var currentDot = getDot((checkData as any).current_record, false)
|
|
|
var targetRing = getTarget((checkData as any).current_record, false)
|
|
|
- targetRing.color = 'rgba(0, 255, 255, 0.1)'
|
|
|
+ targetRing.color = 'rgba(0, 255, 255, 0.4)'
|
|
|
if (current_record.status == 'ONGOING2') {
|
|
|
return <Rings common={common} bgRing={bgRing} realRing={realRing} currentDot={currentDot} targetRing={targetRing} canvasId='clock7' />
|
|
|
}
|
|
|
+
|
|
|
+ //ongoing3时,睡眠点整理亮度降低
|
|
|
if (current_record.status == 'ONGOING3') {
|
|
|
- currentDot.color = 'rgba(0, 255, 255, 0.5)'
|
|
|
+ currentDot.color = 'rgba(0, 255, 255, 0.5)'
|
|
|
}
|
|
|
return <Rings common={common} bgRing={bgRing} currentDot={currentDot} canvasId='clock8' />
|
|
|
}
|
|
|
@@ -94,33 +96,33 @@ export default function Component() {
|
|
|
</View>
|
|
|
<View style={{ display: 'flex', position: 'absolute', left: 0, right: 0, top: 0, bottom: 0, alignItems: 'center', justifyContent: 'center' }}>
|
|
|
{
|
|
|
- (checkData as any).current_record.status == 'WAIT_FOR_START' && <Text style={{ color: '#AAFF00' }}>00:00:00</Text>
|
|
|
+ (checkData as any).current_record.status == 'WAIT_FOR_START' && <Text className="clock_text" style={{ color: '#AAFF00' }}>00:00:00</Text>
|
|
|
}
|
|
|
{
|
|
|
- (checkData as any).current_record.status == 'ONGOING' && <Text style={{ color: (checkData as any).current_record.scenario == 'FAST' ? '#aaff00' : '#00ffffff' }}>
|
|
|
+ (checkData as any).current_record.status == 'ONGOING' && <Text className="clock_text" style={{ color: (checkData as any).current_record.scenario == 'FAST' ? '#aaff00' : '#00ffffff' }}>
|
|
|
{TimeFormatter.formateTimeNow((checkData as any).current_record.fast ?
|
|
|
(checkData as any).current_record.fast.real_start_time :
|
|
|
(checkData as any).current_record.sleep.real_start_time)}
|
|
|
</Text>
|
|
|
}
|
|
|
{
|
|
|
- (checkData as any).current_record.status == 'ONGOING1' && <Text style={{ color: '#AAFF00' }}>
|
|
|
+ (checkData as any).current_record.status == 'ONGOING1' && <Text className="clock_text" style={{ color: '#AAFF00' }}>
|
|
|
{TimeFormatter.formateTimeNow((checkData as any).current_record.fast.real_start_time)}
|
|
|
</Text>
|
|
|
}
|
|
|
{
|
|
|
- (checkData as any).current_record.status == 'ONGOING2' && <View style={{ flexDirection: 'column', display: 'flex' }}>
|
|
|
- <Text style={{ color: '#AAFF00' }}>
|
|
|
+ (checkData as any).current_record.status == 'ONGOING2' && <View style={{ flexDirection: 'column', display: 'flex' }}>
|
|
|
+ <Text className="clock_text"style={{ color: '#AAFF00' }}>
|
|
|
{TimeFormatter.formateTimeNow((checkData as any).current_record.fast.real_start_time)}
|
|
|
</Text>
|
|
|
- <Text style={{ color: '#00FFFF' }}>
|
|
|
+ <Text className="clock_text" style={{ color: '#00FFFF' }}>
|
|
|
{TimeFormatter.formateTimeNow((checkData as any).current_record.sleep.real_start_time)}
|
|
|
</Text>
|
|
|
</View>
|
|
|
}
|
|
|
{
|
|
|
(checkData as any).current_record.status == 'ONGOING3' && <Text>
|
|
|
- <Text style={{ color: '#AAFF00' }}>
|
|
|
+ <Text className="clock_text" style={{ color: '#AAFF00' }}>
|
|
|
{TimeFormatter.formateTimeNow((checkData as any).current_record.fast.real_start_time)}
|
|
|
</Text>
|
|
|
</Text>
|