Skip to content

Commit

Permalink
Added more sidebar customizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Jan 7, 2024
1 parent bf23434 commit fd056f0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
31 changes: 18 additions & 13 deletions src/public/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export default function Layout({ children }) {
setStyleProperty("--form-input-vertical-padding", getThemeVariable("form.input-vertical-padding"));
setStyleProperty("--form-input-horizontal-padding", getThemeVariable("form.input-horizontal-padding"));
setStyleProperty("--app-font-base-size", configuration["theme.app-font-base-size"]);
setStyleProperty("--sidebar-width", configuration["sidebar.width"]);
setStyleProperty("--sidebar-margin", configuration["sidebar.margin"]);
setStyleProperty("--sidebar-border-radius", configuration["sidebar.border-radius"]);
if (theme === "light") {
changeToLightVariable("--text-color");
changeToLightVariable("--text-lighter-color");
Expand Down Expand Up @@ -147,19 +150,21 @@ export default function Layout({ children }) {
<div className="content">{children}</div>
</div>
{configuration["content.sidebar.enabled"] && showSidebar && (
<div className="sidebar" style={{ backgroundImage: `url(${sidebarImage})` }}>
{configuration["system.demo-mode"] &&
<div class="ribbon">
Demo Mode
</div>
}
{configuration["content.sidebar.content-enabled"] && (
<div className="intro">
<div className="title1">{configuration["content.sidebar.intro.title1"]}</div>
<div className="title2">{configuration["content.sidebar.intro.title2"]}</div>
<div className="description">{configuration["content.sidebar.intro.description"]}</div>
</div>
)}
<div className="sidebar-wrapper">
<div className="sidebar" style={{ backgroundImage: `url(${sidebarImage})` }}>
{configuration["system.demo-mode"] &&
<div class="ribbon">
Demo Mode
</div>
}
{configuration["content.sidebar.content-enabled"] && (
<div className="intro">
<div className="title1">{configuration["content.sidebar.intro.title1"]}</div>
<div className="title2">{configuration["content.sidebar.intro.title2"]}</div>
<div className="description">{configuration["content.sidebar.intro.description"]}</div>
</div>
)}
</div>
</div>
)}
</div>
Expand Down
18 changes: 18 additions & 0 deletions src/public/configuration/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@
"description": "Specifies if input fields in forms can display placeholder.",
"default": true
},
{
"name": "sidebar.width",
"displayName": "Sidebar Margin",
"description": "Specifies width of the sidebar.",
"default": "35%"
},
{
"name": "sidebar.margin",
"displayName": "Sidebar Margin",
"description": "Specifies the margin for sidebar. Single value margin in any unit.",
"default": "0px"
},
{
"name": "sidebar.border-radius",
"displayName": "Sidebar Border Radius",
"description": "Specifies the border radius for sidebar.",
"default": "0px"
},
{
"name": "form.animate-entrance",
"displayName": "Form Animate Entrance",
Expand Down
19 changes: 18 additions & 1 deletion src/public/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
--spinner-background-color: #0a0a0a;
--spinner-primary-color: #ffffff40;
--spinner-secondary-color: #2b2b2b;
/* Common */
--sidebar-width: 35%;
--sidebar-margin: 3em;
--sidebar-border-radius: 1em;
}

html {
Expand Down Expand Up @@ -179,9 +183,22 @@ h3 {
justify-content: center;
}

.page .sidebar-wrapper {
position: relative;
width: var(--sidebar-width);
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
background-position: center;
}

.page .sidebar {
position: relative;
width: 35%;
height: calc(100% - var(--sidebar-margin));
width: calc(100% - var(--sidebar-margin));
border-radius: var(--sidebar-border-radius);
overflow: hidden;
box-shadow: inset 5px 0px 6px 1px #00000035;
display: flex;
align-items: center;
Expand Down

0 comments on commit fd056f0

Please sign in to comment.