diff --git a/package-lock.json b/package-lock.json index 2f5463aa..9de1bc62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5872,8 +5872,7 @@ "version": "0.180.0", "resolved": "https://registry.npmjs.org/three/-/three-0.180.0.tgz", "integrity": "sha512-o+qycAMZrh+TsE01GqWUxUIKR1AL0S8pq7zDkYOQw8GqfX8b8VoCKYUoHbhiX5j+7hr8XsuHDVU6+gkQJQKg9w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/three-custom-shader-material": { "version": "6.3.7", diff --git a/public/examples/cesium-ion/index.html b/public/examples/cesium-ion/index.html index 2f07a0b1..a84c265a 100644 --- a/public/examples/cesium-ion/index.html +++ b/public/examples/cesium-ion/index.html @@ -43,7 +43,7 @@ ATON.FE.addBasicLoaderEvents(); // Cesium ION token here (otherwise a popup will request it) - //ATON.setAPIToken("cesium.ion", "" ); + ATON.setAPIToken("cesium.ion", "" ); // We create an ATON node and load a Cesium ION asset ATON.createSceneNode("sample-cesium") diff --git a/services/API/v1.js b/services/API/v1.js index 5c7e1099..29360d20 100644 --- a/services/API/v1.js +++ b/services/API/v1.js @@ -70,10 +70,15 @@ app.get("/api/getid/", function(req,res,next){ * @apiDescription Retrieve ATON landing page rendering options */ app.get("/api/landing/", (req,res,next)=>{ - let o = {}; - if (Core.config.landing !== undefined) o = Core.config.landing; - - res.send(o); + let o = {}; + if (Core.config.landing !== undefined) o = Core.config.landing; + + // Add theme parameter support + if (req.query.theme) { + o.theme = req.query.theme; + } + + res.json(o); }); // Collection diff --git a/services/ATON.service.main.js b/services/ATON.service.main.js index ca9c733e..4d95a4ed 100644 --- a/services/ATON.service.main.js +++ b/services/ATON.service.main.js @@ -26,8 +26,8 @@ const Core = require('./Core'); const Auth = require('./Auth'); const Render = require('./Render'); const API = require("./API/v2"); // v2 - - +// for ejs conversion +const ejs = require('ejs'); // Initialize & load config files Core.init(); @@ -82,6 +82,9 @@ let app = express(); //app.use(compression()); +// Configure EJS +app.set('view engine', 'ejs'); +app.set('views', path.join(__dirname, 'views')); app.use(cors({ credentials: true, origin: true @@ -119,6 +122,23 @@ const CACHING_OPT = { maxage: "3h" }; +// Landing page route +app.get('/', (req, res) => { + // Get landing configuration + const landingConfig = Core.config.landing || {}; + + // Pass query parameters and config to template + res.render('index', { + config: landingConfig, + query: req.query.q, + bg: req.query.bg, + hide: req.query.hide, + tb: req.query.tb, + title: landingConfig.title || 'ATON Framework', + description: landingConfig.description || 'ATON Framework' + }); +}); + app.use('/', express.static(Core.DIR_PUBLIC, CACHING_OPT )); // Official front-end (Hathor) diff --git a/services/Core.js b/services/Core.js index 2fea81a4..53464244 100644 --- a/services/Core.js +++ b/services/Core.js @@ -206,15 +206,21 @@ Core.CONF_MAIN = { */ }, - // Soon deprecated - landing: { - gallery: true, // Show gallery (public scenes) in the landing page - samples: true, // Show samples (def true) - //header: "", // Custom header (HTML partial) - //redirect: "", // Redirect to URL (e.g. specific web-app: "a/app_template") - //apps: [] // List of app IDs to show - }, - +landing: { + gallery: true, // Show gallery (public scenes) in the landing page + // new customization options: + title: "ATON Framework", + description: "ATON Framework - Immersive 3D Web Applications for Cultural Heritage", + primaryColor: "#007bff", + secondaryColor: "#6c757d", + backgroundColor: "#ffffff", + textColor: "#333333", + accentColor: "#28a745", + showLogo: true, + showFooter: true, + theme: "default", // default, dark, light, custom + layout: "grid" // grid, list, compact +}, shu: { samples: true, apps: ["app_template"], // List of apps to display diff --git a/services/views/index.ejs b/services/views/index.ejs index 4286bbe4..f9cb1063 100644 --- a/services/views/index.ejs +++ b/services/views/index.ejs @@ -11,31 +11,237 @@ - + - + -ATON Framework +<%= title %> + + +
-
ATON framework by CNR ISPC
- \ No newline at end of file + + \ No newline at end of file