Skip to content
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
14 changes: 10 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@
"markdown-it-task-lists": "^2.1.1",
"mime-types": "^2.1.35",
"minimatch": "^9.0.4",
"moment": "^2.30.1",
"mustache": "^4.2.0",
"url-parse": "^1.5.10",
"vanilla-picker": "^2.12.3",
"yargs": "^17.7.2"
},
"browserslist": "cover 100%,not android < 5"
}
}
45 changes: 36 additions & 9 deletions src/pages/plugin/plugin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
gap: 20px;
align-items: start;
margin-bottom: 24px;

.plugin-icon {
width: 80px;
height: 80px;
Expand All @@ -20,17 +21,20 @@
background-repeat: no-repeat;
background-size: contain;
}

.plugin-info {
.title-wrapper {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
margin-bottom: 8px;

.plugin-name {
font-size: 24px;
margin-bottom: 0;
}

.source-indicator {
display: flex;
align-items: center;
Expand All @@ -45,36 +49,48 @@
transition: all 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.1);
text-decoration: none;

&:hover {
background-color: rgba(0, 0, 0, 0.5);
transform: translateY(-1px);
}

.icon {
color: var(--primary-text-color);
font-size: 14px;
}
}
}

.plugin-meta {
display: flex;
gap: 16px;
flex-wrap: wrap;
color: color-mix(in srgb, var(--primary-text-color) 60%, transparent);
font-size: 14px;
margin-bottom: 12px;

.author-name {
display: inline-flex;
align-items: center;
gap: 4px;

a {
text-decoration: none;
color: inherit;
}
}

.verified-tick {
color: #3b82f6;
font-size: 16px;
}

.version-updated {
opacity: 0.6;
font-size: 0.8em;
margin-left: 4px;
}
}

.metrics-row {
Expand All @@ -88,10 +104,12 @@
display: flex;
align-items: center;
gap: 4px;

.metric-value {
color: var(--primary-text-color);
font-weight: 500;
}

.rating-value {
padding: 2px 8px;
border-radius: 12px;
Expand All @@ -114,6 +132,7 @@
}
}
}

.keywords {
display: flex;
gap: 6px;
Expand All @@ -122,21 +141,19 @@
position: relative;

.keyword {
background: color-mix(
in srgb,
var(--link-text-color) 10%,
transparent
);
background: color-mix(in srgb,
var(--link-text-color) 10%,
transparent);
color: var(--link-text-color);
padding: 6px 10px;
border-radius: 12px;
font-size: 13px;
transition: all 0.2s;
border: 1px solid
color-mix(in srgb, var(--link-text-color) 25%, transparent);
border: 1px solid color-mix(in srgb, var(--link-text-color) 25%, transparent);
}
}
}

.action-buttons {
display: flex;
gap: 8px;
Expand Down Expand Up @@ -164,10 +181,12 @@
display: inline-flex;
align-items: center;
gap: 6px;

&:hover {
transform: translateY(-1px);
}
}

.btn-install {
background: var(--button-background-color);
color: white;
Expand All @@ -182,12 +201,14 @@
background-color: var(--danger-color) !important;
color: white;
}

.btn-secondary {
background: var(--primary-color);
color: var(--primary-text-color);
shadow: 0 0 10px var(--box-shadow-color);
box-shadow: 0 0 10px var(--box-shadow-color);
}
}

.more-info-small {
text-align: center;
font-style: italic;
Expand Down Expand Up @@ -231,6 +252,7 @@
width: calc(100% - 10px);
display: block;
user-select: text;

div {
background: var(--primary-color);
}
Expand Down Expand Up @@ -279,17 +301,20 @@
}
}
}

#changelog {
.no-changelog {
text-align: center;
padding: 2rem;
color: color-mix(in srgb, var(--primary-text-color) 60%, transparent);

i {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.7;
display: block;
}

p {
margin: 0.5rem 0;
}
Expand All @@ -309,6 +334,7 @@
top: 20px;
right: 20px;
}

