path correction
This commit is contained in:
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>CITPL Admin</title>
|
||||
<script type="module" crossorigin src="/citpl_website/assets/admin-xMzVH3dP.js"></script>
|
||||
<script type="module" crossorigin src="/citpl_website/assets/admin-CV3gMvyC.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-Dfk9cXvs.js">
|
||||
<link rel="stylesheet" crossorigin href="/citpl_website/assets/admin-Chd5uVZT.css">
|
||||
</head>
|
||||
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/citpl_website/vite.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Cavin Infotech | One Trusted Technology Partner</title>
|
||||
<script type="module" crossorigin src="/citpl_website/assets/main-DHNPwmMh.js"></script>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/citpl_website/vite.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Cavin Infotech | One Trusted Technology Partner</title>
|
||||
</head>
|
||||
|
||||
+49
-1
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useState, Component } from 'react';
|
||||
import { useEffect, useState, useRef, Component } from 'react';
|
||||
|
||||
const BASE = import.meta.env.BASE_URL;
|
||||
import {
|
||||
@@ -72,6 +72,25 @@ function Toast({ message, type }) {
|
||||
}
|
||||
|
||||
function LoginPreview() {
|
||||
const viewportRef = useRef(null);
|
||||
const [scale, setScale] = useState(0.5);
|
||||
const previewWidth = 1280;
|
||||
const previewHeight = 800;
|
||||
|
||||
useEffect(() => {
|
||||
const el = viewportRef.current;
|
||||
if (!el) return;
|
||||
|
||||
const updateScale = () => {
|
||||
const nextScale = el.clientWidth / previewWidth;
|
||||
setScale(nextScale);
|
||||
};
|
||||
|
||||
updateScale();
|
||||
const observer = new ResizeObserver(updateScale);
|
||||
observer.observe(el);
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
return (
|
||||
<div className="login-preview">
|
||||
<div className="login-preview-intro">
|
||||
@@ -85,6 +104,35 @@ function LoginPreview() {
|
||||
Open full site
|
||||
</a>
|
||||
</div>
|
||||
<div className="login-preview-shell">
|
||||
<div className="login-preview-chrome">
|
||||
<span className="login-preview-dot" />
|
||||
<span className="login-preview-dot" />
|
||||
<span className="login-preview-dot" />
|
||||
<span className="login-preview-url">cavininfotech.com</span>
|
||||
</div>
|
||||
<div
|
||||
className="login-preview-viewport"
|
||||
ref={viewportRef}
|
||||
style={{ height: previewHeight * scale }}
|
||||
>
|
||||
<div
|
||||
className="login-preview-stage"
|
||||
style={{ width: previewWidth * scale, height: previewHeight * scale }}
|
||||
>
|
||||
<iframe
|
||||
src={BASE}
|
||||
title="Website preview"
|
||||
className="login-preview-iframe"
|
||||
style={{
|
||||
width: previewWidth,
|
||||
height: previewHeight,
|
||||
transform: `scale(${scale})`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+5
-3
@@ -2,8 +2,10 @@ import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { resolve } from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
base: '/citpl_website/',
|
||||
// Dev: http://localhost:5173/admin.html (base "/")
|
||||
// Prod: https://demo.cavinkare.in/citpl_website/admin.html (base "/citpl_website/")
|
||||
export default defineConfig(({ command }) => ({
|
||||
base: command === 'serve' ? '/' : '/citpl_website/',
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
@@ -20,4 +22,4 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user