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
169 changes: 169 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Build outputs
dist/
build/
out/

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt

# Gatsby files
.cache/
public

# Vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Editor directories and files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Temporary files
*.tmp
*.temp
*.log

# Local development files
.env.local
.env.development.local
.env.test.local
.env.production.local

# Package manager lock files (uncomment if you want to ignore them)
# package-lock.json
# yarn.lock
# pnpm-lock.yaml

# Backup files
*.bak
*.backup
*.old

# Archive files
*.zip
*.tar.gz
*.rar

# IDE and editor files
*.sublime-project
*.sublime-workspace
.vscode/
.idea/
*.iml

# Testing
/coverage
/.nyc_output

# Misc
*.tgz
*.tar.gz
227 changes: 225 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,225 @@
# demo
introduction to github
# Demo Website Project

A modern, responsive website built with HTML5, CSS3, and JavaScript showcasing best practices in web development.

## 🚀 Features

- **Modern HTML5**: Semantic elements, accessibility features, and SEO optimization
- **Responsive Design**: Mobile-first approach with CSS Grid and Flexbox layouts
- **Interactive JavaScript**: Smooth scrolling, mobile menu, form validation, and scroll animations
- **CSS Custom Properties**: Maintainable theming system with CSS variables
- **Performance Optimized**: Lazy loading, efficient animations, and optimized assets
- **Development Workflow**: Live reload development server and build process

## 📁 Project Structure

```
demo/
├── src/ # Source files
│ ├── index.html # Main HTML file
│ ├── styles/
│ │ └── main.css # Main stylesheet
│ └── scripts/
│ └── main.js # Main JavaScript file
├── public/ # Static assets (images, fonts, etc.)
├── dist/ # Build output (generated)
├── package.json # Node.js project configuration
├── .gitignore # Git ignore rules
└── README.md # Project documentation
```

## 🛠️ Setup Instructions

### Prerequisites

- **Node.js** (v14 or higher)
- **npm** (comes with Node.js)

### Installation

1. **Clone the repository**
```bash
git clone <repository-url>
cd demo
```

2. **Install dependencies**
```bash
npm install
```

3. **Start development server**
```bash
npm run dev
```

The website will automatically open in your browser at `http://localhost:3000`.

## 📜 Available Scripts

### Development

- **`npm run dev`**
- Starts the development server with live reload
- Serves files from `src/` directory
- Opens browser automatically at `http://localhost:3000`
- Perfect for development and testing

### Build

- **`npm run build`**
- Copies all source files to `dist/` directory
- Prepares files for production deployment

- **`npm run build:prod`**
- Cleans the `dist/` directory and builds the project
- Recommended for production builds

- **`npm run clean`**
- Removes all files from `dist/` directory
- Useful for cleaning build artifacts

### Production

- **`npm run start`**
- Serves the built files from `dist/` directory
- Runs on `http://localhost:8080`
- Use this to test production builds locally

## 🎯 Usage

### Development Workflow

1. **Start development**: `npm run dev`
2. **Make changes** to files in the `src/` directory
3. **View changes** automatically in the browser (live reload)
4. **Build for production**: `npm run build:prod`
5. **Test production build**: `npm run start`

### Customization

#### Colors and Theming
Edit CSS custom properties in `src/styles/main.css`:
```css
:root {
--primary-color: #2563eb;
--secondary-color: #64748b;
/* ... other variables */
}
```

#### Content
- **HTML**: Edit `src/index.html` to modify content and structure
- **Styles**: Edit `src/styles/main.css` for styling changes
- **JavaScript**: Edit `src/scripts/main.js` for interactive features

#### Assets
- Add images, fonts, and other static assets to the `public/` directory
- Reference them in HTML with relative paths: `../public/your-image.jpg`

## 🌟 Features Overview

### HTML5 Features
- Semantic elements (`<header>`, `<main>`, `<section>`, `<footer>`)
- Accessibility attributes and proper heading hierarchy
- SEO meta tags and structured content
- Responsive images with lazy loading

### CSS Features
- **CSS Grid** for complex layouts
- **Flexbox** for component alignment
- **CSS Custom Properties** for theming
- **Media queries** for responsive design
- **Smooth animations** and transitions
- **Mobile-first** responsive approach

### JavaScript Features
- **Mobile menu toggle** with smooth animations
- **Smooth scrolling** navigation
- **Contact form validation** with error handling
- **Scroll-to-top** button
- **Intersection Observer** for scroll animations
- **Active navigation** highlighting
- **Performance optimizations** (debounce, throttle)

## 🎨 Browser Support

- **Modern browsers**: Chrome, Firefox, Safari, Edge (latest versions)
- **Mobile browsers**: iOS Safari, Chrome Mobile, Samsung Internet
- **Responsive design**: Works on all screen sizes from mobile to desktop

## 📱 Responsive Breakpoints

- **Mobile**: < 480px
- **Tablet**: 481px - 768px
- **Desktop**: > 768px

## 🔧 Development Notes

### Code Style
- Modern ES6+ JavaScript
- CSS follows BEM-like naming conventions
- Semantic HTML5 structure
- Mobile-first responsive design

### Performance
- Optimized CSS with efficient selectors
- JavaScript uses modern APIs (Intersection Observer)
- Lazy loading for images
- Minimal dependencies

### Accessibility
- Proper ARIA attributes
- Keyboard navigation support
- Focus management
- Screen reader friendly
- High contrast mode support

## 🚀 Deployment

### Static Hosting
1. Run `npm run build:prod`
2. Upload the `dist/` folder to your hosting provider
3. Configure your server to serve `index.html` as the default file

### Popular Hosting Options
- **Netlify**: Drag and drop the `dist/` folder
- **Vercel**: Connect your Git repository
- **GitHub Pages**: Push `dist/` contents to `gh-pages` branch
- **Firebase Hosting**: Use Firebase CLI to deploy

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch: `git checkout -b feature-name`
3. Make your changes
4. Test thoroughly: `npm run dev` and `npm run start`
5. Commit your changes: `git commit -m 'Add feature'`
6. Push to the branch: `git push origin feature-name`
7. Submit a pull request

## 📄 License

This project is licensed under the ISC License - see the package.json file for details.

## 🆘 Troubleshooting

### Common Issues

**Port already in use**
- Change the port in package.json scripts or kill the process using the port

**Dependencies not installing**
- Delete `node_modules/` and `package-lock.json`, then run `npm install`

**Live reload not working**
- Check if you're editing files in the `src/` directory
- Restart the development server: `npm run dev`

**Build files not updating**
- Run `npm run clean` then `npm run build`

---

**Happy coding! 🎉**

Loading