Skip to content

duyet-website/cdn.duyet.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

cdn.duyet.net

CI/CD Pipeline License: MIT Version

Modern, high-performance CDN hosting JavaScript libraries, utilities, and CSS for blog projects.

โœจ Features

  • ๐Ÿš€ 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

๐Ÿ“š Available Libraries

Utilities (v2)

Smooth Scroll

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
});

Lazy Load

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
});

Recent Posts Widget

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'
};

Legacy Libraries (v1)

React DnD 2.1.4

<script src="https://cdn.duyet.net/react-dnd/dist/ReactDnD.min.js"></script>

React Tags 3.0.1

<script src="https://cdn.duyet.net/react-tags/dist/ReactTags.min.js"></script>

Draft.js

<script src="https://cdn.duyet.net/Draft/Draft.js"></script>

Google Code Prettify

<script src="https://cdn.duyet.net/code-prettify/loader/run_prettify.js"></script>
<link rel="stylesheet" href="https://cdn.duyet.net/prettify_skin.css">

๐Ÿš€ Quick Start

Using via CDN

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>

Self-Hosting

  1. Clone the repository:
git clone https://github.com/duyet/cdn.duyet.net.git
cd cdn.duyet.net
  1. Install dependencies:
npm install
  1. Build for production:
npm run build
  1. Serve the dist/ directory with your web server.

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 9.0.0

Setup

# 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 preview

Project Structure

cdn.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

๐Ÿ“Š Performance

  • 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

๐Ÿ”’ Security

  • โœ… HTTPS only
  • โœ… Security headers (CSP, X-Frame-Options, etc.)
  • โœ… Automated dependency scanning (Dependabot)
  • โœ… Regular security audits (npm audit, Snyk)
  • โœ… No inline scripts or eval()

๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Credits

  • 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

๐Ÿ“ฎ Contact

๐Ÿ“ˆ Changelog

See CHANGELOG.md for version history and updates.


Made with โค๏ธ by Duyet

About

Resource CDN.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors