auto-save 2026-05-15 18:56 (~4)
This commit is contained in:
@@ -90,8 +90,8 @@ export default function LoginPage() {
|
||||
<OasisCanvas />
|
||||
<div className="login-oasis-shade" />
|
||||
<div className="relative z-10 mx-auto flex min-h-[calc(100vh-3rem)] w-full max-w-7xl items-center">
|
||||
<div className="grid w-full gap-5 lg:grid-cols-[minmax(0,1.16fr)_minmax(380px,440px)] lg:items-stretch">
|
||||
<section className="login-hero login-oasis-hero order-2 relative min-h-[540px] overflow-hidden p-1 text-white sm:p-2 lg:order-1 lg:min-h-[660px]">
|
||||
<div className="grid w-full gap-5 lg:grid-cols-[minmax(0,1.28fr)_minmax(320px,380px)] lg:items-center">
|
||||
<section className="login-hero login-oasis-hero order-2 relative min-h-[540px] overflow-hidden p-1 text-white sm:p-2 lg:order-1 lg:min-h-[620px]">
|
||||
<div className="relative z-10 flex h-full flex-col">
|
||||
<div className="flex flex-wrap items-center justify-between gap-4">
|
||||
<div className="login-wordmark">
|
||||
@@ -140,10 +140,10 @@ export default function LoginPage() {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="login-auth-panel order-1 flex min-h-[470px] items-center rounded-[8px] p-5 sm:p-8 lg:order-2 lg:min-h-[660px]">
|
||||
<section className="login-auth-panel order-1 flex min-h-[390px] items-center rounded-[8px] p-5 sm:p-8 lg:order-2 lg:min-h-[460px]">
|
||||
<form className="w-full" onSubmit={onSubmit}>
|
||||
<div className="mb-8">
|
||||
<div className="login-auth-icon mb-4 inline-flex h-12 w-12 items-center justify-center rounded-[8px] text-white">
|
||||
<div className="mb-6">
|
||||
<div className="login-auth-icon mb-4 inline-flex h-10 w-10 items-center justify-center rounded-[8px] text-white">
|
||||
<LockKeyhole className="h-5 w-5" />
|
||||
</div>
|
||||
<h2 className="text-2xl font-semibold text-white">身份验证</h2>
|
||||
|
||||
@@ -1,8 +1,38 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect, useRef } from "react"
|
||||
|
||||
export function OasisCanvas() {
|
||||
const frameRef = useRef<HTMLIFrameElement | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const sendPointer = (type: "pointermove" | "pointerleave", event?: PointerEvent) => {
|
||||
const frameWindow = frameRef.current?.contentWindow
|
||||
if (!frameWindow) return
|
||||
frameWindow.postMessage(
|
||||
{
|
||||
type: `skg-oasis-${type}`,
|
||||
x: event?.clientX ?? 99999,
|
||||
y: event?.clientY ?? 99999,
|
||||
},
|
||||
window.location.origin,
|
||||
)
|
||||
}
|
||||
|
||||
const onPointerMove = (event: PointerEvent) => sendPointer("pointermove", event)
|
||||
const onPointerLeave = () => sendPointer("pointerleave")
|
||||
|
||||
window.addEventListener("pointermove", onPointerMove)
|
||||
window.addEventListener("pointerleave", onPointerLeave)
|
||||
return () => {
|
||||
window.removeEventListener("pointermove", onPointerMove)
|
||||
window.removeEventListener("pointerleave", onPointerLeave)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<iframe
|
||||
ref={frameRef}
|
||||
allow="webgpu; fullscreen"
|
||||
aria-hidden="true"
|
||||
className="login-oasis-canvas"
|
||||
|
||||
@@ -1380,16 +1380,29 @@
|
||||
const grassPlane = new THREE.Plane(new THREE.Vector3(0, 1, 0), 0);
|
||||
const hitPoint = new THREE.Vector3();
|
||||
|
||||
window.addEventListener('mousemove', (e) => {
|
||||
mouseNDC.set((e.clientX / innerWidth) * 2 - 1, -(e.clientY / innerHeight) * 2 + 1);
|
||||
function applyPointerToGrass(clientX, clientY) {
|
||||
mouseNDC.set((clientX / innerWidth) * 2 - 1, -(clientY / innerHeight) * 2 + 1);
|
||||
raycaster.setFromCamera(mouseNDC, camera);
|
||||
if (raycaster.ray.intersectPlane(grassPlane, hitPoint)) {
|
||||
mouseWorld.value.copy(hitPoint);
|
||||
// Compute distance from camera to mouse hit for auto-focus
|
||||
mouseFocusDist = camera.position.distanceTo(hitPoint);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('mousemove', (e) => {
|
||||
applyPointerToGrass(e.clientX, e.clientY);
|
||||
});
|
||||
window.addEventListener('mouseleave', () => mouseWorld.value.set(99999, 0, 99999));
|
||||
window.addEventListener('message', (event) => {
|
||||
const data = event.data || {};
|
||||
if (data.type === 'skg-oasis-pointermove') {
|
||||
applyPointerToGrass(data.x, data.y);
|
||||
}
|
||||
if (data.type === 'skg-oasis-pointerleave') {
|
||||
mouseWorld.value.set(99999, 0, 99999);
|
||||
}
|
||||
});
|
||||
|
||||
let resizeTimeout;
|
||||
window.addEventListener('resize', () => {
|
||||
|
||||
Reference in New Issue
Block a user