diff --git a/.forgejo/workflows/docker-release.yml b/.forgejo/workflows/docker-release.yml new file mode 100644 index 0000000..110bc88 --- /dev/null +++ b/.forgejo/workflows/docker-release.yml @@ -0,0 +1,26 @@ +name: Docker Image Release + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: docker + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set tag + run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Login to Docker Registry + run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin + + - name: Build and Push Docker Image + run: | + IMAGE=creations/profile-page + docker build --target release -t $IMAGE:$TAG -t $IMAGE:latest . + docker push $IMAGE:$TAG + docker push $IMAGE:latest diff --git a/README.md b/README.md index f4b9394..b4a85fd 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ cp .env.example .env | `LANYARD_INSTANCE` | Endpoint of the Lanyard instance | | `BADGE_API_URL` | Badge API URL ([badgeAPI](https://git.creations.works/creations/badgeAPI)) | | `REVIEW_DB` | Enables showing reviews from reviewdb on user pages | -| `TIMEZONE_API_URL` | Enables showing times from [timezoneDB](https://git.creations.works/creations/timezoneDB-rs) | +| `TIMEZONE_API_URL` | Enables showing times from [timezoneDB](https://git.creations.works/creations/timezoneDB) | | `STEAMGRIDDB_API_KEY` | SteamGridDB API key for fetching game icons | #### Optional Lanyard KV Variables (per-user customization) @@ -81,7 +81,6 @@ These can be defined in Lanyard's KV store to customize the page: | `optout` | Allows users to stop sharing there profile on the website (`true` / `false`) | | `reviews` | Enables reviews from reviewdb (`true` / `false`) | | `timezone`| Enables the showing of the current time from the timezone db API (`true` / `false`) | -| `timezone_12` | Sets the timezone to default show 12h format, default is 24h | --- diff --git a/public/js/index.js b/public/js/index.js index 68e05b6..aaba9d6 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -11,7 +11,6 @@ let socket; let badgesLoaded = false; let readmeLoaded = false; let cssLoaded = false; -let timezoneLoaded = false; const reviewsPerPage = 50; let currentReviewOffset = 0; @@ -132,7 +131,7 @@ function resolveActivityImage(img, applicationId) { async function populateReviews(userId) { if (!reviewURL || !userId || isLoadingReviews || !hasMoreReviews) return; - const reviewSection = document.getElementById("reviews-section"); + const reviewSection = document.querySelector(".reviews"); const reviewList = reviewSection?.querySelector(".reviews-list"); if (!reviewList) return; @@ -201,9 +200,7 @@ async function populateReviews(userId) { if (currentReviewOffset === 0) reviewList.innerHTML = reviewsHTML; else reviewList.insertAdjacentHTML("beforeend", reviewsHTML); - if (data.reviews.length > 0 && reviewsHTML) { - reviewSection.classList.remove("hidden"); - } + reviewSection.classList.remove("hidden"); hasMoreReviews = data.hasNextPage; isLoadingReviews = false; @@ -213,8 +210,8 @@ async function populateReviews(userId) { } } -function populateTimezone(userId, format = "24h") { - if (!userId || !timezoneApiUrl || timezoneLoaded) return; +function populateTimezone(userId) { + if (!userId || !timezoneApiUrl) return; let currentTimezone = null; @@ -230,7 +227,6 @@ function populateTimezone(userId, format = "24h") { currentTimezone = json.timezone; updateTime(); - timezoneLoaded = true; } catch (err) { console.error("Failed to populate timezone", err); } @@ -240,8 +236,7 @@ function populateTimezone(userId, format = "24h") { if (!currentTimezone) return; const timezoneEl = document.querySelector(".timezone-value"); - const timezoneWrapper = document.getElementById("timezone-wrapper"); - if (!timezoneEl || !timezoneWrapper) return; + if (!timezoneEl) return; const now = new Date(); @@ -261,10 +256,8 @@ function populateTimezone(userId, format = "24h") { second: "2-digit", }); - timezoneEl.textContent = format === "24h" ? time24 : time12; - timezoneEl.title = `${format === "12h" ? time24 : time12} (${currentTimezone})`; - - timezoneWrapper.classList.remove("hidden"); + timezoneEl.textContent = time24; + timezoneEl.title = `${time12} (${currentTimezone})`; } fetchTimezone(); @@ -475,7 +468,6 @@ async function loadBadges(userId, options = {}) { img.src = badge.badge; img.alt = badge.tooltip; img.title = badge.tooltip; - img.tooltip = badge.tooltip; img.className = "badge"; target.appendChild(img); } @@ -657,7 +649,11 @@ async function updatePresence(initialData) { } if (kv.timezone !== "false" && userId && timezoneApiUrl) { - populateTimezone(userId, kv.timezone_12 === "true" ? "12h" : "24h"); + populateTimezone(userId); + const timezoneEl = document.querySelector(".timezone-value"); + if (timezoneEl) { + timezoneEl.classList.remove("hidden"); + } } const platform = { diff --git a/src/views/index.html b/src/views/index.html index f15bc36..1c4884f 100644 --- a/src/views/index.html +++ b/src/views/index.html @@ -27,8 +27,8 @@ style="opacity: 0.5" loading="lazy" /> -