Update components.json
Browse files- components.json +1 -0
components.json
CHANGED
|
@@ -290,6 +290,7 @@
|
|
| 290 |
"segments_json": "[{\"label\": \"\\ud83c\\udf81 Grand Prize\", \"color\": \"#FF6B6B\", \"startAngle\": 0, \"endAngle\": 45.0, \"midAngle\": 22.5}, {\"label\": \"\\ud83d\\udc8e 50 Gems\", \"color\": \"#4ECDC4\", \"startAngle\": 45.0, \"endAngle\": 90.0, \"midAngle\": 67.5}, {\"label\": \"\\u2b50 100 XP\", \"color\": \"#45B7D1\", \"startAngle\": 90.0, \"endAngle\": 135.0, \"midAngle\": 112.5}, {\"label\": \"\\ud83c\\udfab Free Trial\", \"color\": \"#96CEB4\", \"startAngle\": 135.0, \"endAngle\": 180.0, \"midAngle\": 157.5}, {\"label\": \"\\ud83d\\udd25 Double Points\", \"color\": \"#FFEAA7\", \"startAngle\": 180.0, \"endAngle\": 225.0, \"midAngle\": 202.5}, {\"label\": \"\\ud83d\\udcb0 10% Off\", \"color\": \"#DDA0DD\", \"startAngle\": 225.0, \"endAngle\": 270.0, \"midAngle\": 247.5}, {\"label\": \"\\ud83c\\udfae Bonus Round\", \"color\": \"#98D8C8\", \"startAngle\": 270.0, \"endAngle\": 315.0, \"midAngle\": 292.5}, {\"label\": \"\\ud83c\\udf40 Try Again\", \"color\": \"#F7DC6F\", \"startAngle\": 315.0, \"endAngle\": 360.0, \"midAngle\": 337.5}]",
|
| 291 |
"rotation": 0
|
| 292 |
},
|
|
|
|
| 293 |
"python_code": "class SpinWheel(gr.HTML):\n \"\"\"\n An interactive prize wheel component with:\n - Smooth CSS spinning animation\n - Customizable segments with colors\n - Win detection with callbacks\n - Confetti celebration effect\n \"\"\"\n def __init__(\n self,\n value=None, # Currently selected/won prize (string)\n segments=None, # List of {\"label\": str, \"color\": str, \"weight\": int}\n segments_json=None, # JSON string of computed segments (for updates)\n rotation=0, # Current wheel rotation in degrees (persists position)\n **kwargs\n ):\n # Use provided segments or default\n if segments is None:\n segments = DEFAULT_SEGMENTS\n\n # Compute segment data if not provided as JSON\n if segments_json is None:\n segment_data = compute_segment_data(segments)\n segments_json = json.dumps(segment_data)\n\n super().__init__(\n value=value,\n segments_json=segments_json,\n rotation=rotation,\n html_template=HTML_TEMPLATE,\n css_template=CSS_TEMPLATE,\n js_on_load=JS_ON_LOAD,\n **kwargs\n )\n\n def api_info(self):\n return {\"type\": \"string\", \"description\": \"The label of the winning segment\"}\n"
|
| 294 |
},
|
| 295 |
{
|
|
|
|
| 290 |
"segments_json": "[{\"label\": \"\\ud83c\\udf81 Grand Prize\", \"color\": \"#FF6B6B\", \"startAngle\": 0, \"endAngle\": 45.0, \"midAngle\": 22.5}, {\"label\": \"\\ud83d\\udc8e 50 Gems\", \"color\": \"#4ECDC4\", \"startAngle\": 45.0, \"endAngle\": 90.0, \"midAngle\": 67.5}, {\"label\": \"\\u2b50 100 XP\", \"color\": \"#45B7D1\", \"startAngle\": 90.0, \"endAngle\": 135.0, \"midAngle\": 112.5}, {\"label\": \"\\ud83c\\udfab Free Trial\", \"color\": \"#96CEB4\", \"startAngle\": 135.0, \"endAngle\": 180.0, \"midAngle\": 157.5}, {\"label\": \"\\ud83d\\udd25 Double Points\", \"color\": \"#FFEAA7\", \"startAngle\": 180.0, \"endAngle\": 225.0, \"midAngle\": 202.5}, {\"label\": \"\\ud83d\\udcb0 10% Off\", \"color\": \"#DDA0DD\", \"startAngle\": 225.0, \"endAngle\": 270.0, \"midAngle\": 247.5}, {\"label\": \"\\ud83c\\udfae Bonus Round\", \"color\": \"#98D8C8\", \"startAngle\": 270.0, \"endAngle\": 315.0, \"midAngle\": 292.5}, {\"label\": \"\\ud83c\\udf40 Try Again\", \"color\": \"#F7DC6F\", \"startAngle\": 315.0, \"endAngle\": 360.0, \"midAngle\": 337.5}]",
|
| 291 |
"rotation": 0
|
| 292 |
},
|
| 293 |
+
"repo_url": "https://huggingface.co/spaces/ysharma/spin-wheel",
|
| 294 |
"python_code": "class SpinWheel(gr.HTML):\n \"\"\"\n An interactive prize wheel component with:\n - Smooth CSS spinning animation\n - Customizable segments with colors\n - Win detection with callbacks\n - Confetti celebration effect\n \"\"\"\n def __init__(\n self,\n value=None, # Currently selected/won prize (string)\n segments=None, # List of {\"label\": str, \"color\": str, \"weight\": int}\n segments_json=None, # JSON string of computed segments (for updates)\n rotation=0, # Current wheel rotation in degrees (persists position)\n **kwargs\n ):\n # Use provided segments or default\n if segments is None:\n segments = DEFAULT_SEGMENTS\n\n # Compute segment data if not provided as JSON\n if segments_json is None:\n segment_data = compute_segment_data(segments)\n segments_json = json.dumps(segment_data)\n\n super().__init__(\n value=value,\n segments_json=segments_json,\n rotation=rotation,\n html_template=HTML_TEMPLATE,\n css_template=CSS_TEMPLATE,\n js_on_load=JS_ON_LOAD,\n **kwargs\n )\n\n def api_info(self):\n return {\"type\": \"string\", \"description\": \"The label of the winning segment\"}\n"
|
| 295 |
},
|
| 296 |
{
|