Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable easy customization through css variables #57

Merged
merged 4 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ It means some commands will need to be run with the `--recurse-submodules` flag,
eg: `git clone --recurse-submodules [email protected]:Holusion/eCorpus`

Day-to-day operations can be simplified by configuring git (globally or for thsi repository) to always recurse by default : `git config submodule.recurse true`.

2 changes: 1 addition & 1 deletion source/server/routes/api/v1/scenes/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default async function getScenes(req :Request, res :Response){
offset: offset? parseInt(offset as string): undefined,
});
}
await (await import("node:timers/promises")).setTimeout(1000);

//canonicalize scenes' thumb names
scenes = scenes.map(s=>({...s, thumb: (s.thumb? new URL(encodeURI(path.join("/scenes/", s.name, s.thumb)), getHost(req)).toString() : undefined)}))

Expand Down
2 changes: 2 additions & 0 deletions source/server/routes/api/v1/scenes/scene/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { getUserId, getVfs } from "../../../../../utils/locals.js";
import { Request, Response } from "express";
import { parse_glb } from "../../../../../utils/glTF.js";
import uid from "../../../../../utils/uid.js";


/**
Expand All @@ -18,6 +19,7 @@ async function getDocument(scene:string, filepath:string){
let meta = await parse_glb(filepath);
let mesh = meta.meshes[0]; //Take the first mesh for its name
document.nodes.push({
"id": uid(),
"name": mesh?.name ?? scene,
"model": 0,
"meta": 0
Expand Down
5 changes: 5 additions & 0 deletions source/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export default async function createServer(config = defaultConfig) :Promise<expr
});
});


if(config.assets_dir){
app.use("/dist", express.static(config.assets_dir));
}

/* istanbul ignore next */
if(config.hot_reload){
console.log("Hot reload enabled");
Expand Down
13 changes: 11 additions & 2 deletions source/server/templates/layouts/email.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
h1{
font-size:1.2rem;
font-weight: bold;
color: #00517d;
color: black;
color: #eee;
display: inline-block;
padding: 1.5rem 0.2rem 0 1.5rem;
margin: 20px 0 0.4rem 0;
border-bottom: 0.6rem solid #E6B900;
}

.btn {
cursor: pointer;
color: white !important;
background-color: #0089bf;
background-color: #4735df;
text-decoration: none;
padding: 0.5rem 1rem;
margin: 2rem 0.5rem;
border-radius: 4px;
}
.btn:hover, .btn:focus {
background-color: #5e5e5e;
}
</style>

</head>
Expand Down
19 changes: 16 additions & 3 deletions source/server/templates/layouts/main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@
<link rel="apple-touch-icon" href="{{thumb}}">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">


<title>{{title}}</title>

<link rel="shortcut icon" type="image/png" href="/dist/favicon.png"/>
<link rel="icon" type="image/png" href="/dist/favicon.png" sizes="32x32"/>
<link rel="shortcut icon" type="image/svg+xml" href="/dist/favicon.svg"/>

<style>
body { background: #303030; }
body{
background: var(--color-background, #343434);
font-family: var(--font-body, sans-serif);
position: relative;
box-sizing: border-box;
width: 100%;
min-height: 100vh;
padding: var(--nav-height, 44px) 0 0 0;
margin: 0;
display: block;
}
</style>

<link rel="stylesheet" href="/dist/css/theme.css">
<link rel="stylesheet" href="/dist/css/corpus.css">

</head>
Expand Down
2 changes: 1 addition & 1 deletion source/server/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const values = {
templates_dir: [path.join(process.cwd(),"templates"), toPath],
files_dir: [({root_dir}:{root_dir:string})=> path.resolve(root_dir,"files"), toPath],
dist_dir: [({root_dir}:{root_dir:string})=> path.resolve(root_dir,"dist"), toPath],
assets_dir: [({root_dir}:{root_dir:string})=> path.resolve(root_dir,"assets"), toPath],
assets_dir: [undefined, toPath],
trust_proxy: [true, toBool],
hostname: [hostname(), toString],
hot_reload:[false, toBool],
Expand Down
Binary file modified source/ui/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions source/ui/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 11 additions & 29 deletions source/ui/assets/images/logo-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading