I'll adjust the scene to ensure the letters aren't obscured by the galaxy elements.
I've made several adjustments to ensure the letters are clearly visible and not obscured by the galaxy elements:
Created a Clear Zone Around the Text:
GalaxyParticles component to avoid generating particles in the central area where the text is locatedRepositioned the Nebula Clouds:
Enhanced Text Visibility:
Adjusted Text Position:
Improved Depth Perception:
These changes ensure that the "PLOT CENTER" text remains the focal point of the scene while still maintaining the immersive galaxy environment all around it. The letters now stand out clearly against the galaxy background without being obscured by particles or nebula clouds.
Here's a step-by-step guide to deploy this Next.js 3D application to Hostinger:
First, make sure you have a complete Next.js project with all the necessary files:
Create the following file structure:
app/page.tsx (importing your component)next-blocks.tsx (your 3D scene component)app/layout.tsx (basic layout)package.json (dependencies)next.config.js (Next.js configuration)# Install required dependencies
npm install next react react-dom three @react-three/fiber @react-three/drei
# Build the project for production
npm run buildThis will create a .next folder with the optimized production build.
Use the File Manager or FTP:
Upload your files:
Make sure to include:
.next folder (contains the built application)package.json and package-lock.jsonpublic folder (if you have any static assets)next.config.jsHostinger offers Node.js support on certain plans. You'll need to:
Enable Node.js in your Hostinger control panel:
Configure the application:
node_modules/next/dist/bin/next startSet environment variables:
NODE_ENV=productionPORT=3000 (or the port provided by Hostinger)If Hostinger's Node.js support doesn't work directly with Next.js, you can:
// server.js
const { createServer } = require('http');
const { parse } = require('url');
const next = require('next');
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
const port = process.env.PORT || 3000;
app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url, true);
handle(req, res, parsedUrl);
}).listen(port, (err) => {
if (err) throw err;
console.log(`> Ready on http://localhost:${port}`);
});
});"scripts": {
"start": "NODE_ENV=production node server.js"
}server.jsIf you're having trouble with Node.js on Hostinger, you can use Next.js static export:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
// Required for Three.js to work properly in static export
images: { unoptimized: true }
}
module.exports = nextConfignpm run buildout folder to your Hostinger hosting root directoryuseEffect(() => {
// Browser-only code here
}, []);Let me know if you need more specific guidance for your Hostinger plan!