Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                 <div class="container">
        <h1>Cardiology Intake Form</h1>
        <div class="progress-bar">
            <div class="progress"></div>
        </div>
        <form id="cardiologyForm">
            <!-- Personal Information -->
            <div class="form-section active" data-section="1">
                <h2 class="section-title">Personal Information</h2>
                <div class="form-group">
                    <label for="fullName">Full Name</label>
                    <input type="text" id="fullName" required>
                </div>
                <div class="form-group">
                    <label for="dob">Date of Birth</label>
                    <input type="date" id="dob" required>
                </div>
                <div class="form-group">
                    <label for="phone">Phone Number</label>
                    <input type="tel" id="phone" required>
                </div>
                <div class="form-group">
                    <label for="email">Email</label>
                    <input type="email" id="email" required>
                </div>
            </div>

            <!-- Insurance Details -->
            <div class="form-section" data-section="2">
                <h2 class="section-title">Insurance Details</h2>
                <div class="form-group">
                    <label for="provider">Insurance Provider</label>
                    <input type="text" id="provider" required>
                </div>
                <div class="form-group">
                    <label for="policyNumber">Policy Number</label>
                    <input type="text" id="policyNumber" required>
                </div>
            </div>

            <!-- Medical History -->
            <div class="form-section" data-section="3">
                <h2 class="section-title">Medical History</h2>
                <div class="form-group">
                    <label>Known Medical Conditions</label>
                    <div class="checkbox-group">
                        <div class="checkbox-item">
                            <input type="checkbox" id="hypertension">
                            <label for="hypertension">Hypertension</label>
                        </div>
                        <div class="checkbox-item">
                            <input type="checkbox" id="diabetes">
                            <label for="diabetes">Diabetes</label>
                        </div>
                        <div class="checkbox-item">
                            <input type="checkbox" id="cholesterol">
                            <label for="cholesterol">High Cholesterol</label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="familyHistory">Family History of Heart Disease</label>
                    <select id="familyHistory" required>
                        <option value="">Select...</option>
                        <option value="yes">Yes</option>
                        <option value="no">No</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="medications">Current Medications</label>
                    <textarea id="medications" rows="3"></textarea>
                </div>
            </div>

            <!-- Heart-Related Symptoms -->
            <div class="form-section" data-section="4">
                <h2 class="section-title">Heart-Related Symptoms</h2>
                <div class="form-group">
                    <label>Current Symptoms</label>
                    <div class="checkbox-group">
                        <div class="checkbox-item">
                            <input type="checkbox" id="chestPain">
                            <label for="chestPain">Chest Pain</label>
                        </div>
                        <div class="checkbox-item">
                            <input type="checkbox" id="shortnessBreath">
                            <label for="shortnessBreath">Shortness of Breath</label>
                        </div>
                        <div class="checkbox-item">
                            <input type="checkbox" id="irregularHeartbeat">
                            <label for="irregularHeartbeat">Irregular Heartbeat</label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="otherSymptoms">Other Symptoms</label>
                    <textarea id="otherSymptoms" rows="3"></textarea>
                </div>
            </div>

            <!-- Lifestyle Factors -->
            <div class="form-section" data-section="5">
                <h2 class="section-title">Lifestyle Factors</h2>
                <div class="form-group">
                    <label for="smokingStatus">Smoking Status</label>
                    <select id="smokingStatus" required>
                        <option value="">Select...</option>
                        <option value="current">Current Smoker</option>
                        <option value="former">Former Smoker</option>
                        <option value="never">Never Smoked</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="alcohol">Alcohol Consumption</label>
                    <select id="alcohol" required>
                        <option value="">Select...</option>
                        <option value="yes">Yes</option>
                        <option value="no">No</option>
                    </select>
                </div>
            </div>

            <!-- Previous Cardiac Tests -->
            <div class="form-section" data-section="6">
                <h2 class="section-title">Previous Cardiac Tests or Procedures</h2>
                <div class="form-group">
                    <label>Previous Tests</label>
                    <div class="checkbox-group">
                        <div class="checkbox-item">
                            <input type="checkbox" id="ekg">
                            <label for="ekg">EKG</label>
                        </div>
                        <div class="checkbox-item">
                            <input type="checkbox" id="stressTest">
                            <label for="stressTest">Stress Test</label>
                        </div>
                        <div class="checkbox-item">
                            <input type="checkbox" id="echocardiogram">
                            <label for="echocardiogram">Echocardiogram</label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="surgeries">Previous Surgeries or Interventions</label>
                    <select id="surgeries" required>
                        <option value="">Select...</option>
                        <option value="yes">Yes</option>
                        <option value="no">No</option>
                    </select>
                </div>
            </div>

            <div class="buttons">
                <button type="button" class="btn-prev" id="prevBtn" style="display: none;">Previous</button>
                <button type="button" class="btn-next" id="nextBtn">Next</button>
                <button type="submit" class="btn-submit" id="submitBtn" style="display: none;">Submit</button>
            </div>
        </form>
    </div>
              
            
