mirror of
https://github.com/m3y54m/Embedded-Engineering-Roadmap.git
synced 2026-10-12 01:08:13 +03:00
refactor(explorer): remove the redundant credits block from the overview panel
This commit is contained in:
+1
-14
@@ -1,7 +1,7 @@
|
||||
import { parseRoadmap, renderInline, TYPES } from './parser.js';
|
||||
import { linkDiagram } from './diagram.js';
|
||||
import { createMapView } from './mapview.js';
|
||||
import { CREDITS, IMPORTANCE, TITLE, areaDots, areaLabel, h, plural } from './dom.js';
|
||||
import { IMPORTANCE, TITLE, areaDots, areaLabel, h, plural } from './dom.js';
|
||||
|
||||
const SOURCES = [
|
||||
'README.md',
|
||||
@@ -319,22 +319,9 @@ function overview(root) {
|
||||
section(null, h('p', { class: 'res-note' }, 'Built from the ',
|
||||
h('a', { href: `${REPO_URL}#readme`, target: '_blank', rel: 'noopener noreferrer' }, 'roadmap README'),
|
||||
' and the map definition in the repository.')),
|
||||
section('Credits', credits()),
|
||||
].filter(Boolean);
|
||||
}
|
||||
|
||||
function credits() {
|
||||
const external = (href, ...children) => h('a', { href, target: '_blank', rel: 'noopener noreferrer' }, ...children);
|
||||
const build = state.build;
|
||||
return h('div', { class: 'credits' },
|
||||
h('img', { class: 'credits-logo', src: 'assets/logo.svg', alt: '', width: 48, height: 48 }),
|
||||
h('div', { class: 'credits-body' },
|
||||
h('p', {}, 'Creator & maintainer: ', external(CREDITS.authorUrl, h('strong', {}, CREDITS.author))),
|
||||
build ? h('p', {}, 'Revision ', h('strong', {}, build.version), ` · last update ${build.date}`) : null,
|
||||
h('p', {}, 'Licensed under the ', external(CREDITS.licenseUrl, CREDITS.licenseName), '.'),
|
||||
external(CREDITS.licenseUrl, h('img', { class: 'credits-badge', src: 'assets/cc-by-sa.svg', alt: CREDITS.license, width: 88, height: 31 }))));
|
||||
}
|
||||
|
||||
function renderPanel(node) {
|
||||
const root = state.data.root;
|
||||
const panel = els.panel;
|
||||
|
||||
@@ -9,10 +9,8 @@ export const plural = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`;
|
||||
|
||||
export const CREDITS = {
|
||||
author: 'Meysam Parvizi',
|
||||
authorUrl: 'https://github.com/m3y54m',
|
||||
repo: 'github.com/m3y54m/Embedded-Engineering-Roadmap',
|
||||
license: 'CC BY-SA 4.0',
|
||||
licenseName: 'Creative Commons Attribution-ShareAlike 4.0 International License',
|
||||
licenseUrl: 'https://creativecommons.org/licenses/by-sa/4.0/',
|
||||
};
|
||||
|
||||
|
||||
@@ -1010,32 +1010,6 @@ button {
|
||||
font: 12px var(--font);
|
||||
}
|
||||
|
||||
.credits {
|
||||
display: grid;
|
||||
grid-template-columns: 48px minmax(0, 1fr);
|
||||
gap: 14px;
|
||||
align-items: start;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.credits-logo {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.credits-body p {
|
||||
margin: 0 0 4px;
|
||||
}
|
||||
|
||||
.credits-body strong {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.credits-badge {
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.sheet-close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user