JSFiddle - React, Tailwind, and code Playground

by rami7250

HTML

<div class="oxy-progress-bar">
    <div class="oxy-progress-bar-background">
        <!-- 
            שימו לב: הסרתי את 'style="width: 85%;"' מכאן 
        -->
        <div class="oxy-progress-bar-progress-wrap">
            <div class="oxy-progress-bar-progress">
                <div class="oxy-progress-bar-overlay-text">
                    Lorem Ipsum Dolor
                </div>
                <div class="oxy-progress-bar-overlay-percent">85%</div>
            </div>
        </div>
    </div>
</div>

CSS

/* הגדרות כלליות לדוגמה */
body {
    padding: 40px;
    font-family: sans-serif;
}

/* 
  קונטיינר חיצוני של ה-Progress Bar
*/
.oxy-progress-bar-background {
    background-color: #000000;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
}

/* 
  המעטפת שקובעת את רוחב ההתקדמות - כאן תפעל אנימציית הטעינה
*/
.oxy-progress-bar-progress-wrap {
    width: 0%; /* מתחילים מרוחב אפס */
    animation: fillAnimation 2s ease-out forwards; /* הפעלת אנימציית המילוי */
    animation-delay: 0.0s; /* השהייה קטנה לפני שהאנימציה מתחילה */
}

/* 
  הסרגל הפנימי עם הפסים
*/
.oxy-progress-bar-progress {
    background-color: #ff5252;
    padding: 10px 15px; /* --- תיקון: ריווח מוקטן לגובה שורה אחת --- */
    border-radius: 25px;
    
    background-image: linear-gradient(-45deg,rgba(255,255,255,.12) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.12) 50%,rgba(255,255,255,.12) 75%,transparent 75%,transparent);
    background-size: 44px 44px;
    animation: oxy_progress_bar_stripes 1s linear infinite;

    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
}


/* 
  הגדרת אנימציית המילוי (טעינה)
*/
@keyframes fillAnimation {
  from {
    width: 0%;
  }
  to {
    width: 85%; /* הרוחב הסופי שאליו נגיע */
  }
}

/* 
  הגדרת אנימציית הפסים
*/
@keyframes oxy_progress_bar_stripes {
  from {
    background-position: 44px 0;
  }
  to {
    background-position: 0 0;
  }
}

/* 
  עיצוב הטקסט והאחוזים
*/
.oxy-progress-bar-overlay-text,
.oxy-progress-bar-overlay-percent {
    font-size: 14px; /* --- תיקון: פונט מוקטן --- */
    font-weight: 600;
}