!

CSS

              
                :root {
            --primary: #647dee;
            --secondary: #7f53ac;
            --background: #f8f9fa;
            --text: #2d3436;
            --error: #ff7675;
            --success: #55efc4;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: var(--background);
            color: var(--text);
            line-height: 1.6;
            padding: 2rem;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            background: white;
            padding: 2rem;
            border-radius: 15px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }

        h1 {
            text-align: center;
            color: var(--primary);
            margin-bottom: 2rem;
            font-size: 2.5rem;
        }

        .progress-bar {
            width: 100%;
            height: 5px;
            background: #eee;
            margin-bottom: 2rem;
            border-radius: 10px;
            overflow: hidden;
        }

        .progress {
            width: 0%;
            height: 100%;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            transition: width 0.3s ease;
        }

        .form-section {
            display: none;
            animation: fadeIn 0.5s ease;
        }

        .form-section.active {
            display: block;
        }

        .section-title {
            color: var(--primary);
            margin: 1.5rem 0;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--primary);
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }

        input[type="text"],
        input[type="email"],
        input[type="tel"],
        input[type="date"],
        textarea,
        select {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.3s ease;
        }

        input:focus,
        textarea:focus,
        select:focus {
            outline: none;
            border-color: var(--primary);
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .buttons {
            display: flex;
            justify-content: space-between;
            margin-top: 2rem;
        }

        button {
            padding: 0.8rem 2rem;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            cursor: pointer;
            transition: transform 0.2s ease, background 0.3s ease;
        }

        button:hover {
            transform: translateY(-2px);
        }

        .btn-prev {
            background: #eee;
            color: var(--text);
        }

        .btn-next {
            background: var(--primary);
            color: white;
        }

        .btn-submit {
            background: var(--success);
            color: white;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (max-width: 600px) {
            body {
                padding: 1rem;
            }
            
            .container {
                padding: 1rem;
            }

            .checkbox-group {
                grid-template-columns: 1fr;
            }
        }
              
            
!

JS

              
                 document.addEventListener('DOMContentLoaded', function() {
            const form = document.getElementById('cardiologyForm');
            const sections = document.querySelectorAll('.form-section');
            const progressBar = document.querySelector('.progress');
            const prevBtn = document.getElementById('prevBtn');
            const nextBtn = document.getElementById('nextBtn');
            const submitBtn = document.getElementById('submitBtn');
            let currentSection = 0;

            function updateButtons() {
                prevBtn.style.display = currentSection === 0 ? 'none' : 'block';
                if (currentSection === sections.length - 1) {
                    nextBtn.style.display = 'none';
                    submitBtn.style.display = 'block';
                } else {
                    nextBtn.style.display = 'block';
                    submitBtn.style.display = 'none';
                }
            }

            function updateProgress() {
                const progress = ((currentSection + 1) / sections.length) * 100;
                progressBar.style.width = `${progress}%`;
            }

            function showSection(sectionIndex) {
                sections.forEach((section, index) => {
                    section.classList.toggle('active', index === sectionIndex);
                });
                updateButtons();
                updateProgress();
            }

            prevBtn.addEventListener('click', () => {
                if (currentSection > 0) {
                    currentSection--;
                    showSection(currentSection);
                }
            });

            nextBtn.addEventListener('click', () => {
                if (currentSection < sections.length - 1) {
                    currentSection++;
                    showSection(currentSection);
                }
            });

            form.addEventListener('submit', (e) => {
                e.preventDefault();
                // Add your form submission logic here
                alert('Form submitted successfully!');
            });

            // Initialize
            updateButtons();
            updateProgress();
        });
              
            
!
999px

Console