מדיה ויקי:Common.css

מתוך אוצר מהרי''ט
קפיצה לניווט קפיצה לחיפוש

הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
@import url('https://fonts.googleapis.com/css2?family=David+Libre:wght@400;700&display=swap');

body {
    font-family: 'David Libre', serif;
    font-size: 19px; /* הוסף שורה זו לשינוי גודל הפונט */
}

.bookshelf-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #F5F5DC;
    padding: 20px;
    border: 2px solid #8B4513;
}

.shelf {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    padding: 10px;
    border-bottom: 5px solid #8B4513;
    margin-bottom: 20px;
}


#toc {
    position: fixed;  /* קיבוע המיקום כך שיישאר במקום בזמן גלילה */
    right: 20px;     /* מרחק מימין */
    top: 20px;       /* מרחק מלמעלה */
    width: 250px;    /* רוחב קבוע לתפריט */
    max-height: calc(100vh - 40px); /* גובה מקסימלי שמתאים למסך */
    overflow-y: auto; /* מאפשר גלילה בתוך התפריט אם הוא ארוך */
    background-color: #faf5eb; /* צבע רקע בהיר */
    padding: 15px;   /* ריווח פנימי */
    border-radius: 8px; /* פינות מעוגלות */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* צל עדין */
    z-index: 1000;   /* מבטיח שהתפריט יופיע מעל שאר התוכן */
}

/* התאמה למסכים קטנים */
@media screen and (max-width: 768px) {
    #toc {
        position: static; /* במסך קטן התפריט חוזר למצב רגיל */
        width: auto;
        margin: 20px;
        right: auto;
    }
    
    #content {
        margin-right: 20px; /* התאמת המרווח בתוכן */
    }
}

.book {
    width: 100px;
    height: 150px;
    margin: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #000;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.book:hover {
    transform: rotate(0deg);
}

.book-link {
    text-decoration: none;
    color: white;
    font-weight: bold;
    text-align: center;
}

#toc {
    float: right;
    margin: 0 0 1em 1em;
    width: 20%;
}


#content {
    margin-left: 10%;
    margin-right: 10%;
}

@media screen and (max-width: 768px) {
    #content {
        margin-left: 5%;
        margin-right: 5%;
        
    }
}
#toc {
    position: absolute;
    right: -250px; /* מיקום מחוץ לשוליים הימניים */
    top: 100px; /* התאמה לפי הצורך */
    border: none; /* להסרת הריבוע מסביב */
    background: none; /* להסרת צבע רקע */
}
#toc {
    margin-right: 70px; /* משנה את המרווח בין תוכן העניינים לטקסט */
}
#toc .toctitle {
    display: none;
}
.mainpage #toc {
    display: none;
}
#toc {
    font-size: 75%; /* משנה את גודל הפונט בתוכן העניינים */
}

.page-וויאל_משה_מאמר_לשון_הקודש #toc,
.page-וויאל_משה_מאמר_לשון_הקודש_ .mw-parser-output #toc {
    display: none;
}

#p-tb { display: none; } /* הסתרת הכלים */

#p-tb { display: none; }

.toc {
    position: fixed !important;
    right: 0 !important;
    width: 200px !important;
    padding: 10px !important;
    max-height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
    transition: top 0.3s ease !important;
}

/* הוספת קוד JavaScript להאזנה לאירוע גלילה */
<script>
window.addEventListener('scroll', function() {
    const header = document.querySelector('#firstHeading'); // או כל סלקטור אחר שמייצג את "דף ראשי"
    const toc = document.querySelector('.toc');
    
    if (window.scrollY > header.offsetHeight + header.offsetTop) {
        toc.style.top = '0px';
    } else {
        toc.style.top = '220px'; // או המרחק המדויק שאתה רוצה כשנמצאים בראש העמוד
    }
});

// קוד לסנכרון תוכן העניינים עם המיקום בעמוד
document.addEventListener('scroll', function() {
    const sections = document.querySelectorAll('h2, h3'); // או כל סלקטור אחר שמתאים לכותרות שלך
    const tocLinks = document.querySelectorAll('.toc a');
    
    sections.forEach((section, index) => {
        const rect = section.getBoundingClientRect();
        if (rect.top >= 0 && rect.top <= window.innerHeight / 2) {
            tocLinks.forEach(link => link.classList.remove('active'));
            tocLinks[index]?.classList.add('active');
        }
    });
});
</script>

/* סגנון להדגשת הקישור הפעיל בתוכן העניינים */
.toc a.active {
    font-weight: bold !important;
    color: #0366d6 !important;
}

#content {
    margin-right: 300px !important;
}

@media screen and (max-width: 768px) {
    .toc {
        display: none !important;
    }
    
    #content {
        margin-right: 20px !important;
    }
}