1
0
This commit is contained in:
syui 2024-10-02 14:58:36 +09:00
parent 70366cc5ae
commit 7bc0ba9e93
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
3 changed files with 32 additions and 26 deletions

View File

@ -17,6 +17,7 @@ html {
}
.time {
transform:scale(-1,1);
position: absolute;
top: 10px;
padding: 10px;
@ -27,6 +28,7 @@ html {
}
.api {
transform:scale(-1,1);
position: absolute;
top: 50px;
padding: 10px;

View File

@ -1,33 +1,37 @@
import React, { useState, useEffect } from 'react';
//function reverseString(str: string): string {
// return str.split('').reverse().join('');
//}
const ScreenTimeCanvas: React.FC = () => {
const [currentDateTime, setCurrentDateTime] = useState<string>('');
const [currentDateTime, setCurrentDateTime] = useState<string>('');
//const [reversedDateTime, setReversedDateTime] = useState<string>('');
useEffect(() => {
const updateDateTime = () => {
const now = new Date();
const formatted = now.toLocaleString("ja-JP", {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
});
setCurrentDateTime(formatted);
};
useEffect(() => {
const updateDateTime = () => {
const now = new Date();
const formatted = now.toLocaleString("ja-JP", {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
});
setCurrentDateTime(formatted);
//setReversedDateTime(reverseString(formatted));
};
updateDateTime();
const timer = setInterval(updateDateTime, 1000);
return () => clearInterval(timer);
}, []);
updateDateTime();
const timer = setInterval(updateDateTime, 1000);
return () => clearInterval(timer);
}, []);
return (
<div className="time">
<p>{currentDateTime}</p>
</div>
);
return (
<div className="time">
<p>{currentDateTime}</p>
</div>
);
};
export default ScreenTimeCanvas;

View File

@ -68,7 +68,7 @@ export const VRMModelCanvas = () => {
<OrbitControls />
<ambientLight intensity={10} />
<pointLight position={[10, 10, 10]} />
<VRMModel url="./models/t.vrm" url_anim="./models/default.vrma" position={[0, -0.7, 0]} rotation={[0, -4.7, 0]} scale={[1, 1, 1]} />
<VRMModel url="./models/t.vrm" url_anim="./models/default.vrma" position={[0, -0.6, 0]} rotation={[0, 0, 0]} scale={[1, 1, 1]} />
</Canvas>
</div>
)