Compare commits

..

56 Commits

Author SHA1 Message Date
81e19866ff update all depends
All checks were successful
Publish Docker Image / docker (push) Successful in 1m49s
2024-08-29 22:50:10 +01:00
42f631da08 fix background image
All checks were successful
Publish Docker Image / docker (push) Successful in 2m27s
2024-08-29 22:45:47 +01:00
Lee
db6ecf5c6a Merge pull request 'fix(deps): update dependency use-lanyard to v1.5.2' (#23) from renovate/use-lanyard-1.x-lockfile into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m4s
Reviewed-on: #23
2024-01-16 23:23:35 +00:00
Lee
9281f02688 Merge pull request 'fix(deps): update font awesome to v6.5.1' (#26) from renovate/font-awesome into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m50s
Reviewed-on: #26
2024-01-16 23:21:01 +00:00
85324c1398 fix(deps): update font awesome to v6.5.1 2024-01-16 23:18:12 +00:00
c8ad2055e6 fix(deps): update dependency use-lanyard to v1.5.2 2024-01-16 23:17:59 +00:00
Lee
ec7a02ab7e Merge pull request 'chore(deps): update tj-actions/branch-names action to v8' (#29) from renovate/tj-actions-branch-names-8.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m7s
Reviewed-on: #29
2024-01-16 23:08:15 +00:00
Lee
c07795b18d Merge pull request 'fix(deps): update dependency sharp to ^0.33.0' (#27) from renovate/sharp-0.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 3m8s
Reviewed-on: #27
2024-01-16 23:04:18 +00:00
d4d8de0dde chore(deps): update tj-actions/branch-names action to v8 2024-01-16 23:00:13 +00:00
a6a406a9c7 fix(deps): update dependency sharp to ^0.33.0 2024-01-16 22:59:37 +00:00
Lee
7e0b8b0000 Merge pull request 'fix(deps): update dependency tailwindcss to v3.4.1' (#22) from renovate/tailwindcss-3.x-lockfile into master
All checks were successful
Publish Docker Image / docker (push) Successful in 2m26s
Reviewed-on: #22
2024-01-16 22:45:46 +00:00
cd1c5f2074 fix(deps): update dependency tailwindcss to v3.4.1 2024-01-05 21:03:05 +00:00
Lee
27e1347da8 Merge pull request 'fix(deps): update nextjs monorepo to v13.5.6' (#16) from renovate/nextjs-monorepo into master
All checks were successful
Publish Docker Image / docker (push) Successful in 2m14s
Reviewed-on: #16
2023-10-20 05:08:36 +00:00
d3f43bed90 fix(deps): update nextjs monorepo to v13.5.6 2023-10-20 05:05:56 +00:00
Lee
1075d6a0d4 Merge pull request 'fix(deps): update dependency @types/node to v20.8.7' (#17) from renovate/node-20.x-lockfile into master
All checks were successful
Publish Docker Image / docker (push) Successful in 3m4s
Reviewed-on: #17
2023-10-20 05:05:08 +00:00
Lee
7eb08021d0 Merge pull request 'fix(deps): update react monorepo' (#18) from renovate/react-monorepo into master
Some checks are pending
Publish Docker Image / docker (push) Waiting to run
Reviewed-on: #18
2023-10-20 05:05:01 +00:00
189e98c951 fix(deps): update react monorepo 2023-10-19 18:06:18 +00:00
0872ff1158 fix(deps): update dependency @types/node to v20.8.7 2023-10-18 10:05:08 +00:00
Lee
2a3d8f9fb9 Merge pull request 'chore(deps): update docker/setup-buildx-action action to v3' (#15) from renovate/docker-setup-buildx-action-3.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 2m11s
Reviewed-on: #15
2023-10-16 09:12:47 +00:00
5889c68f48 chore(deps): update docker/setup-buildx-action action to v3 2023-10-15 03:02:57 +00:00
Lee
65acccf525 Merge pull request 'chore(deps): update docker/login-action action to v3' (#14) from renovate/docker-login-action-3.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 3m29s
Reviewed-on: #14
2023-10-15 02:20:51 +00:00
Lee
71355f3bce Merge pull request 'chore(deps): update docker/build-push-action action to v5' (#13) from renovate/docker-build-push-action-5.x into master
Some checks failed
Publish Docker Image / docker (push) Has been cancelled
Reviewed-on: #13
2023-10-15 02:20:42 +00:00
ddb6fef194 chore(deps): update docker/login-action action to v3 2023-10-15 02:12:43 +00:00
1d65569ca6 chore(deps): update docker/build-push-action action to v5 2023-10-15 02:12:42 +00:00
Lee
176e6a7c6b Merge pull request 'chore(deps): update actions/checkout action to v4' (#10) from renovate/actions-checkout-4.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 5m9s
Reviewed-on: #10
2023-10-15 01:56:49 +00:00
Lee
c5427e6b22 Merge pull request 'chore(deps): update dependency ubuntu to v22' (#11) from renovate/ubuntu-22.x into master
Some checks failed
Publish Docker Image / docker (push) Has been cancelled
Reviewed-on: #11
2023-10-15 01:56:24 +00:00
9c104fddb7 chore(deps): update dependency ubuntu to v22 2023-10-15 01:55:58 +00:00
2064574471 chore(deps): update actions/checkout action to v4 2023-10-15 01:55:57 +00:00
Lee
58773a6771 Merge pull request 'Configure Renovate' (#9) from renovate/configure into master
All checks were successful
Publish Docker Image / docker (push) Successful in 3m9s
Reviewed-on: #9
2023-10-15 01:50:58 +00:00
859a59cc6f chore(deps): add renovate.json 2023-10-15 01:48:38 +00:00
0258556030 remove not needed command
All checks were successful
Publish Docker Image / docker (push) Successful in 4m12s
2023-10-15 02:02:03 +01:00
556f7b4b4d remove cache clear
Some checks failed
Publish Docker Image / docker (push) Has been cancelled
2023-10-15 02:00:26 +01:00
83616667bb pnpm is weird
Some checks failed
Publish Docker Image / docker (push) Failing after 56s
2023-10-15 01:48:37 +01:00
e10d108ca8 im a little silly - update image
Some checks failed
Publish Docker Image / docker (push) Failing after 34s
2023-10-15 01:47:19 +01:00
450775fe79 update image and usee pnpm
Some checks failed
Publish Docker Image / docker (push) Failing after 34s
2023-10-15 01:46:09 +01:00
8befe6563a bump version
All checks were successful
Publish Docker Image / docker (push) Successful in 1m40s
2023-10-14 17:56:48 +01:00
5ae5746739 update depends
All checks were successful
Publish Docker Image / docker (push) Successful in 1m55s
2023-10-14 17:53:47 +01:00
a68d10e0f8 update source link to an icon
All checks were successful
Publish Docker Image / docker (push) Successful in 1m36s
2023-10-14 17:45:04 +01:00
8967658ef1 update default favicon
All checks were successful
Publish Docker Image / docker (push) Successful in 1m53s
2023-10-14 17:30:40 +01:00
f9b5a471f4 add drop shadow to the buttons
All checks were successful
Publish Docker Image / docker (push) Successful in 2m0s
2023-08-02 02:10:40 +01:00
9e9a4885dc add slight transparency to buttons when no info background is visible
All checks were successful
Publish Docker Image / docker (push) Successful in 41s
2023-07-27 03:28:03 +01:00
ec3ecd8c84 add favicon to auto download
All checks were successful
Publish Docker Image / docker (push) Successful in 2m21s
2023-07-27 03:19:54 +01:00
aa89245db3 add example favicon
All checks were successful
Publish Docker Image / docker (push) Successful in 2m57s
2023-07-27 03:17:38 +01:00
6ad1b6b85d fix config loading
All checks were successful
Publish Docker Image / docker (push) Successful in 2m2s
2023-07-13 10:39:37 +01:00
5336a89dcc add support to readme 2023-07-13 10:20:36 +01:00
254e6740ef update lock file
All checks were successful
Publish Docker Image / docker (push) Successful in 2m1s
2023-07-13 10:18:38 +01:00
17af5d61f2 update comment in config
Some checks failed
Publish Docker Image / docker (push) Failing after 35s
2023-07-13 10:17:31 +01:00
2540bd4004 bump version
Some checks failed
Publish Docker Image / docker (push) Failing after 1m5s
2023-07-13 10:13:05 +01:00
e54bd6d0e0 update docker compose 2023-07-13 10:12:48 +01:00
b9093d75fe migrate to yml config (so I can comment the config)
Some checks failed
Publish Docker Image / docker (push) Failing after 33s
2023-07-13 10:12:07 +01:00
c0e1bec350 add ability to remove the info card color
All checks were successful
Publish Docker Image / docker (push) Successful in 1m49s
2023-07-13 09:38:50 +01:00
ae46c845d3 made offline not show a status indicator
All checks were successful
Publish Docker Image / docker (push) Successful in 1m40s
2023-07-13 05:48:02 +01:00
afb1e66271 change status colors to match discord
All checks were successful
Publish Docker Image / docker (push) Successful in 1m36s
2023-07-13 05:41:36 +01:00
Lee
4e60aea93a Merge pull request 'Update v0.1.9' (#6) from development into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m46s
Reviewed-on: #6
2023-07-13 04:32:57 +00:00
Lee
82e8d97858 Merge pull request 'Add Discord status' (#5) from development into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m40s
Reviewed-on: #5
2023-07-12 17:25:59 +00:00
Lee
8f91eba0f7 Merge pull request 'Add auto downloading of files' (#4) from development into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m39s
Reviewed-on: #4
2023-07-12 13:45:19 +00:00
21 changed files with 9749 additions and 4954 deletions

@ -14,14 +14,14 @@ on:
jobs:
docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
uses: tj-actions/branch-names@v8
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Restore Docker Cache
uses: actions/cache@v3
@ -39,10 +39,10 @@ jobs:
echo "Done"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to Repo
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.REPO_USERNAME }}
password: ${{ secrets.REPO_TOKEN }}
@ -55,7 +55,7 @@ jobs:
key: ${{ runner.os }}-buildx
- name: Build and Push (Latest)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: steps.branch-name.outputs.current_branch == 'master'
with:
push: true
@ -65,7 +65,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and Push (Other Branches)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: steps.branch-name.outputs.current_branch != 'master'
with:
push: true

2
.gitignore vendored

@ -145,4 +145,4 @@ dist
.pnp.*
# Config
config.json
config.yml

@ -1,15 +1,12 @@
FROM node:lts-slim
FROM fascinated/docker-images:node-pnpm-latest
ENV NODE_ENV=production
WORKDIR /usr/src/app
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install wget -y
# Copy package.json and package-lock.json separately to fully utilize Docker layer caching
COPY package.json ./
COPY package-lock.json ./
RUN npm ci --production --silent && npm cache clean --force
COPY pnpm-lock.yaml ./
RUN pnpm install --production --silent
# Opt out of Next.js telemetry
RUN npx next telemetry disable
@ -17,9 +14,6 @@ RUN npx next telemetry disable
# Copy the rest of the files
COPY . .
# Remove development dependencies
RUN npm prune --production
# Environment Variables
ENV NODE_ENV=production

104
README.md

@ -29,6 +29,10 @@ Simple Links is a lightweight alternative to Linktree and others.
3. Run `docker compose up -d`
4. The application is now updated
## Support
If you need any help, you can contact me on my Discord server [here](https://discord.gg/yjj2U3ctEG) or open a issue!
## What if I don't want buttons or icon only links?
Just simply remove it from the config and it will not show anymore
@ -36,103 +40,3 @@ Just simply remove it from the config and it will not show anymore
## Showing Discord status
You must be in the [lanyard server](https://discord.gg/UrXF2cfJ7F) for it to work.
## Help!!! I'm getting an error when launching it
### Config Issue
If your error looks similar to this you are most likely missing part of the config, as some new things may have been added.
```bash
simple-links | Type error: Property 'theme' does not exist on type '{ name: string; description: string; avatar: string; background: { showBackground: boolean; blur: boolean; darken: { enabled: boolean; amount: number; }; backgroundImage: string; }; infoCard: { transparency: number; }; metadata: { ...; }; options: { ...; }; analytics: { ...; }; links: { ...; }[]; }'.
```
## Config Example
```json
{
"name": "Your Name", // The name you want to display on the site
"description": "A description about yourself", // The description you want to use
"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": {
"showBackground": true, // Whether it is enabled or not
"blur": true, // Should we blur the background?
"darken": {
// Should we darken the background?
"enabled": true,
"amount": 0.7
},
"backgroundImage": "https://cdn.fascinated.cc/8twdW8.jpg", // The image to use in the background
// or use a local image
"backgroundImage": "/background.jpg"
},
"theme": "dark", // "dark" or "light" themes
// The card that displays your info and buttons
"infoCard": {
"transparency": 0.85 // How transparent should it be?
},
// Website options
"options": {
"showSourceLink": true // Should we show the "Source Code" link
},
// Show your discord status on the site (You MUST be in the Lanyard server)
// https://discord.gg/UrXF2cfJ7F
"discord": {
"id": "474221560031608833" // Your discord ID
},
// Search engine and embedding metadata (discord, twitter, etc embeds)
"metadata": {
"title": "Your Name", // The title of the embed
"description": "website description", // The description of the embed
"themeColor": "#6441a5", // The color of the embed
"authors": [
// SEO metadata
{
"name": "Fascinated",
"url": "https://fascinated.cc"
}
]
},
// The buttons to show links for
"links": [
{
"title": "Git", // The shown title of the button
"url": "https://git.fascinated.cc", // Where the button goes to when clicked
"icon": "fab fa-github", // The icon of the button (can be removed to show no icon)
// The color of the icon (tailwindcss colors)
"color": "bg-green-700"
},
{
"title": "Twitch",
"url": "https://twitch.tv/fascinated_",
"icon": "fab fa-twitch",
"color": "bg-[#6441a5]"
},
{
"title": "Documentation",
"url": "https://docs.fascinated.cc",
"color": "bg-neutral-700"
}
],
// Icon only links
"socialLinks": [
{
"icon": "fab fa-twitter", // The icon to use
"color": "#1DA1F2", // An optional color
"url": "https://twitter.com" // The link to go to
},
{
"icon": "fab fa-reddit",
"color": "#FF4300",
"url": "https://www.reddit.com/user/ImFascinatedMC"
},
{
"icon": "fab fa-git-alt",
"url": "https://git.fascinated.cc"
}
]
}
```

@ -1,73 +0,0 @@
{
"configVersion": "0.1.4",
"name": "Your Name",
"description": "A description about yourself",
"avatar": "/avatar.webp",
"background": {
"showBackground": true,
"blur": true,
"darken": {
"enabled": true,
"amount": 0.7
},
"backgroundImage": "/background.jpg"
},
"theme": "dark",
"infoCard": {
"transparency": 0.85
},
"discord": {
"id": "set me"
},
"options": {
"showSourceLink": true
},
"metadata": {
"title": "Your Name",
"description": "website description",
"themeColor": "#6441a5",
"authors": [
{
"name": "Fascinated",
"url": "https://fascinated.cc"
}
]
},
"links": [
{
"title": "Git",
"url": "https://git.fascinated.cc",
"icon": "fab fa-git-alt",
"color": {
"normal": "bg-green-700"
}
},
{
"title": "Twitch",
"url": "https://twitch.tv/fascinated_",
"icon": "fab fa-twitch",
"color": "bg-[#6441a5]"
},
{
"title": "Documentation",
"url": "https://docs.fascinated.cc",
"color": "bg-neutral-700"
}
],
"socialLinks": [
{
"icon": "fab fa-twitter",
"color": "#1DA1F2",
"url": "https://twitter.com"
},
{
"icon": "fab fa-reddit",
"color": "#FF4300",
"url": "https://www.reddit.com/user/ImFascinatedMC"
},
{
"icon": "fab fa-git-alt",
"url": "https://git.fascinated.cc"
}
]
}

75
config-example.yml Normal file

@ -0,0 +1,75 @@
# The version of the config (DO NOT CHANGE)
configVersion: "0.2.0"
# Your name to show in the info card
name: "Your Name"
# The description shown in the info card
description: "A description about yourself"
# The avatar to show
avatar: "/avatar.webp"
# Background configuration
background:
# Should we use a custom background?
showBackground: true
# Should we blur that background?
blur: true
# Should we darken that background? and by how much
darken:
enabled: true
amount: 0.7
# The image to show when the background is enabled
backgroundImage: "/background.jpg"
# The theme to use (light or dark)
theme: "dark"
# The info card settings
infoCard:
# How transparent should it be?
transparency: 0.85
# Discord settings (Status indicator)
discord:
# Your discord id
id: "set me"
# Global settings for the site
options:
# Should we show the "Website Source" button?
showSourceLink: true
# Metadata for the website (controls embed settings and SEO info)
# see: https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image
metadata:
title: "Your Name"
description: "website description"
themeColor: "#6441a5"
authors:
- name: "Fascinated"
url: "https://fascinated.cc"
# The links to show (buttons)
links:
# The title of the button
- title: "Git"
# Where the button goes to
url: "https://git.fascinated.cc"
# The icon of the button
# see: https://fontawesome.com/search
icon: "fab fa-git-alt"
# The color of the button (TailwindCSS colors or hex color, see below for hex)
color: "bg-green-700"
- title: "Twitch"
url: "https://twitch.tv/fascinated_"
icon: "fab fa-twitch"
color: "bg-[#6441a5]"
- title: "Documentation"
url: "https://docs.fascinated.cc"
color: "bg-neutral-700"
# The links to show (icons only, below buttons)
socialLinks:
# The icon to use
# see: https://fontawesome.com/search
- icon: "fab fa-twitter"
# The color of the icon
color: "#1DA1F2"
# Where the icon goes to when clicked
url: "https://twitter.com"
- icon: "fab fa-reddit"
color: "#FF4300"
url: "https://www.reddit.com/user/ImFascinatedMC"
- icon: "fab fa-git-alt"
url: "https://git.fascinated.cc"

@ -13,5 +13,5 @@ services:
ports:
- 3000:3000
volumes:
- ./config.json:/usr/src/app/config.json:ro # The application config (Must be created before starting the service)
- ./config.yml:/usr/src/app/config.yml:ro # The application config (Must be created before starting the service)
- ./public:/usr/src/app/public:rw # Used for public facing images (eg: avatar and background)

@ -1,3 +1,5 @@
const withYaml = require("next-plugin-yaml");
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
@ -12,4 +14,4 @@ const nextConfig = {
},
};
module.exports = nextConfig;
module.exports = withYaml(nextConfig);

4697
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,32 +1,35 @@
{
"name": "simple-links",
"version": "0.1.9",
"version": "0.2.1",
"private": false,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next build && next start",
"lint": "next lint"
"lint": "next lint",
"update-depends": "npm-check -u"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@types/node": "20.4.1",
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"autoprefixer": "10.4.14",
"eslint": "8.44.0",
"eslint-config-next": "13.4.9",
"next": "13.4.9",
"postcss": "8.4.25",
"react": "18.2.0",
"react-dom": "18.2.0",
"sharp": "^0.32.2",
"tailwindcss": "3.3.2",
"typescript": "5.1.6",
"use-lanyard": "^1.4.4"
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@types/node": "^22.5.1",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.1",
"eslint-config-next": "^14.2.7",
"next": "^14.2.7",
"next-plugin-yaml": "^1.0.1",
"npm-check": "^6.0.1",
"postcss": "^8.4.41",
"react": "18.3.1",
"react-dom": "18.3.1",
"sharp": "^0.33.5",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4",
"use-lanyard": "^1.5.2"
}
}

4676
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

6
renovate.json Normal file

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>Fascinated/renovate-config"
]
}

@ -1,10 +1,11 @@
"use client";
import { Config } from "@/src/types/config";
import Image from "next/image";
import { Fragment } from "react";
import { useLanyardWS } from "use-lanyard";
import Config from "../../../config.json";
const config: Config = require("../../../config.yml") as any;
function LanyardWrapper(props: { children: any }) {
return <Fragment>{props.children}</Fragment>;
@ -12,7 +13,7 @@ function LanyardWrapper(props: { children: any }) {
export default function Avatar(props: any) {
const { avatar } = props;
const { discord }: any = Config;
const { discord }: any = config;
return (
<div className="relative inline-block">
@ -39,10 +40,10 @@ function LanyardComponent(props: { discord: any }) {
const hasLanyard = lanyardData !== undefined;
const statusColor = {
online: "bg-green-400",
offline: "bg-slate-400",
dnd: "bg-red-500",
idle: "bg-orange-400",
online: "bg-[#43B581]",
offline: "bg-transparent",
dnd: "bg-[#F04747]",
idle: "bg-[#FAA61A]",
};
const currentStatus =
lanyardData !== undefined

@ -1,20 +1,18 @@
import { config } from "@fortawesome/fontawesome-svg-core";
import { Config } from "@/src/types/config";
import { config as fontAwesomeConfig } from "@fortawesome/fontawesome-svg-core";
import "@fortawesome/fontawesome-svg-core/styles.css";
import { Inter } from "next/font/google";
import "./globals.css";
import { ReactNode } from "react";
import Config from "../../config.json";
config.autoAddCss = false;
const config: Config = require("../../config.yml") as any;
fontAwesomeConfig.autoAddCss = false;
const inter = Inter({ subsets: ["latin"] });
export const metadata = Config.metadata; // Site metadata from the config
export const metadata = config.metadata; // Site metadata from the config
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>

@ -1,12 +1,15 @@
import { Config } from "@/src/types/config";
import { library } from "@fortawesome/fontawesome-svg-core";
import { fab } from "@fortawesome/free-brands-svg-icons";
import { far } from "@fortawesome/free-regular-svg-icons";
import { fas } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import Image from "next/image";
import Config from "../../config.json";
import Link from "next/link";
import Avatar from "./components/Avatar";
const config: Config = require("../../config.yml") as any;
library.add(fab, far, fas); // Loading in the icons from FontAwesome
export default function Home() {
@ -20,7 +23,7 @@ export default function Home() {
options,
description,
theme,
} = Config; // All of the settings pulled from the config file
} = config; // All the settings pulled from the config file
// Theme colors to use when using the selected theme
// all used colors are from TailwindCSS
@ -51,29 +54,26 @@ export default function Home() {
const selectedTheme = themeColors[theme] || themeColors.dark; // The theme to use (fallback of dark)
return (
<>
<div className={"relative"}>
{/* Background Image */}
{background.showBackground && background.backgroundImage && (
// eslint-disable-next-line @next/next/no-img-element
<img
alt="Background image"
src={background.backgroundImage}
className={`absolute z-0 object-cover w-full h-full ${background.blur && "blur-sm"} brightness-${background.darken.enabled && background.darken.amount / 2}`}
/>
)}
<main
className={`flex flex-col items-center justify-center w-screen h-screen ${selectedTheme.backgroundColor} ${selectedTheme.textColor}`}
>
{/* Background Image */}
{background.showBackground && background.backgroundImage && (
<Image
alt="Background image"
src={background.backgroundImage}
fill={true}
style={{
zIndex: 0,
filter: `${background.blur && "blur(4px)"} brightness(${
background.darken.enabled && background.darken.amount / 2
})`,
}}
/>
)}
{/* Info Card */}
<div
className={`${selectedTheme.infoCardColor} rounded-lg text-center shadow-lg`}
className={`${infoCard.transparency != 0 && `${selectedTheme.infoCardColor} shadow-lg rounded-lg`} text-center`}
style={{
zIndex: 1,
opacity: infoCard.transparency,
opacity: infoCard.transparency != 0 ? infoCard.transparency : 1,
}}
>
<div className="m-5">
@ -106,7 +106,13 @@ 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} ${color} hover:brightness-75 transition gap-2`}
${selectedTheme.buttonTextColor} ${color} hover:brightness-75 transition gap-2 shadow-lg`}
style={{
opacity:
infoCard.transparency != 0
? infoCard.transparency
: 0.8,
}}
>
{link.icon && <FontAwesomeIcon icon={icons} />}
<p>{link.title}</p>
@ -127,7 +133,13 @@ export default function Home() {
href={link.url}
target="_blank"
rel="noopener noreferrer"
className="hover:brightness-75 transition"
className="hover:brightness-75 transition shadow-lg"
style={{
opacity:
infoCard.transparency != 0
? infoCard.transparency
: 0.8,
}}
>
{link.icon && (
<FontAwesomeIcon
@ -148,16 +160,21 @@ export default function Home() {
className={`absolute bottom-0 right-0 mb-5 mr-5 ${selectedTheme.footerTextColor}`}
>
{options.showSourceLink && (
<a
<Link
href="https://git.fascinated.cc/Fascinated/simple-links"
target="_blank"
className="mt-5"
>
Website Source
</a>
<Image
src="https://cdn.fascinated.cc/assets/simple-links/icon.png"
alt="Simple Links Icon"
width={32}
height={32}
/>
</Link>
)}
</div>
</main>
</>
</div>
);
}

55
src/types/config.d.ts vendored Normal file

@ -0,0 +1,55 @@
export interface Config {
configVersion: string;
name: string;
description: string;
avatar: string;
background: {
showBackground: boolean;
blur: boolean;
darken: {
enabled: boolean;
amount: number;
};
backgroundImage: string;
};
theme: string;
infoCard: {
transparency: number;
};
discord: {
id: string;
};
options: {
showSourceLink: boolean;
};
metadata: {
title: string;
description: string;
themeColor: string;
authors: {
name: string;
url: string;
}[];
};
links: {
title: string;
url: string;
icon: string;
color:
| {
normal: string;
}
| string;
}[];
socialLinks: {
icon: string;
color: string;
url: string;
}[];
}
// Parse the YAML content and convert it to the defined type
declare module "*.yml" {
const content: any;
export default content;
}

@ -1,7 +1,7 @@
workDir=/usr/src/app
baseUrl=https://git.fascinated.cc/Fascinated/simple-links/raw/branch/master/public/
toDownload=("avatar.webp" "background.jpg")
toDownload=("avatar.webp" "background.jpg" "favicon.ico")
echo "Checking if files need to be downloaded"
if [ -z "$(ls -A $workDir/public)" ]; then

@ -4,7 +4,7 @@ module.exports = {
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
"./config.json",
"./config.yml",
],
theme: {},
plugins: [],

@ -21,8 +21,16 @@
],
"paths": {
"@/*": ["./*"]
}
},
"typeRoots": ["./src/types", "./node_modules/@types"],
"types": ["node"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"src/types/**/*.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
}

4826
yarn.lock Normal file

File diff suppressed because it is too large Load Diff