改進 Greasy Fork,在標題旁顯示腳本圖示,新增 HTML 工具列以支援評論與描述,並在程式碼頁面提供按鈕,可直接下載 “.user.js” 檔案。同時透過中繼資料增強頁面,包含作者自訂的重點顏色、版權資訊與社交圖示等功能。
px value in the following function function createIconElement(src, isHeader = false) { to make the icons smaller or larger—whichever looks best to you:
/* around line 664 */
function createIconElement(src, isHeader = false) {
const img = document.createElement('img');
img.src = src;
img.alt = '';
if (isHeader) {
// ICON SHOWN ON THE SCRIPT PAGE
img.style.cssText = `
width: 80px; // CHANGE THE VALUE HERE
height: 80px; // CHANGE THE VALUE HERE
margin-right: 10px;
vertical-align: middle;
border-radius: 4px;
object-fit: contain;
pointer-events: none;
`;
} else {
// ICON SHOWN ON OTHER PAGES
img.style.cssText = `
width: 40px; // CHANGE THE VALUE HERE
height: 40px; // CHANGE THE VALUE HERE
margin-right: 8px;
vertical-align: middle;
border-radius: 3px;
object-fit: contain;
pointer-events: none;
`;
}
img.loading = 'lazy';
return img;
}
For me, on the scripts page or search page, the icon, title and description were too big. I like more compact design, thank you.