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

View File

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

View File

@ -68,7 +68,7 @@ export const VRMModelCanvas = () => {
<OrbitControls /> <OrbitControls />
<ambientLight intensity={10} /> <ambientLight intensity={10} />
<pointLight position={[10, 10, 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> </Canvas>
</div> </div>
) )