Modern, high-performance CDN hosting JavaScript libraries, utilities, and CSS for blog projects.
- ๐ Modern Build System - Vite-powered with automatic minification and compression
- ๐ฆ Optimized Delivery - Source maps, Gzip, and Brotli compression
- ๐ Secure - HTTPS, security headers, automated vulnerability scanning
- ๐ฏ Versioned API - Stable URLs with
/v1/and/v2/endpoints - โก Performance - Aggressive caching, lazy loading, smooth scrolling
- ๐ ๏ธ Developer Friendly - TypeScript support, comprehensive documentation
- โ Quality Assured - ESLint, Prettier, automated testing, CI/CD
- โฟ Accessible - Respects reduced motion preferences, ARIA labels
Provides buttery-smooth scrolling behavior with pulse algorithm.
<script src="https://cdn.duyet.net/v2/js/smooth-scroll.min.js"></script>Features:
- โ
Respects
prefers-reduced-motion - โ Cross-browser support (Chrome, Firefox, Safari, Edge)
- โ Keyboard and mouse wheel support
- โ Configurable animation timing and easing
Configuration:
// Optional: Configure before script loads
window.smoothScrollOptions = {
frameRate: 300,
animationTime: 1000,
stepSize: 85,
pulseAlgorithm: true,
keyboardSupport: true,
respectReducedMotion: true
};
// Or configure after loading
SmoothScroll.configure({
animationTime: 800
});Modern image lazy loading with IntersectionObserver.
<script src="https://cdn.duyet.net/v2/js/lazyload.min.js"></script>
<!-- In your HTML -->
<img class="lazy"
data-src="image.jpg"
data-srcset="image-400w.jpg 400w, image-800w.jpg 800w"
alt="Description">Features:
- โ IntersectionObserver with scroll fallback
- โ Responsive images (srcset) support
- โ Loading states and error handling
- โ Configurable threshold and root margin
API:
// Refresh for dynamically added images
LazyLoad.refresh();
// Load all images immediately
LazyLoad.loadAll();
// Configure
LazyLoad.configure({
selector: 'img.lazy',
rootMargin: '50px',
threshold: 0.01
});Displays Blogger/Blogspot recent posts without document.write().
<div id="recent-posts-widget"></div>
<script src="https://cdn.duyet.net/v2/js/recent-posts.min.js"></script>
<script src="YOUR_BLOG_URL/feeds/posts/default?alt=json-in-script&callback=showRecentPosts"></script>Configuration:
window.recentPostsConfig = {
numposts: 5,
showpostdate: true,
showpostsummary: true,
numchars: 100,
containerId: 'recent-posts-widget'
};<script src="https://cdn.duyet.net/react-dnd/dist/ReactDnD.min.js"></script><script src="https://cdn.duyet.net/react-tags/dist/ReactTags.min.js"></script><script src="https://cdn.duyet.net/Draft/Draft.js"></script><script src="https://cdn.duyet.net/code-prettify/loader/run_prettify.js"></script>
<link rel="stylesheet" href="https://cdn.duyet.net/prettify_skin.css">Simply include the scripts in your HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Blog</title>
</head>
<body>
<!-- Your content -->
<img class="lazy" data-src="image.jpg" alt="Lazy loaded">
<!-- Include CDN scripts -->
<script src="https://cdn.duyet.net/v2/js/smooth-scroll.min.js"></script>
<script src="https://cdn.duyet.net/v2/js/lazyload.min.js"></script>
</body>
</html>- Clone the repository:
git clone https://github.com/duyet/cdn.duyet.net.git
cd cdn.duyet.net- Install dependencies:
npm install- Build for production:
npm run build- Serve the
dist/directory with your web server.
- Node.js >= 18.0.0
- npm >= 9.0.0
# Install dependencies
npm install
# Start development server
npm run dev
# Run tests
npm test
# Run tests with UI
npm run test:ui
# Run linting
npm run lint
# Format code
npm run format
# Build for production
npm run build
# Preview production build
npm run previewcdn.duyet.net/
โโโ src/ # Modern source files
โ โโโ smooth-scroll.js # Smooth scrolling library
โ โโโ lazyload.js # Image lazy loading
โ โโโ recent-posts.js # Blog widget
โโโ v1/ # Version 1 API (stable)
โ โโโ js/
โ โโโ css/
โโโ v2/ # Version 2 API (current)
โ โโโ js/
โ โโโ css/
โโโ code-prettify/ # Google Code Prettify
โโโ Draft/ # Draft.js editor
โโโ react-dnd/ # React DnD library
โโโ react-tags/ # React Tags input
โโโ .github/ # GitHub Actions workflows
โโโ vite.config.js # Vite configuration
โโโ package.json # Dependencies & scripts
โโโ _headers # Cache & security headers
โโโ README.md # This file
- Gzip Compression: Enabled for all assets
- Brotli Compression: Enabled for modern browsers
- Cache Headers: Aggressive caching with immutable flag
- Source Maps: Available for debugging
- Minification: Terser optimization
- โ HTTPS only
- โ Security headers (CSP, X-Frame-Options, etc.)
- โ Automated dependency scanning (Dependabot)
- โ Regular security audits (npm audit, Snyk)
- โ No inline scripts or eval()
Contributions are welcome! Please read CONTRIBUTING.md for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Smooth Scroll: Original by Balazs Galambosi, Pulse Algorithm by Michael Herf
- Code Prettify: Google
- Draft.js: Facebook
- React DnD: Dan Abramov
- React Tags: Various contributors
See CHANGELOG.md for version history and updates.
Made with โค๏ธ by Duyet