From 1a6e22711c625673a4824db9d261c35be3534daf Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Mon, 28 Oct 2024 22:58:18 +0530 Subject: [PATCH] website fixes --- docs/assets/css/mobile.css | 4 ++-- docs/assets/css/style.css | 10 +++++++++- docs/assets/js/main.js | 10 ++++++++-- docs/index.html | 10 ++++++---- pkg/config/config.go | 11 +++++++++-- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/assets/css/mobile.css b/docs/assets/css/mobile.css index 22b7002..3a5b643 100644 --- a/docs/assets/css/mobile.css +++ b/docs/assets/css/mobile.css @@ -39,7 +39,7 @@ } .main-logo { - width: 140px; /* Slightly smaller logo */ + width: 12rem; margin-bottom: 1.5rem; } @@ -147,7 +147,7 @@ } .main-logo { - width: 120px; + width: 8rem; margin-bottom: 1rem; } diff --git a/docs/assets/css/style.css b/docs/assets/css/style.css index 961b143..808ea63 100644 --- a/docs/assets/css/style.css +++ b/docs/assets/css/style.css @@ -147,7 +147,7 @@ body { .main-logo { position: relative; z-index: 1; - width: 180px; + width: 20rem; height: auto; margin-bottom: 2rem; animation: float 6s ease-in-out infinite; @@ -467,3 +467,11 @@ h2 { color: var(--primary-color); } + +@media (prefers-reduced-motion: reduce) { + [data-aos] { + transition: none !important; + transform: none !important; + animation: none !important; + } +} \ No newline at end of file diff --git a/docs/assets/js/main.js b/docs/assets/js/main.js index ca01ec1..e37590a 100644 --- a/docs/assets/js/main.js +++ b/docs/assets/js/main.js @@ -82,14 +82,14 @@ function initModalFunctionality() { // Close modal on escape key document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && modalOverlay.style.display === 'flex') { - closeModal(); + window.closeModal(); } }); // Close modal when clicking outside modalOverlay.addEventListener('click', (e) => { if (e.target === modalOverlay) { - closeModal(); + window.closeModal(); } }); } @@ -172,6 +172,12 @@ function initCodeCopy() { setTimeout(() => { copyButton.innerHTML = ''; }, 2000); + }).catch((err) => { + console.error('Failed to copy text: ', err); + copyButton.innerHTML = ''; + setTimeout(() => { + copyButton.innerHTML = ''; + }, 2000); }); }); diff --git a/docs/index.html b/docs/index.html index 117dad3..d36b83e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -41,10 +41,12 @@ title="GitHub"> - diff --git a/pkg/config/config.go b/pkg/config/config.go index b64c5df..8196675 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -24,11 +24,18 @@ type RelayConfig struct { } func init() { - if err := godotenv.Load(); err != nil { + envFile := os.Getenv("ENV_FILE") + if envFile == "" { + envFile = ".env" + } + + if err := godotenv.Load(envFile); err != nil { // Only log if file exists but couldn't be loaded if !os.IsNotExist(err) { - log.Printf("Error loading .env file: %v", err) + log.Printf("Error loading env file %s: %v", envFile, err) } + } else { + log.Printf("Successfully loaded env file: %s", envFile) } }