<style> /* Reset and Base Styles */<br /> .pcma-wrapper * {<br /> margin: 0;<br /> padding: 0;<br /> box-sizing: border-box;<br /> line-height: 1.5 !important;<br /> }<br /> .pcma-wrapper {<br /> max-width: 1280px;<br /> min-height: 550px;<br /> margin: 0 auto;<br /> padding: 24px;<br /> background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);<br /> border-radius: 16px;<br /> color: #1a1a2e;<br /> }<br /> .pcma-header {<br /> text-align: center;<br /> margin-bottom: 24px;<br /> }<br /> .pcma-title {<br /> font-size: 28px;<br /> font-weight: 700;<br /> color: #4150F6;<br /> margin-bottom: 8px;<br /> }<br /> .pcma-subtitle {<br /> font-size: 14px;<br /> color: #6b7280;<br /> }<br /> .pcma-container {<br /> display: grid;<br /> grid-template-columns: 1fr 1fr;<br /> gap: 24px;<br /> align-items: start;<br /> }<br /> /* Controls Panel */<br /> .pcma-controls {<br /> background: #ffffff;<br /> border-radius: 12px;<br /> padding: 20px;<br /> box-shadow: 0 4px 20px rgba(65, 80, 246, 0.08);<br /> border: 1px solid #e5e7ff;<br /> }<br /> .pcma-form-grid {<br /> display: grid;<br /> grid-template-columns: 1fr 1fr;<br /> gap: 16px;<br /> }<br /> .pcma-form-group {<br /> display: flex;<br /> flex-direction: column;<br /> gap: 6px;<br /> }<br /> .pcma-form-group.pcma-full-width {<br /> grid-column: 1 / -1;<br /> }<br /> .pcma-label {<br /> font-size: 13px;<br /> font-weight: 600;<br /> color: #374151;<br /> }<br /> .pcma-input,<br /> .pcma-select {<br /> padding: 10px 14px !important;<br /> border: 1.5px solid #e5e7eb!important;<br /> border-radius: 8px!important;<br /> font-size: 14px!important;<br /> transition: all 0.2s ease!important;<br /> background: #fafbff!important;<br /> color: #1a1a2e!important;<br /> }<br /> .pcma-input:focus,<br /> .pcma-select:focus {<br /> outline: none!important;<br /> border-color: #4150F6!important;<br /> box-shadow: 0 0 0 3px rgba(65, 80, 246, 0.15)!important;<br /> background: #ffffff!important;<br /> }<br /> .pcma-input::placeholder {<br /> color: #9ca3af!important;<br /> }<br /> .pcma-color-group {<br /> display: flex;<br /> align-items: center;<br /> gap: 10px;<br /> }<br /> .pcma-color-input {<br /> width: 40px !important;<br /> height: 40px !important;<br /> border: 2px solid #e5e7eb;<br /> border-radius: 8px;<br /> cursor: pointer;<br /> padding: 2px !important;<br /> background: #ffffff;<br /> }<br /> .pcma-color-input::-webkit-color-swatch-wrapper {<br /> padding: 0;<br /> }<br /> .pcma-color-input::-webkit-color-swatch {<br /> border: none;<br /> border-radius: 4px;<br /> }<br /> .pcma-toggle-container {<br /> display: flex;<br /> align-items: center;<br /> gap: 10px;<br /> }<br /> .pcma-toggle {<br /> position: relative;<br /> width: 48px;<br /> height: 26px;<br /> background: #e5e7eb;<br /> border-radius: 13px;<br /> cursor: pointer;<br /> transition: background 0.3s ease;<br /> }<br /> .pcma-toggle.pcma-active {<br /> background: #4150F6;<br /> }<br /> .pcma-toggle-knob {<br /> position: absolute;<br /> top: 3px;<br /> left: 3px;<br /> width: 20px;<br /> height: 20px;<br /> background: #ffffff;<br /> border-radius: 50%;<br /> transition: transform 0.3s ease;<br /> box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);<br /> }<br /> .pcma-toggle.pcma-active .pcma-toggle-knob {<br /> transform: translateX(22px);<br /> }<br /> .pcma-btn {<br /> padding: 12px 24px;<br /> border: none;<br /> border-radius: 8px;<br /> font-size: 14px;<br /> font-weight: 600;<br /> cursor: pointer;<br /> transition: all 0.2s ease;<br /> display: inline-flex;<br /> align-items: center;<br /> justify-content: center;<br /> gap: 8px;<br /> }<br /> .pcma-btn-primary {<br /> background: linear-gradient(135deg, #4150F6 0%, #5b68f8 100%);<br /> color: #ffffff;<br /> box-shadow: 0 4px 12px rgba(65, 80, 246, 0.35);<br /> }<br /> .pcma-btn-primary:hover {<br /> transform: translateY(-2px);<br /> box-shadow: 0 6px 20px rgba(65, 80, 246, 0.45);<br /> }<br /> .pcma-generate-btn {<br /> grid-column: 1 / -1;<br /> margin-top: 8px;<br /> }<br /> /* Preview Panel */<br /> .pcma-preview {<br /> background: #ffffff;<br /> border-radius: 12px;<br /> padding: 20px;<br /> box-shadow: 0 4px 20px rgba(65, 80, 246, 0.08);<br /> border: 1px solid #e5e7ff;<br /> display: flex;<br /> flex-direction: column;<br /> gap: 16px;<br /> }<br /> .pcma-chart-container {<br /> position: relative;<br /> width: 100%;<br /> aspect-ratio: 1;<br /> max-height: 320px;<br /> display: flex;<br /> align-items: center;<br /> justify-content: center;<br /> border-radius: 8px;<br /> overflow: hidden;<br /> }<br /> .pcma-chart-canvas {<br /> max-width: 100%;<br /> max-height: 100%;<br /> }<br /> .pcma-chart-title-display {<br /> text-align: center;<br /> font-size: 18px;<br /> font-weight: 700;<br /> margin-bottom: 8px;<br /> }<br /> /* Legend */<br /> .pcma-legend {<br /> display: flex;<br /> flex-wrap: wrap;<br /> gap: 12px;<br /> justify-content: center;<br /> padding: 12px;<br /> background: #f8f9ff;<br /> border-radius: 8px;<br /> }<br /> .pcma-legend-item {<br /> display: flex;<br /> align-items: center;<br /> gap: 6px;<br /> font-size: 12px;<br /> color: #374151;<br /> }<br /> .pcma-legend-color {<br /> width: 12px;<br /> height: 12px;<br /> border-radius: 3px;<br /> }<br /> /* Action Buttons */<br /> .pcma-actions {<br /> display: flex;<br /> flex-wrap: wrap;<br /> gap: 10px;<br /> justify-content: center;<br /> padding-top: 12px;<br /> border-top: 1px solid #e5e7ff;<br /> }<br /> .pcma-btn-secondary {<br /> background: #f0f2ff;<br /> color: #4150F6;<br /> border: 1.5px solid #d4d8ff;<br /> }<br /> .pcma-btn-secondary:hover {<br /> background: #e5e8ff;<br /> border-color: #4150F6;<br /> }<br /> .pcma-btn-success {<br /> background: linear-gradient(135deg, #10b981 0%, #34d399 100%);<br /> color: #ffffff;<br /> }<br /> .pcma-btn-success:hover {<br /> transform: translateY(-2px);<br /> box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);<br /> }<br /> /* Embed Modal */<br /> .pcma-modal-overlay {<br /> display: none;<br /> position: fixed;<br /> top: 0;<br /> left: 0;<br /> right: 0;<br /> bottom: 0;<br /> background: rgba(0, 0, 0, 0.5);<br /> backdrop-filter: blur(4px);<br /> z-index: 1000;<br /> align-items: center;<br /> justify-content: center;<br /> }<br /> .pcma-modal-overlay.pcma-show {<br /> display: flex;<br /> }<br /> .pcma-modal {<br /> background: #ffffff;<br /> border-radius: 16px;<br /> padding: 24px;<br /> max-width: 600px;<br /> width: 90%;<br /> max-height: 80vh;<br /> overflow-y: auto;<br /> box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);<br /> }<br /> .pcma-modal-header {<br /> display: flex;<br /> justify-content: space-between;<br /> align-items: center;<br /> margin-bottom: 16px;<br /> }<br /> .pcma-modal-title {<br /> font-size: 20px;<br /> font-weight: 700;<br /> color: #1a1a2e;<br /> }<br /> .pcma-modal-close {<br /> width: 32px;<br /> height: 32px;<br /> border: none;<br /> background: #f3f4f6;<br /> border-radius: 8px;<br /> cursor: pointer;<br /> font-size: 18px;<br /> color: #6b7280;<br /> transition: all 0.2s ease;<br /> }<br /> .pcma-modal-close:hover {<br /> background: #e5e7eb;<br /> color: #1a1a2e;<br /> }<br /> .pcma-embed-code {<br /> width: 100%;<br /> min-height: 150px;<br /> padding: 14px;<br /> border: 1.5px solid #e5e7eb;<br /> border-radius: 8px;<br /> font-family: 'Monaco', 'Menlo', monospace;<br /> font-size: 12px;<br /> resize: vertical;<br /> background: #f8f9ff;<br /> color: #1a1a2e;<br /> }<br /> .pcma-copy-btn {<br /> margin-top: 12px;<br /> width: 100%;<br /> }<br /> .pcma-toast {<br /> position: fixed;<br /> bottom: 24px;<br /> left: 50%;<br /> transform: translateX(-50%) translateY(100px);<br /> background: #1a1a2e;<br /> color: #ffffff;<br /> padding: 12px 24px;<br /> border-radius: 8px;<br /> font-size: 14px;<br /> font-weight: 500;<br /> opacity: 0;<br /> transition: all 0.3s ease;<br /> z-index: 1001;<br /> }<br /> .pcma-toast.pcma-show {<br /> transform: translateX(-50%) translateY(0);<br /> opacity: 1;<br /> }<br /> /* Icon SVGs */<br /> .pcma-icon {<br /> width: 16px;<br /> height: 16px;<br /> }<br /> /* Responsive Design */<br /> @media (max-width: 900px) {<br /> .pcma-container {<br /> grid-template-columns: 1fr;<br /> }<br /> .pcma-chart-container {<br /> max-height: 280px;<br /> }<br /> }<br /> @media (max-width: 600px) {<br /> .pcma-wrapper {<br /> padding: 16px;<br /> }<br /> .pcma-form-grid {<br /> grid-template-columns: 1fr;<br /> }<br /> .pcma-form-group {<br /> grid-column: 1;<br /> }<br /> .pcma-form-group.pcma-full-width {<br /> grid-column: 1;<br /> }<br /> .pcma-title {<br /> font-size: 22px;<br /> }<br /> .pcma-actions {<br /> flex-direction: column;<br /> }<br /> .pcma-btn {<br /> width: 100%;<br /> }<br /> .pcma-chart-container {<br /> max-height: 250px;<br /> }<br /> }<br /> </style> <header> <h1>Pie Chart Maker</h1> Create stunning pie charts instantly. Download as image or embed on your website. </header><!-- Controls Panel --> <label>Chart Title</label> <input id="pcma-chart-title" type="text" value="My Pie Chart" placeholder="Enter chart title" /> <label>Donut Mode</label> Enable <label>Background Color</label> <input id="pcma-bg-color" type="color" value="#ffffff" /> #ffffff <label>Labels (comma separated)</label> <input id="pcma-labels" type="text" value="Work, Sleep, Eat, Play, Exercise" placeholder="Label1, Label2, Label3..." /> <label>Values (comma separated)</label> <input id="pcma-values" type="text" value="35, 25, 15, 15, 10" placeholder="10, 20, 30..." /> <label>Legend Position</label> <select id="pcma-legend-position"> <option value="bottom">Bottom</option> <option value="right">Right</option> <option value="none">Hidden</option> </select> <label>Show Values</label> <select id="pcma-show-values"> <option value="percentage">Percentage</option> <option value="value">Value</option> <option value="both">Both</option> <option value="none">None</option> </select> <label>Donut Hole Size</label> <input id="pcma-hole-size" max="0.8" min="0" step="0.1" type="number" value="0" placeholder="0 to 0.8" /> <label>Rotation (degrees)</label> <input id="pcma-rotation" max="360" min="0" type="number" value="0" placeholder="0 to 360" /> <label>Title Color</label> <input id="pcma-title-color" type="color" value="#1a1a2e" /> <label>Legend Color</label> <input id="pcma-legend-color" type="color" value="#374151" /> <button id="pcma-generate-btn"> Generate Chart </button> <!-- Preview Panel --> My Pie Chart <canvas id="pcma-canvas" width="400" height="400"></canvas> <button id="pcma-download-png"> PNG </button> <button id="pcma-download-jpeg"> JPEG </button> <button id="pcma-download-svg"> SVG </button> <button id="pcma-embed-btn"> Embed Code </button> <!-- Embed Modal --> <h3>Embed Your Chart</h3> <button id="pcma-modal-close">×</button> <p style="color: #6b7280; font-size: 14px; margin-bottom: 16px;">Copy the code below and paste it into your website's HTML.</p> <textarea id="pcma-embed-code" readonly="readonly"></textarea> <button id="pcma-copy-embed"> Copy to Clipboard </button> <!-- Toast -->