Skip to content

Commit

Permalink
feat: make theming easier and slight style adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
prplwtf committed Oct 15, 2024
1 parent 9c124ac commit c34fa80
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 18 deletions.
7 changes: 7 additions & 0 deletions src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@
background-color: var(--bs-body-bg) !important;
border: 1px solid var(--bs-border-color);
border-radius: 12px;
}

[writea='read.header.thumbnail'] {
transition: height .3s;
}
[writea='read.header']:hover > [writea='read.header.thumbnail'] {
height: 250px;
}
2 changes: 1 addition & 1 deletion src/components/elements/ConnectionElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function ConnectionElement(Icon, Link, Username, Defined) {
if(!Defined) return ""

return `
<div class="col py-2">
<div writea="element.connection" class="col py-2">
<a href="https://${Link}" class="text-decoration-none">
<div
class="border border-dark border-opacity-25 py-2 px-3 rounded-4 position-relative"
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/FooterElement.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function FooterElement() {
return `
<a href="#about" class="text-decoration-none">
<a writea="element.footer" href="#about" class="text-decoration-none">
<p class="mt-4 text-secondary opacity-75 text-center">
written with
<span class='text-primary-emphasis'>
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/LinkElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function LinkElement() {
}

return `
<a href="http://${Link}" class="text-decoration-none">
<a writea="element.link" href="http://${Link}" class="text-decoration-none">
<button class="btn shadow-none px-0 rounded-0 me-3">
<i class="bi bi-${LinkIcon} text-primary-emphasis" style="font-size:${LinkIconSize}px;"></i>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/MissingConfigurationElement.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function MissingConfigurationElement(OldConfiguration, NewConfiguration) {
return `
<div class="row pb-4">
<div writea="element.missingconfig" class="row pb-4">
<div class="col-6">
<div class="bg-dark-subtle rounded-4 py-2 px-3">
<p class="m-0 text-center">
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/NavigationBarElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function NavigationBarElement() {

return `
${ConfigurationReminder}
<div class="row mb-3">
<div writea="element.navigation" class="row mb-3">
<div class="col me-auto">
<a href="#" class="text-decoration-none">
<h3 class="fw-bolder text-primary-emphasis text-truncate mb-0 mt-2">
Expand Down
10 changes: 5 additions & 5 deletions src/components/sections/BlogSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ function BlogSection() {
let PostThumbnail = ""
if (Post.Thumbnail) {
PostThumbnail = `
<img src="./images/${Post.Thumbnail}" class="rounded-top-4 object-fit-cover" height="110px" width="100%"/>
<img src="./images/${Post.Thumbnail}" writea="post.entry.thumbnail" class="rounded-top-4 object-fit-cover" height="110px" width="100%"/>
`
}

Posts = `
${Posts}
<div class="col-12 mb-4">
<div writea="post.entry" class="col-12 mb-4">
<a href="#read/${Post.Content.replace('.md', '')}" class="text-decoration-none text-body">
<div class="rounded-4 bg-dark-subtle position-relative" style="--mdc-ripple-hover-opacity: .02; --mdc-ripple-focus-opacity: .02; --mdc-ripple-press-opacity: .05;">
${PostThumbnail}
<div class="row d-flex p-4">
<div class="col-10 me-auto">
<span class="d-block text-primary-emphasis mb-1">
<span writea="post.entry.info" class="d-block text-primary-emphasis mb-1">
${Post.Topic || "post"}
<span class="text-dark"><i class="bi bi-dot"></i> ${Post.Content}</span>
</span>
<span class="h5 fw-bold">
<span writea="post.entry.title" class="h5 fw-bold">
${Post.Title || "No title available"}
</span>
<span class="d-block">
<span writea="post.entry.description" class="d-block">
${Post.Description || "No description available"}
</span>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/components/sections/ReadSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function ReadSection() {
let PostThumbnail = ""
if(Post.Thumbnail) {
PostThumbnail = `
<img src="./images/${Post.Thumbnail}" class="rounded-top-4 object-fit-cover" height="170px" width="100%"/>
<img src="./images/${Post.Thumbnail}" writea="read.header.thumbnail" class="rounded-top-4 object-fit-cover" height="200px" width="100%"/>
`
}

Expand Down Expand Up @@ -41,24 +41,24 @@ async function ReadSection() {
return `
${NavigationBarElement()}
<div class="pt-2"></div>
<div class="pb-4 bg-dark-subtle rounded-4">
<div writea="read.header" class="pb-4 bg-dark-subtle rounded-4">
${PostThumbnail}
<div class="px-5 mb-4 pt-5">
<p class="mb-1 text-primary-emphasis">
<p writea="read.header.info" class="mb-1 text-primary-emphasis">
${Post.Topic || "post"}
<span class="d-none d-sm-block text-dark float-end">
${Visibility}
</span>
</p>
<p class="h2 fw-bolder mb-1">
<p writea="read.header.title" class="h2 fw-bolder mb-1">
${Post.Title || "No title available"}
</p>
<p class="opacity-75">
<p writea="read.header.description" class="opacity-75">
${Post.Description || "No description available"}
</div>
</div>
</div>
<div class="p-xs-0 p-sm-5 py-5">
<div writea="read.content" class="p-xs-0 p-sm-5 py-5">
<div id="MarkdownContainer"></div>
</div>
${FooterElement()}
Expand Down
4 changes: 2 additions & 2 deletions src/components/sections/RootSection.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function RootSection() {
return `
${NavigationBarElement()}
<p>
<p writea="root.description">
${window.Configuration.Information.Description || "no description provided"}
</p>
<div class="row">
<div writea="root.connections" class="row">
${ConnectionElement(
"github",
`github.com/${window.Configuration.Connections.GitHub}`,
Expand Down

2 comments on commit c34fa80

@amogusreal69
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally gitea commit

@imlayered
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writea update!

Please sign in to comment.