Skip to content

Commit 6e39f11

Browse files
authored
Merge pull request #2 from vaibhavhrt/example
Add Example and website
2 parents e756c2d + f429c0c commit 6e39f11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+34417
-9
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: "main"
6+
paths:
7+
- "example/example-website/**"
8+
9+
jobs:
10+
build_site:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: example/example-website
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: npm
24+
cache-dependency-path: "example/example-website/package-lock.json"
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: build
30+
env:
31+
BASE_PATH: "/${{ github.event.repository.name }}"
32+
run: npm run build
33+
34+
- name: Upload Artifacts
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: "example/example-website/build/"
38+
39+
deploy:
40+
needs: build_site
41+
runs-on: ubuntu-latest
42+
43+
permissions:
44+
pages: write
45+
id-token: write
46+
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
51+
steps:
52+
- name: Deploy
53+
id: deployment
54+
uses: actions/deploy-pages@v4

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@ This package provides multiple image hashing algorithms:
1919

2020
## Getting started
2121

22-
Add this to your `pubspec.yaml`:
23-
24-
```yaml
25-
dependencies:
26-
imagehash: ^2.0.0
27-
```
28-
29-
Then run:
22+
Add dart_imagehash to your project:
3023

3124
```bash
32-
dart pub get
25+
dart pub add dart_imagehash
3326
```
3427

28+
This will automatically add the latest version to your pubspec.yaml file.
29+
3530
## Usage
3631

3732
```dart

example/example-website/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Env
16+
.env
17+
.env.*
18+
!.env.example
19+
!.env.test
20+
21+
# Vite
22+
vite.config.js.timestamp-*
23+
vite.config.ts.timestamp-*

example/example-website/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb
7+
8+
# Miscellaneous
9+
/static/
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

example/example-website/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# dart_imagehash Website
2+
3+
A beautiful, responsive website for the dart_imagehash package built with SvelteKit 5, Tailwind CSS, and modern web technologies.
4+
5+
## Features
6+
7+
- **Modern Design**: Clean, responsive design with smooth animations
8+
- **Interactive Demo**: Test image hashing algorithms with sample images
9+
- **Comprehensive Documentation**: Complete API reference and usage examples
10+
- **Algorithm Comparison**: Visual comparison of different hashing algorithms
11+
- **GitHub Pages Ready**: Configured for easy deployment
12+
13+
## Development
14+
15+
### Prerequisites
16+
17+
- Node.js 18 or higher
18+
- npm
19+
20+
### Setup
21+
22+
1. Clone the repository:
23+
24+
```bash
25+
git clone https://github.com/vaibhavhrt/dart_imagehash.git
26+
cd dart_imagehash/example/example-website
27+
```
28+
29+
2. Install dependencies:
30+
31+
```bash
32+
npm install
33+
```
34+
35+
3. Start development server:
36+
37+
```bash
38+
npm run dev
39+
```
40+
41+
Visit `http://localhost:5173` to view the website.
42+
43+
### Building for Production
44+
45+
```bash
46+
npm run build
47+
```
48+
49+
The built files will be in the `build/` directory.
50+
51+
### Deployment
52+
53+
The website is configured for GitHub Pages deployment:
54+
55+
1. **Automatic**: Push to main branch triggers automatic deployment via GitHub Actions
56+
57+
## Project Structure
58+
59+
```
60+
src/
61+
├── routes/
62+
│ ├── +layout.svelte # Main layout with navigation
63+
│ ├── +layout.ts # Layout configuration
64+
│ ├── +page.svelte # Homepage
65+
│ ├── features/
66+
│ │ └── +page.svelte # Features comparison page
67+
│ ├── demo/
68+
│ │ └── +page.svelte # Interactive demo page
69+
│ └── docs/
70+
│ └── +page.svelte # Documentation page
71+
├── app.css # Global styles
72+
└── app.html # HTML template
73+
```
74+
75+
## Technologies Used
76+
77+
- **SvelteKit 5**: Modern web framework with runes
78+
- **Tailwind CSS 4**: Utility-first CSS framework
79+
- **TypeScript**: Type-safe JavaScript
80+
- **Vite**: Fast build tool
81+
- **GitHub Pages**: Static site hosting
82+
83+
## Contributing
84+
85+
1. Fork the repository
86+
2. Create a feature branch
87+
3. Make your changes
88+
4. Submit a pull request
89+
90+
## License
91+
92+
This project is licensed under the same license as the dart_imagehash package.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import prettier from 'eslint-config-prettier';
2+
import { includeIgnoreFile } from '@eslint/compat';
3+
import js from '@eslint/js';
4+
import svelte from 'eslint-plugin-svelte';
5+
import globals from 'globals';
6+
import { fileURLToPath } from 'node:url';
7+
import ts from 'typescript-eslint';
8+
import svelteConfig from './svelte.config.js';
9+
10+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
11+
12+
export default ts.config(
13+
includeIgnoreFile(gitignorePath),
14+
js.configs.recommended,
15+
...ts.configs.recommended,
16+
...svelte.configs.recommended,
17+
prettier,
18+
...svelte.configs.prettier,
19+
{
20+
languageOptions: {
21+
globals: { ...globals.browser, ...globals.node }
22+
},
23+
rules: {
24+
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
25+
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
26+
'no-undef': 'off'
27+
}
28+
},
29+
{
30+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
31+
languageOptions: {
32+
parserOptions: {
33+
projectService: true,
34+
extraFileExtensions: ['.svelte'],
35+
parser: ts.parser,
36+
svelteConfig
37+
}
38+
}
39+
}
40+
);

0 commit comments

Comments
 (0)