|
|
@@ -789,93 +789,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
|
|
|
isThirdRing={false}
|
|
|
canvasId={'day_night_card_night_ring'}
|
|
|
authInfo={authInfo}
|
|
|
- currentStatus={currentStatus()}
|
|
|
/>
|
|
|
- // var common = getCommon(null, true)
|
|
|
- // common.radius = bigRingRadius;
|
|
|
- // common.lineWidth = ringWidth;
|
|
|
- // var bgRing = getBgRing()
|
|
|
-
|
|
|
- // let realRingBig: RealRing = {
|
|
|
- // color: ColorType.night + '66',
|
|
|
- // startArc: 0,
|
|
|
- // durationArc: 2
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // var now1 = new Date().getTime()
|
|
|
- // if (authInfo && authInfo.timezone) {
|
|
|
- // now1 = TimeFormatter.transferTimestamp(now1, authInfo.timezone)
|
|
|
- // }
|
|
|
-
|
|
|
- // if (authInfo && authInfo.night_completed && new Date().getTime() > authInfo.night_completed.sunrise_ts) {
|
|
|
- // realRingBig.color = ColorType.night
|
|
|
- // var duration = (authInfo.night_completed.sunrise_ts - authInfo.night_completed.sunset_ts) / 1000
|
|
|
- // // var start = new Date(authInfo.night_completed.sunset_ts)
|
|
|
- // var newT = TimeFormatter.transferTimestamp(authInfo.night_completed.sunset_ts, authInfo.timezone)
|
|
|
- // var start = new Date(newT)
|
|
|
- // realRingBig.startArc = (start.getHours() * 3600 + start.getMinutes() * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
- // realRingBig.durationArc = (duration) / (24 * 3600) * 2 * Math.PI;
|
|
|
-
|
|
|
- // var currentDot = getDot(null, false)
|
|
|
- // currentDot.color = ColorType.night
|
|
|
- // currentDot.offset = (authInfo && authInfo.timezone) ? TimeFormatter.timeZoneOffset(authInfo.timezone) : 0;
|
|
|
- // //已结束未更新暂停时,显示current_dot
|
|
|
- // if (currentStatus() == t('feature.day_night.update_paused')){
|
|
|
- // currentDot = null
|
|
|
- // }
|
|
|
-
|
|
|
- // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} currentDot={currentDot} canvasId={'ddddsss' + 'index_day'} />
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // var sunRise = 24 * 60 + 6 * 60
|
|
|
- // var sunSet = 18 * 60
|
|
|
-
|
|
|
- // var sunRiseObj = user.isLogin ? nightStore.nightRingSunrise : '06:00:00'
|
|
|
- // var sunSetObj = user.isLogin ? nightStore.nightRingSunset : '18:00:00'
|
|
|
- // sunRise = 24 * 60 + parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
|
|
|
- // sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
|
|
|
- // if (sunSetObj.indexOf('PM') != -1) {
|
|
|
- // sunSet += 12 * 60
|
|
|
- // }
|
|
|
- // // }
|
|
|
- // var duration = sunRise - sunSet
|
|
|
- // realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
- // realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
|
|
|
-
|
|
|
- // var currentDot = getDot(null, false)
|
|
|
- // currentDot.color = ColorType.night
|
|
|
- // currentDot.offset = (authInfo && authInfo.timezone) ? TimeFormatter.timeZoneOffset(authInfo.timezone) : 0
|
|
|
-
|
|
|
- // var now = new Date()
|
|
|
- // now = localNow(now)
|
|
|
-
|
|
|
- // var t1 = now.getHours() * 60 + now.getMinutes()
|
|
|
- // var duration2 = t1 - sunSet
|
|
|
- // if (duration2 < 0) {
|
|
|
- // duration2 += 24 * 60
|
|
|
- // }
|
|
|
- // let realRing: RealRing = {
|
|
|
- // color: ColorType.night,
|
|
|
- // startArc: (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
|
|
|
- // durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
|
|
|
- // }
|
|
|
-
|
|
|
- // if (nightStore.nightRingDate) {
|
|
|
- // if (new Date(nightStore.nightRingDate).getDate() == now.getDate() && now.getHours() < 12) {
|
|
|
- // realRing = null;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // // if (!user.isLogin) {
|
|
|
- // // currentDot = null;
|
|
|
- // // realRing = null;
|
|
|
- // // }
|
|
|
-
|
|
|
-
|
|
|
- // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 > duration ? null : realRing} currentDot={currentDot} canvasId={'dddd' + 'index_day'} />
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function localNow(now: Date) {
|
|
|
@@ -886,97 +800,12 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
|
|
|
}
|
|
|
|
|
|
function dayRing() {
|
|
|
-
|
|
|
return <DayNightRing
|
|
|
isNight={false}
|
|
|
isThirdRing={false}
|
|
|
canvasId={'day_night_card_big_day'}
|
|
|
authInfo={authInfo}
|
|
|
/>
|
|
|
-
|
|
|
- // var common = getCommon(null, true)
|
|
|
- // common.radius = bigRingRadius;
|
|
|
- // common.lineWidth = ringWidth;
|
|
|
- // var bgRing = getBgRing()
|
|
|
-
|
|
|
- // const realRingBig: RealRing = {
|
|
|
- // color: ColorType.day + '66',
|
|
|
- // startArc: 0,
|
|
|
- // durationArc: 2
|
|
|
- // }
|
|
|
-
|
|
|
- // var now1 = new Date().getTime()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // if (authInfo && authInfo.day_completed && now1 > authInfo.day_completed.sunset_ts) {
|
|
|
- // realRingBig.color = ColorType.day
|
|
|
- // var duration = (authInfo.day_completed.sunset_ts - authInfo.day_completed.sunrise_ts) / 1000
|
|
|
- // // var start = new Date(authInfo.day_completed.sunrise_ts)
|
|
|
- // // var start = new Date(authInfo.night_completed.sunset_ts)
|
|
|
- // var newT = TimeFormatter.transferTimestamp(authInfo.day_completed.sunrise_ts, authInfo.timezone)
|
|
|
- // var start = new Date(newT)
|
|
|
- // realRingBig.startArc = (start.getHours() * 3600 + start.getMinutes() * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
- // realRingBig.durationArc = (duration) / (24 * 3600) * 2 * Math.PI;
|
|
|
- // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} canvasId={'ddddsss_day' + 'index_day'} />
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // if (authInfo && authInfo.timezone) {
|
|
|
- // now1 = TimeFormatter.transferTimestamp(now1, authInfo.timezone)
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // var sunRise = 6 * 60
|
|
|
- // var sunSet = 18 * 60
|
|
|
-
|
|
|
- // var sunRiseObj = user.isLogin ? dayStore.dayRingSunrise : '06:00:00'
|
|
|
- // var sunSetObj = user.isLogin ? dayStore.dayRingSunset : '18:00:00'
|
|
|
- // sunRise = parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
|
|
|
- // sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
|
|
|
-
|
|
|
-
|
|
|
- // var duration = sunSet - sunRise
|
|
|
-
|
|
|
- // realRingBig.startArc = (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
- // realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
|
|
|
-
|
|
|
- // var currentDot = getDot(null, false)
|
|
|
- // currentDot.offset = (authInfo && authInfo.timezone) ? TimeFormatter.timeZoneOffset(authInfo.timezone) : 0
|
|
|
- // var date = new Date()
|
|
|
- // var minutes = date.getHours() * 60 + date.getMinutes()
|
|
|
- // if (minutes < sunRise) {
|
|
|
- // minutes += 1440
|
|
|
- // }
|
|
|
-
|
|
|
- // currentDot.color = ColorType.day
|
|
|
-
|
|
|
-
|
|
|
- // var now = new Date()
|
|
|
- // now = localNow(now)
|
|
|
- // var t = now.getHours() * 60 + now.getMinutes()
|
|
|
- // var duration2 = t - sunRise
|
|
|
- // if (duration2 < 0) {
|
|
|
- // duration2 += 24 * 60
|
|
|
- // }
|
|
|
- // var realRing: RealRing = {
|
|
|
- // color: ColorType.day,
|
|
|
- // startArc: (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
|
|
|
- // durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
|
|
|
- // }
|
|
|
- // if (dayStore.dayRingDate) {
|
|
|
- // if (new Date(dayStore.dayRingDate).getDate() != now.getDate()) {
|
|
|
- // realRing = null;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // // if (!user.isLogin) {
|
|
|
- // // currentDot = null
|
|
|
- // // realRing = null
|
|
|
- // // }
|
|
|
-
|
|
|
- // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 <= duration ? realRing : null} currentDot={currentDot} canvasId={'day_day2'} />
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function getSunsetDuration() {
|