Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
blurymind committed Sep 6, 2024
1 parent df98fae commit 80d1b99
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion public/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.4.351"
"version": "0.4.352"
}
18 changes: 18 additions & 0 deletions public/web-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ class ResourcesComponent extends HTMLElement {
:is(.add-files, button):hover {
background-color: var(--bg-color);
}
.preview-image {
position: relative;
}
.preview-image:hover::after {
position: absolute;
bottom: 2%;
left: 30%;
padding: 3px;
display: block;
content: ' ☆ name: ' attr(title) ' ☆ ';
color: white;
background-color: #00000096;
border-radius: 3px;
}
</style>
<div id="resources-editor" style="display:flex;flex-direction:column;width: 100%;height:100%; overflow: hidden;">
<div class="flex-wrap" style="gap: 10px;padding-bottom:2px;">
Expand Down Expand Up @@ -304,8 +318,11 @@ class ResourcesComponent extends HTMLElement {

const selectedItem = resource.src;
if (selectedItem.startsWith('data:image')) {
console.log({resource})
return `
<div title="${resource.id}" class="preview-image"">
<img src="${selectedItem}" style="pointer-events:none;max-width:60vw;object-fit: contain; border: 0;"></img>
</div>
`;
} else {
return ``;
Expand Down Expand Up @@ -417,6 +434,7 @@ class ResourcesComponent extends HTMLElement {
const shadowRoot = document.querySelector('resources-component').shadowRoot;
this.updateRawUrl(file.raw_url);
shadowRoot.getElementById('gistIdFileLink').href = gistId || '';
if(!gistId) shadowRoot.getElementById('gistIdFileLink').innerText = 'Gist is missing'
if (darkMode) shadowRoot.getElementById('resources-editor').setAttribute("data-theme", "dark");
this.updateResourcesList(this.resourcesFileContent, !file.raw_url);
if(headerButtons) {
Expand Down
2 changes: 1 addition & 1 deletion sw.js

Large diffs are not rendered by default.

0 comments on commit 80d1b99

Please sign in to comment.