Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
node_modules
.history
dist
cache
cache
.vitepress/dist
.vitepress/cache

# IDE
.vscode
.idea
*.swp
*.swo
*~

# Environment
.env
.env.local
.env.*.local

# OS
.DS_Store
Thumbs.db

# Logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,36 @@ pnpm install
Start the development server:

```bash
pnpm docs:dev
pnpm dev
```

### Build

Build the site for production:

```bash
pnpm docs:build
pnpm build
```

### Preview

Preview the production build locally:

```bash
pnpm docs:preview
pnpm preview
```

## Testing with Playwright
## Testing

This project uses Playwright for end-to-end testing.
This project ships with custom integration checks for the local search experience.

### Install Playwright
### Search verification

```bash
pnpm add -D @playwright/test
pnpm exec playwright install
pnpm test:search
```

### Run Tests

```bash
pnpm test
```
> Runs `node tests/verify-search.js`. The script expects a local dev server at `http://localhost:5173` and a Chromium instance started with `--remote-debugging-port=9222`.

## Project Structure

Expand Down
33 changes: 12 additions & 21 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,20 @@ document.querySelectorAll('a[href^="#"]').forEach(anchor => {

// Header scroll effect
const header = document.querySelector('header');
let lastScrollY = window.scrollY;
if (header) {
let lastScrollY = window.scrollY;

window.addEventListener('scroll', () => {
if (window.scrollY > lastScrollY) {
header.style.transform = 'translateY(-100%)';
} else {
header.style.transform = 'translateY(0)';
}
lastScrollY = window.scrollY;
});

// Add transition to header
header.style.transition = 'transform 0.3s ease-in-out';

// Mobile menu functionality (if needed in the future)
// const mobileMenuButton = document.querySelector('.mobile-menu-button');
// const navLinks = document.querySelector('.nav-links');
window.addEventListener('scroll', () => {
if (window.scrollY > lastScrollY) {
header.style.transform = 'translateY(-100%)';
} else {
header.style.transform = 'translateY(0)';
}
lastScrollY = window.scrollY;
});

// if (mobileMenuButton) {
// mobileMenuButton.addEventListener('click', () => {
// navLinks.classList.toggle('active');
// });
// }
header.style.transition = 'transform 0.3s ease-in-out';
}

// Intersection Observer for fade-in animations
const observerOptions = {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress preview",
"test:lang": "node tests/language-detection.js",
"test:search": "node tests/verify-search.js"
},
"devDependencies": {
Expand Down