mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-15 11:21:57 +00:00
feat: add subtle triangular accents to clean gradient background
- Kept clean radial gradient base - Added very faint triangular shapes (2-5% opacity) - Sparse pattern - only 30% of grid positions - Random sizes (40-120px) and positions for organic feel - Perfect balance of clean + subtle geometric detail
This commit is contained in:
@@ -236,7 +236,7 @@ const Layout = ({ children }) => {
|
||||
navigate("/hosts?action=add");
|
||||
};
|
||||
|
||||
// Generate clean radial gradient background for dark mode - subtle and modern
|
||||
// Generate clean radial gradient background with subtle triangular accents for dark mode
|
||||
useEffect(() => {
|
||||
const generateBackground = () => {
|
||||
if (
|
||||
@@ -295,6 +295,35 @@ const Layout = ({ children }) => {
|
||||
|
||||
ctx.fillStyle = gradient;
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// Add subtle triangular shapes as accents
|
||||
const cellSize = 200;
|
||||
const cols = Math.ceil(canvas.width / cellSize) + 1;
|
||||
const rows = Math.ceil(canvas.height / cellSize) + 1;
|
||||
|
||||
for (let y = 0; y < rows; y++) {
|
||||
for (let x = 0; x < cols; x++) {
|
||||
const idx = y * cols + x;
|
||||
// Only draw some triangles (sparse pattern)
|
||||
if (random(seed + idx + 5000) > 0.7) {
|
||||
const baseX =
|
||||
x * cellSize + random(seed + idx * 3) * cellSize * 0.8;
|
||||
const baseY =
|
||||
y * cellSize + random(seed + idx * 3 + 100) * cellSize * 0.8;
|
||||
const size = 40 + random(seed + idx * 4) * 80;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(baseX, baseY);
|
||||
ctx.lineTo(baseX + size, baseY);
|
||||
ctx.lineTo(baseX + size / 2, baseY - size * 0.866);
|
||||
ctx.closePath();
|
||||
|
||||
// Very faint white with low opacity
|
||||
ctx.fillStyle = `rgba(255, 255, 255, ${0.02 + random(seed + idx * 5) * 0.03})`;
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
generateBackground();
|
||||
|
||||
@@ -56,7 +56,7 @@ const Login = () => {
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
// Generate clean radial gradient background - subtle and modern
|
||||
// Generate clean radial gradient background with subtle triangular accents
|
||||
useEffect(() => {
|
||||
const generateBackground = () => {
|
||||
if (!canvasRef.current || !themeConfig?.login) return;
|
||||
@@ -109,6 +109,35 @@ const Login = () => {
|
||||
|
||||
ctx.fillStyle = gradient;
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// Add subtle triangular shapes as accents
|
||||
const cellSize = 200;
|
||||
const cols = Math.ceil(canvas.width / cellSize) + 1;
|
||||
const rows = Math.ceil(canvas.height / cellSize) + 1;
|
||||
|
||||
for (let y = 0; y < rows; y++) {
|
||||
for (let x = 0; x < cols; x++) {
|
||||
const idx = y * cols + x;
|
||||
// Only draw some triangles (sparse pattern)
|
||||
if (random(seed + idx + 5000) > 0.7) {
|
||||
const baseX =
|
||||
x * cellSize + random(seed + idx * 3) * cellSize * 0.8;
|
||||
const baseY =
|
||||
y * cellSize + random(seed + idx * 3 + 100) * cellSize * 0.8;
|
||||
const size = 40 + random(seed + idx * 4) * 80;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(baseX, baseY);
|
||||
ctx.lineTo(baseX + size, baseY);
|
||||
ctx.lineTo(baseX + size / 2, baseY - size * 0.866);
|
||||
ctx.closePath();
|
||||
|
||||
// Very faint white with low opacity
|
||||
ctx.fillStyle = `rgba(255, 255, 255, ${0.02 + random(seed + idx * 5) * 0.03})`;
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
generateBackground();
|
||||
|
||||
Reference in New Issue
Block a user