From 9004e01a98a462da6d9af9968d2032bcb99c9722 Mon Sep 17 00:00:00 2001 From: Fascinated Date: Wed, 12 Jul 2023 09:40:24 +0100 Subject: [PATCH] add icon only links --- README.md | 21 ++++++++++++++++----- config.json | 14 ++++++++++++-- src/app/page.tsx | 35 +++++++++++++++++++++++++++-------- 3 files changed, 55 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 791f6f6..cb47b1d 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ Simple Links is a lightweight alternative to Linktree and others. "avatar": "https://cdn.fascinated.cc/KWprz2.jpg", // The avatar that is shown at the top of the site // or use a local image "avatar": "/avatar.webp", + // If you want to use a custom (not dark) background "background": { - // If you want to use a custom (not dark) background "showBackground": true, // Whether it is enabled or not "blur": true, // Should we blur the background? "darken": { @@ -52,16 +52,16 @@ Simple Links is a lightweight alternative to Linktree and others. "backgroundImage": "/background.jpg" }, "theme": "dark", // "dark" or "light" themes + // The card that displays your info and buttons "infoCard": { - // The card that displays your info and buttons "transparency": 0.85 // How transparent should it be? }, + // Website options "options": { - // Website options "showSourceLink": true // Should we show the "Source Code" link }, + // Search engine and embedding metadata (discord, twitter, etc embeds) "metadata": { - // Search engine and embedding metadata (discord, twitter, etc embeds) "title": "Your Name", // The title of the embed "description": "website description", // The description of the embed "themeColor": "#6441a5", // The color of the embed @@ -73,8 +73,8 @@ Simple Links is a lightweight alternative to Linktree and others. } ] }, + // The buttons to show links for "links": [ - // The buttons to show links for { "title": "Git", // The shown title of the button "url": "https://git.fascinated.cc", // Where the button goes to when clicked @@ -99,6 +99,17 @@ Simple Links is a lightweight alternative to Linktree and others. "normal": "bg-neutral-700" } } + ], + // Icon only links + "socialLinks": [ + { + "icon": "fab fa-github", // The icon to show + "url": "https://git.fascinated.cc" // Where the link goes to + }, + { + "icon": "fab fa-reddit", + "url": "https://www.reddit.com/user/ImFascinatedMC" + } ] } ``` diff --git a/config.json b/config.json index 35ff188..4c71413 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "configVersion": "0.1.2", + "configVersion": "0.1.3", "name": "Your Name", "description": "A description about yourself", "avatar": "/avatar.webp", @@ -34,7 +34,7 @@ { "title": "Git", "url": "https://git.fascinated.cc", - "icon": "fab fa-github", + "icon": "fab fa-git-alt", "color": { "normal": "bg-green-700" } @@ -54,5 +54,15 @@ "normal": "bg-neutral-700" } } + ], + "socialLinks": [ + { + "icon": "fab fa-github", + "url": "https://git.fascinated.cc" + }, + { + "icon": "fab fa-reddit", + "url": "https://www.reddit.com/user/ImFascinatedMC" + } ] } diff --git a/src/app/page.tsx b/src/app/page.tsx index ad0420d..af375ef 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -15,9 +15,10 @@ export default function Home() { avatar, name, links, + socialLinks, options, description, - theme, // Fallback to dark if no theme was found + theme, } = Config; // All of the settings pulled from the config file // Theme colors to use when using the selected theme @@ -85,8 +86,10 @@ export default function Home() {

{name}

+ {/* Description of user */}

{description}

+ {/* Links (Buttons) */}
{links.map((link, index) => { const icons: any = link.icon?.split(" ") ?? []; @@ -98,22 +101,38 @@ export default function Home() { target="_blank" rel="noopener noreferrer" className={`flex flex-row items-center justify-center mt-4 px-4 w-60 py-2 rounded - ${selectedTheme.buttonTextColor} ${link.color.normal} hover:brightness-75 transition`} + ${selectedTheme.buttonTextColor} ${link.color.normal} hover:brightness-75 transition gap-2`} > - {link.icon && ( - <> - -
- - )} + {link.icon && }

{link.title}

); })}
+ + {/* Social Links */} +
+ {socialLinks && + socialLinks.map((link, index) => { + const icons: any = link.icon?.split(" ") ?? []; + + return ( + + {link.icon && } + + ); + })} +
+ {/* Footer */}
{options.showSourceLink && (