.title-wrapper,
.plugin-meta,
.metrics-row,
Expand All @@ -333,6 +359,7 @@
}
}
}

.reviews-container {
position: fixed;
display: flex;
Expand Down Expand Up @@ -450,4 +477,4 @@
}
}
}
}
}
67 changes: 64 additions & 3 deletions src/pages/plugin/plugin.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import DOMPurify from "dompurify";
import Ref from "html-tag-js/ref";
import actionStack from "lib/actionStack";
import constants from "lib/constants";
import moment from "moment";
import helpers from "utils/helpers";
import Url from "utils/Url";

Expand All @@ -27,6 +28,7 @@ export default (props) => {
author_verified: authorVerified,
author_github: authorGithub,
comment_count: commentCount,
package_updated_at: packageUpdatedAt,
} = props;

let rating = "unrated";
Expand All @@ -42,6 +44,40 @@ export default (props) => {
rating = `${Math.round((votesUp / (votesUp + votesDown)) * 100)}%`;
}

const formatUpdatedDate = (dateString) => {
if (!dateString) return null;

try {
// Configure moment for shorter relative time format
moment.updateLocale("en", {
relativeTime: {
future: "in %s",
past: "%s ago",
s: "now",
ss: "now",
m: "1m",
mm: "%dm",
h: "1h",
hh: "%dh",
d: "1d",
dd: "%dd",
M: "1mo",
MM: "%dmo",
y: "1y",
yy: "%dy",
},
});

const updateTime = moment.utc(dateString);
if (!updateTime.isValid()) return null;

return updateTime.fromNow();
} catch (error) {
console.warn("Error parsing date with moment:", dateString, error);
return null;
}
};

return (
<div className="main" id="plugin">
<div className="plugin-header">
Expand All @@ -62,7 +98,11 @@ export default (props) => {
<div className="plugin-meta">
<span className="meta-item">
<i className="licons tag" style={{ fontSize: "12px" }}></i>
<Version {...props} />
<Version
{...props}
packageUpdatedAt={packageUpdatedAt}
formatUpdatedDate={formatUpdatedDate}
/>
</span>
<span className="meta-item author-name">
<i className="icon person"></i>
Expand Down Expand Up @@ -307,11 +347,32 @@ function Buttons({
);
}

function Version({ currentVersion, version }) {
if (!currentVersion) return <span>v{version}</span>;
function Version({
currentVersion,
version,
packageUpdatedAt,
formatUpdatedDate,
}) {
const updatedText =
formatUpdatedDate && packageUpdatedAt
? formatUpdatedDate(packageUpdatedAt)
: null;

if (!currentVersion) {
return (
<span>
v{version}
{updatedText && (
<span className="version-updated">({updatedText})</span>
)}
</span>
);
}

return (
<span>
v{currentVersion}&nbsp;&#8594;&nbsp;v{version}
{updatedText && <span className="version-updated">({updatedText})</span>}
</span>
);
}
Expand Down
10 changes: 5 additions & 5 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@

<title>Acode</title>
<!--styles-->
<link rel="stylesheet" href="./css/build/218.css">
<link rel="stylesheet" href="./css/build/32.css">
<link rel="stylesheet" href="./css/build/383.css">
<link rel="stylesheet" href="./css/build/53.css">
<link rel="stylesheet" href="./css/build/609.css">
<link rel="stylesheet" href="./css/build/3383.css">
<link rel="stylesheet" href="./css/build/6053.css">
<link rel="stylesheet" href="./css/build/9032.css">
<link rel="stylesheet" href="./css/build/9218.css">
<link rel="stylesheet" href="./css/build/9609.css">
<link rel="stylesheet" href="./css/build/about.css">
<link rel="stylesheet" href="./css/build/customTheme.css">
<link rel="stylesheet" href="./css/build/donate.css">
Expand Down