diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cebcdf5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,115 @@ +name: 🚀 Create Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build project + run: npm run build + continue-on-error: true + + - name: Create tarball + run: | + tar -czf networking-toolbox-${{ github.ref_name }}.tar.gz \ + --exclude=node_modules \ + --exclude=.git \ + --exclude=.github \ + --exclude=tests \ + --exclude=playwright-report \ + --exclude=coverage \ + . + + - name: Create zip + run: | + zip -r networking-toolbox-${{ github.ref_name }}.zip . \ + -x "node_modules/*" \ + -x ".git/*" \ + -x ".github/*" \ + -x "tests/*" \ + -x "playwright-report/*" \ + -x "coverage/*" \ + -x "*.tar.gz" + + - name: Generate changelog + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + writeToFile: false + includeInvalidCommits: true + excludeTypes: build,docs,style,chore + + - name: Extract version + id: version + run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + name: Networking Toolbox ${{ steps.version.outputs.version }} + body: | + ## 📦 Networking Toolbox ${{ steps.version.outputs.version }} + + ${{ steps.changelog.outputs.changes }} + + --- + + ### 📥 Installation + + **Docker:** + ```bash + docker pull lissy93/networking-toolbox:${{ steps.version.outputs.version }} + docker run -d -p 8080:80 lissy93/networking-toolbox:${{ steps.version.outputs.version }} + ``` + + **From Source:** + ```bash + # Download and extract + tar -xzf networking-toolbox-${{ github.ref_name }}.tar.gz + + # Install and run + npm install + npm run build + npm run preview + ``` + + **Deploy to Vercel:** + [](https://vercel.com/new/clone?repository-url=https://github.com/Lissy93/networking-toolbox) + + ### 📋 What's Changed + ${{ steps.changelog.outputs.previousTag && format('**Full Changelog**: https://github.com/{0}/compare/{1}...{2}', github.repository, steps.changelog.outputs.previousTag, github.ref_name) || '' }} + + ### 🔗 Links + - 📚 [Documentation](https://github.com/${{ github.repository }}/blob/main/README.md) + - 🐛 [Report Issues](https://github.com/${{ github.repository }}/issues) + - 🌐 [Live Demo](https://networking-toolbox.as93.net) + files: | + networking-toolbox-${{ github.ref_name }}.tar.gz + networking-toolbox-${{ github.ref_name }}.zip + draft: false + prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }} + generate_release_notes: false diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..7e7c535 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,35 @@ +name: 🏷️ Tag new versions + +on: + push: + branches: + - main + paths: + - 'package.json' + +jobs: + tag-version: + runs-on: ubuntu-latest + steps: + - name: Check out repo with bot token + uses: actions/checkout@v4 + - name: Configure git as bot user + run: | + git config user.name "liss-bot" + git config user.email "alicia-gh-bot@mail.as93.net" + - name: Get version from package.json + id: get_version + run: | + VERSION=$(jq -r .version package.json) + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Create Git Tag (skip if exists) + run: | + VERSION="${{ steps.get_version.outputs.version }}" + # Check if the tag already exists remotely + if git ls-remote --tags origin | grep -q "refs/tags/v${VERSION}"; then + echo "Tag v${VERSION} already exists. Skipping." + else + echo "Tag v${VERSION} does not exist. Creating now..." + git tag "v${VERSION}" + git push origin "v${VERSION}" + fi diff --git a/src/lib/components/global/GlobalSearch.svelte b/src/lib/components/global/GlobalSearch.svelte index b568563..0fbaef3 100644 --- a/src/lib/components/global/GlobalSearch.svelte +++ b/src/lib/components/global/GlobalSearch.svelte @@ -66,6 +66,10 @@ // Using a separate internal function to avoid reactivity warnings function openSearch() { isOpen = true; + // Push a new history state when opening search on mobile + if (browser && window.innerWidth <= 768) { + window.history.pushState({ searchOpen: true }, '', window.location.href); + } setTimeout(() => searchInput?.focus(), 0); } @@ -127,7 +131,21 @@ bookmarks.init(); toolUsage.init(); document.addEventListener('keydown', handleGlobalKeydown); - return () => document.removeEventListener('keydown', handleGlobalKeydown); + + // Handle browser back button on mobile + const handlePopState = (e: PopStateEvent) => { + if (isOpen && window.innerWidth <= 768) { + e.preventDefault(); + close(); + } + }; + + window.addEventListener('popstate', handlePopState); + + return () => { + document.removeEventListener('keydown', handleGlobalKeydown); + window.removeEventListener('popstate', handlePopState); + }; }); export { showSearch }; @@ -294,6 +312,12 @@ justify-content: center; padding-top: 15vh; animation: fadeIn var(--transition-fast); + + @media (max-width: 768px) { + padding: 0; + align-items: stretch; + background: var(--bg-primary); + } } .search-modal { @@ -307,8 +331,15 @@ animation: slideDown var(--transition-normal); @media (max-width: 768px) { - margin: 0 var(--spacing-md); - max-width: calc(100vw - 2rem); + max-width: 100%; + height: 100vh; + height: 100dvh; + border-radius: 0; + border: none; + box-shadow: none; + display: flex; + flex-direction: column; + animation: slideInFromBottom var(--transition-normal); } } @@ -319,6 +350,15 @@ padding: var(--spacing-lg); border-bottom: 1px solid var(--border-primary); + @media (max-width: 768px) { + padding: var(--spacing-md); + position: sticky; + top: 0; + background: var(--bg-primary); + z-index: 10; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + } + .search-input { flex: 1; background: transparent; @@ -327,6 +367,10 @@ color: var(--text-primary); font-size: var(--font-size-lg); + @media (max-width: 768px) { + font-size: var(--font-size-md); + } + &::placeholder { color: var(--text-tertiary); } @@ -341,6 +385,10 @@ border-radius: var(--radius-sm); transition: all var(--transition-fast); + @media (max-width: 768px) { + padding: var(--spacing-sm); + } + &:hover { background: var(--surface-hover); color: var(--text-primary); @@ -351,6 +399,13 @@ .search-results { max-height: 60vh; overflow-y: auto; + + @media (max-width: 768px) { + max-height: none; + flex: 1; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + } } .result-item { @@ -366,6 +421,11 @@ text-align: left; transition: background var(--transition-fast); + @media (max-width: 768px) { + padding: var(--spacing-md); + min-height: 60px; + } + &:hover, &.selected { background: var(--surface-hover); @@ -428,12 +488,22 @@ padding: var(--spacing-2xl); color: var(--text-secondary); text-align: center; + + @media (max-width: 768px) { + padding: var(--spacing-xl) var(--spacing-md); + min-height: 50vh; + justify-content: center; + } } .search-help { padding: var(--spacing-lg); border-top: 1px solid var(--border-secondary); + @media (max-width: 768px) { + padding: var(--spacing-md); + } + .help-item { display: flex; align-items: center; @@ -449,6 +519,10 @@ .frequently-used-section { padding: var(--spacing-md) var(--spacing-lg); border-top: 1px solid var(--border-secondary); + + @media (max-width: 768px) { + padding: var(--spacing-md); + } } .bookmarks-header, @@ -570,4 +644,15 @@ transform: translateY(0) scale(1); } } + + @keyframes slideInFromBottom { + from { + opacity: 0; + transform: translateY(100%); + } + to { + opacity: 1; + transform: translateY(0); + } + } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 813c8c0..5dafbc4 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -23,9 +23,12 @@ return navItems; } - // Separate tools from reference pages + // Separate tools from reference pages and standalone pages const referencePages = extractNavItems(SUB_NAV['/reference'] || []); - const toolPages = ALL_PAGES.filter((page) => !page.href.startsWith('/reference')); + const toolPages = ALL_PAGES.filter( + (page) => + !page.href.startsWith('/reference') && !page.href.startsWith('/bookmarks') && !page.href.startsWith('/offline'), + ); let filteredTools: NavItem[] = $state(toolPages); let filteredReference: NavItem[] = $state(referencePages); diff --git a/static/api-docs.html b/static/api-docs.html index 81b7b5f..d31f57f 100644 --- a/static/api-docs.html +++ b/static/api-docs.html @@ -1,21 +1,270 @@ - +
- -