更好的 Greasy Fork

改進 Greasy Fork,在標題旁顯示腳本圖示,新增 HTML 工具列以支援評論與描述,並在程式碼頁面提供按鈕,可直接下載 “.user.js” 檔案。同時透過中繼資料增強頁面,包含作者自訂的重點顏色、版權資訊與社交圖示等功能。

< 腳本更好的 Greasy Fork的回應

提問/評論

§
發表於:2025-10-27

For me, on the scripts page or search page, the icon, title and description were too big. I like more compact design, thank you.

OHAS作者
§
發表於:2025-10-27

Hello! Thank you for using Better Greasy Fork!

You can change the 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;
}


I recommend using equal width and height values (1 × 1) so the icon doesn’t get distorted.
I hope you find a size you like better. Remember, Better Greasy Fork DOES NOT change the title size—every title and piece of text on Greasy Fork stays at its default page value; we only add the icons next to them!

發表回覆

登入以回覆