pathii commited on
Commit
7675d4a
·
verified ·
1 Parent(s): 7a4f9a8

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. LICENSE +5 -0
  2. README.md +43 -3
  3. dataset.json +158 -0
  4. dataset.py +10 -0
LICENSE ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Hirusha Nirmal(pathii)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy...
README.md CHANGED
@@ -1,3 +1,43 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UiPlus: Creative Web UI Dataset
2
+
3
+ **UiPlus** is a dataset designed for training machine learning models to generate creative web UI designs, with a focus on modern web components and Sinhala-specific user interfaces. It contains HTML code snippets, design descriptions, and metadata for UI components like product cards, navbars, and more, primarily built with Tailwind CSS. The dataset is tailored for e-commerce, modern, and minimalist UI styles, with support for Sinhala typography and accessibility features.
4
+
5
+ ## Dataset Description
6
+ - **Purpose**: To enable the training of text-to-UI generation models that can produce modern, responsive, and accessible web UI components, with a focus on Sinhala e-commerce and cultural context.
7
+ - **Current Size**: 2 UI components (product card, navbar), with plans to expand.
8
+ - **Language**: English and Sinhala (bilingual descriptions).
9
+ - **Framework**: Tailwind CSS.
10
+ - **License**: MIT License (see [LICENSE](./LICENSE)).
11
+
12
+ ## Dataset Structure
13
+ The dataset is stored in a JSON file (`data.json`) with the following fields for each UI component:
14
+
15
+ | Field | Type | Description |
16
+ |----------------------|--------------|-----------------------------------------------------------------------------|
17
+ | `id` | String | Unique identifier for the UI component (e.g., "ui_sinhala_001"). |
18
+ | `description` | String | English description of the UI design (e.g., "Modern e-commerce product card"). |
19
+ | `sinhala_description` | String | Sinhala description of the UI design (e.g., "පැස්ටල් වර්ණ සහිත නිෂ්පාදන කාඩ්"). |
20
+ | `html` | String | HTML code snippet for the UI component, using Tailwind CSS classes. |
21
+ | `framework` | String | CSS framework used (e.g., "Tailwind CSS"). |
22
+ | `color_scheme` | List[String] | List of hex color codes used in the UI (e.g., ["#FBCFE8", "#FFFFFF"]). |
23
+ | `category` | String | UI style or category (e.g., "e-commerce", "modern", "minimalist"). |
24
+ | `responsive` | Boolean | Whether the UI is responsive (true/false). |
25
+ | `accessibility` | List[String] | Accessibility features (e.g., ["ARIA labels", "High-contrast text"]). |
26
+ | `image_path` | String | Path to the UI screenshot (e.g., "screenshots/ui_sinhala_001.png"). |
27
+ | `sinhala_font` | String | Sinhala font used (e.g., "Noto Sans Sinhala"). |
28
+
29
+ ### Example Entry
30
+ ```json
31
+ {
32
+ "id": "ui_sinhala_001",
33
+ "description": "Modern e-commerce product card with pastel colors and hover effects",
34
+ "sinhala_description": "පැස්ටල් වර්ණ සහ hover effects සහිත නවීන e-commerce නිෂ්පාදන කාඩ් එකක්",
35
+ "html": "<div class='bg-white p-6 rounded-lg shadow-md hover:shadow-xl transition duration-300'><img src='product.jpg' alt='Product' class='w-full h-48 object-cover rounded'><h3 class='text-lg font-semibold mt-4'>නිෂ්පාදනය</h3><p class='text-gray-600'>රු. 2500</p><button class='mt-4 bg-pink-400 text-white px-4 py-2 rounded hover:bg-pink-500' aria-label='Add to cart'>කරත්තයට එකතු කරන්න</button></div>",
36
+ "framework": "Tailwind CSS",
37
+ "color_scheme": ["#FBCFE8", "#FFFFFF", "#4B5563"],
38
+ "category": "e-commerce",
39
+ "responsive": true,
40
+ "accessibility": ["ARIA labels", "High-contrast text"],
41
+ "image_path": "screenshots/ui_sinhala_001.png",
42
+ "sinhala_font": "Noto Sans Sinhala"
43
+ }
dataset.json ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "ui_sinhala_001",
4
+ "description": "Modern e-commerce product card with pastel colors and hover effects",
5
+ "sinhala_description": "පැස්ටල් වර්ණ සහ hover effects සහිත නවීන e-commerce නිෂ්පාදන කාඩ් එකක්",
6
+ "html": "<div class='bg-white p-6 rounded-lg shadow-md hover:shadow-xl transition duration-300'><img src='product.jpg' alt='Product' class='w-full h-48 object-cover rounded'><h3 class='text-lg font-semibold mt-4'>නිෂ්පාදනය</h3><p class='text-gray-600'>රු. 2500</p><button class='mt-4 bg-pink-400 text-white px-4 py-2 rounded hover:bg-pink-500' aria-label='Add to cart'>කරත්තයට එකතු කරන්න</button></div>",
7
+ "framework": "Tailwind CSS",
8
+ "color_scheme": ["#FBCFE8", "#FFFFFF", "#4B5563"],
9
+ "category": "e-commerce",
10
+ "responsive": true,
11
+ "accessibility": ["ARIA labels", "High-contrast text"],
12
+ "image_path": "screenshots/ui_sinhala_001.png",
13
+ "sinhala_font": "Noto Sans Sinhala"
14
+ },
15
+ {
16
+ "id": "ui_sinhala_002",
17
+ "description": "Sticky navbar with blue gradient",
18
+ "sinhala_description": "නිල් පැහැ gradient සහ sticky positioning සහිත navbar එකක්",
19
+ "html": "<nav class='bg-gradient-to-r from-blue-500 to-blue-700 sticky top-0 p-4 text-white'><div class='container mx-auto flex justify-between items-center'><a href='#' class='text-2xl font-bold'>Logo</a><ul class='flex space-x-6'><li><a href='#' class='hover:underline'>මුල් පිටුව</a></li><li><a href='#' class='hover:underline'>ගැන</a></li></ul></div></nav>",
20
+ "framework": "Tailwind CSS",
21
+ "color_scheme": ["#3B82F6", "#1E3A8A"],
22
+ "category": "modern",
23
+ "responsive": true,
24
+ "accessibility": ["ARIA labels"],
25
+ "image_path": "screenshots/ui_sinhala_002.png",
26
+ "sinhala_font": "Noto Sans Sinhala"
27
+ },
28
+ {
29
+ "id": "nav-01",
30
+ "description": "Responsive navigation bar with dropdown menus",
31
+ "sinhala_description": "විවිධ පරිශීලක උපකරණ සඳහා ගැලපෙන පතන මෙනු සහිත සංචාලන තීරුව",
32
+ "html": "<nav class='main-nav'><ul><li><a href='#'>Home</a></li><li class='dropdown'><a href='#'>Services</a><ul class='dropdown-content'><li><a href='#'>Service 1</a></li><li><a href='#'>Service 2</a></li></ul></li><li><a href='#'>Contact</a></li></ul></nav>",
33
+ "framework": "vanilla",
34
+ "color_scheme": "blue-gray",
35
+ "category": "navigation",
36
+ "responsive": true,
37
+ "accessibility": "WCAG AA",
38
+ "image_path": "/assets/images/components/nav-01.jpg",
39
+ "sinhala_font": "Noto Sans Sinhala"
40
+ },
41
+ {
42
+ "id": "hero-01",
43
+ "description": "Full-width hero section with call-to-action",
44
+ "sinhala_description": "ක්‍රියාකාරී බොත්තම් සහිත පූර්ණ පළල ප්‍රධාන පෙදෙස",
45
+ "html": "<section class='hero'><div class='hero-content'><h1>Welcome to our website</h1><p>Learn more about our services and offerings</p><button class='cta-button'>Get Started</button></div></section>",
46
+ "framework": "vanilla",
47
+ "color_scheme": "blue-white",
48
+ "category": "hero",
49
+ "responsive": true,
50
+ "accessibility": "WCAG AA",
51
+ "image_path": "/assets/images/components/hero-01.jpg",
52
+ "sinhala_font": "Noto Sans Sinhala"
53
+ },
54
+ {
55
+ "id": "card-01",
56
+ "description": "Product card with image, title and price",
57
+ "sinhala_description": "රූපය, මාතෘකාව සහ මිල සහිත නිෂ්පාදන කාඩ්පත",
58
+ "html": "<div class='product-card'><img src='product.jpg' alt='Product Image'><h3>Product Title</h3><p class='price'>$19.99</p><button>Add to Cart</button></div>",
59
+ "framework": "bootstrap",
60
+ "color_scheme": "white-accent",
61
+ "category": "card",
62
+ "responsive": true,
63
+ "accessibility": "WCAG A",
64
+ "image_path": "/assets/images/components/card-01.jpg",
65
+ "sinhala_font": "Abhaya Libre"
66
+ },
67
+ {
68
+ "id": "form-01",
69
+ "description": "Contact form with validation",
70
+ "sinhala_description": "වලංගුකරණය සහිත සම්බන්ධතා පෝරමය",
71
+ "html": "<form class='contact-form'><div class='form-group'><label for='name'>Name</label><input type='text' id='name' required></div><div class='form-group'><label for='email'>Email</label><input type='email' id='email' required></div><div class='form-group'><label for='message'>Message</label><textarea id='message' rows='5'></textarea></div><button type='submit'>Submit</button></form>",
72
+ "framework": "vanilla",
73
+ "color_scheme": "neutral",
74
+ "category": "form",
75
+ "responsive": true,
76
+ "accessibility": "WCAG AAA",
77
+ "image_path": "/assets/images/components/form-01.jpg",
78
+ "sinhala_font": "Noto Sans Sinhala"
79
+ },
80
+ {
81
+ "id": "footer-01",
82
+ "description": "Simple footer with links and copyright",
83
+ "sinhala_description": "සබැඳි සහ ප්‍රකාශන හිමිකම් සහිත සරල පාදකය",
84
+ "html": "<footer class='site-footer'><div class='footer-links'><a href='#'>About</a><a href='#'>Services</a><a href='#'>Contact</a><a href='#'>Privacy Policy</a></div><p class='copyright'>&copy; 2025 Company Name. All rights reserved.</p></footer>",
85
+ "framework": "vanilla",
86
+ "color_scheme": "dark",
87
+ "category": "footer",
88
+ "responsive": true,
89
+ "accessibility": "WCAG AA",
90
+ "image_path": "/assets/images/components/footer-01.jpg",
91
+ "sinhala_font": "Noto Sans Sinhala"
92
+ },
93
+ {
94
+ "id": "table-01",
95
+ "description": "Responsive data table with sorting",
96
+ "sinhala_description": "වර්ගීකරණය කිරීමේ හැකියාව සහිත ප්‍රතිචාරාත්මක දත්ත වගුව",
97
+ "html": "<table class='data-table sortable'><thead><tr><th>ID</th><th>Name</th><th>Date</th><th>Status</th></tr></thead><tbody><tr><td>001</td><td>John Doe</td><td>2025-01-15</td><td>Active</td></tr><tr><td>002</td><td>Jane Smith</td><td>2025-02-20</td><td>Pending</td></tr></tbody></table>",
98
+ "framework": "jquery",
99
+ "color_scheme": "neutral",
100
+ "category": "table",
101
+ "responsive": true,
102
+ "accessibility": "WCAG AA",
103
+ "image_path": "/assets/images/components/table-01.jpg",
104
+ "sinhala_font": "Abhaya Libre"
105
+ },
106
+ {
107
+ "id": "gallery-01",
108
+ "description": "Image gallery with lightbox",
109
+ "sinhala_description": "ලයිට්බොක්ස් සහිත රූප ගැලරිය",
110
+ "html": "<div class='image-gallery'><a href='large-image-1.jpg' class='gallery-item'><img src='thumbnail-1.jpg' alt='Gallery Image 1'></a><a href='large-image-2.jpg' class='gallery-item'><img src='thumbnail-2.jpg' alt='Gallery Image 2'></a><a href='large-image-3.jpg' class='gallery-item'><img src='thumbnail-3.jpg' alt='Gallery Image 3'></a></div>",
111
+ "framework": "jquery",
112
+ "color_scheme": "light",
113
+ "category": "gallery",
114
+ "responsive": true,
115
+ "accessibility": "WCAG A",
116
+ "image_path": "/assets/images/components/gallery-01.jpg",
117
+ "sinhala_font": "Noto Sans Sinhala"
118
+ },
119
+ {
120
+ "id": "testimonial-01",
121
+ "description": "Customer testimonial slider",
122
+ "sinhala_description": "පාරිභෝගික ප්‍රශංසා ස්ලයිඩරය",
123
+ "html": "<div class='testimonial-slider'><div class='testimonial'><p class='quote'>This product has completely transformed our business operations!</p><p class='author'>- Sarah Johnson, CEO</p></div><div class='testimonial'><p class='quote'>The customer service was exceptional and the product exceeded our expectations.</p><p class='author'>- Michael Chen, Director</p></div></div>",
124
+ "framework": "slick",
125
+ "color_scheme": "light-accent",
126
+ "category": "testimonial",
127
+ "responsive": true,
128
+ "accessibility": "WCAG AA",
129
+ "image_path": "/assets/images/components/testimonial-01.jpg",
130
+ "sinhala_font": "Abhaya Libre"
131
+ },
132
+ {
133
+ "id": "pricing-01",
134
+ "description": "Pricing table with multiple tiers",
135
+ "sinhala_description": "විවිධ මට්ටම් සහිත මිල වගුව",
136
+ "html": "<div class='pricing-table'><div class='pricing-plan'><h3>Basic</h3><p class='price'>$19<span>/month</span></p><ul><li>Feature 1</li><li>Feature 2</li><li>Feature 3</li></ul><button>Select Plan</button></div><div class='pricing-plan featured'><h3>Pro</h3><p class='price'>$49<span>/month</span></p><ul><li>All Basic Features</li><li>Feature 4</li><li>Feature 5</li></ul><button>Select Plan</button></div></div>",
137
+ "framework": "vanilla",
138
+ "color_scheme": "blue-white",
139
+ "category": "pricing",
140
+ "responsive": true,
141
+ "accessibility": "WCAG AA",
142
+ "image_path": "/assets/images/components/pricing-01.jpg",
143
+ "sinhala_font": "Noto Sans Sinhala"
144
+ },
145
+ {
146
+ "id": "accordion-01",
147
+ "description": "Collapsible accordion for FAQs",
148
+ "sinhala_description": "නිතර අසන ප්‍රශ්න සඳහා හැකිළිය හැකි අකෝඩියනය",
149
+ "html": "<div class='accordion'><div class='accordion-item'><h3 class='accordion-header'>Question 1?</h3><div class='accordion-content'><p>Answer to question 1 goes here with detailed explanation.</p></div></div><div class='accordion-item'><h3 class='accordion-header'>Question 2?</h3><div class='accordion-content'><p>Answer to question 2 goes here with detailed explanation.</p></div></div></div>",
150
+ "framework": "jquery",
151
+ "color_scheme": "neutral",
152
+ "category": "accordion",
153
+ "responsive": true,
154
+ "accessibility": "WCAG AA",
155
+ "image_path": "/assets/images/components/accordion-01.jpg",
156
+ "sinhala_font": "Noto Sans Sinhala"
157
+ }
158
+ ]
dataset.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ with open("data.json", "r") as f:
4
+ data = json.load(f)
5
+
6
+ for entry in data:
7
+ assert "id" in entry, f"Missing id in entry {entry}"
8
+ assert "html" in entry, f"Missing html in entry {entry['id']}"
9
+ assert "image_path" in entry, f"Missing image_path in entry {entry['id']}"
10
+ print("Dataset validation passed!")