Dancer2-Plugin-LiteBlog

 view release on metacpan or  search on metacpan

lib/Dancer2/Plugin/LiteBlog/Scaffolder/Data.pm  view on Meta::CPAN

}

body {
    font-family: var(--liteblog-content-family);
    background-color: var(--background-color);

    margin: 0;
    padding: 0;

    font-size: 16px;
    line-height: 1.3;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600; /* slightly bold but not too heavy */
    font-family: var(--liteblog-title-family); 
}
h1 {
    font-size: 2.5rem;
}
h2 {
    font-size: 2rem;
}
h3 {
    font-size: 1.75rem;
}

h1.site-title {
    font-size: 1.5rem;
    text-align: center;
}

a {
    color: var(--link-color);
    text-decoration: none; /* Remove underline */
    transition: color 0.3s ease; /* Smooth color transition */
}
a:hover {
    color: var(--link-hover-color);
}

button, .btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
button:hover, .btn:hover {
    background-color: var(--primary-hover);
}

/* Accessibility rules */
a:focus, button:focus, .btn:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Header Menu */
/* CSS for the mobile header */
#mobile-menu-container {
    position: relative; /* to hold the popup menu */
}

.hero-bar-hidden {
    display: none;
}

#mobile-header {
    display: none;
    background-color: #2d2d2d;
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10; /* Adjust z-index as needed */
    align-items: center; /* Center vertically */
    justify-content: space-between; /* space out the logo, title, and menu */
    flex-direction: row; /* Default flex-direction */
    padding: 5px;
}

#menu-toggle {
	margin-left: auto;
	margin-right: 20px;
    flex: none;
}

.site-title {
    margin: 0;
    flex-grow: 1; /* allows the title to take available space */
    text-align: left; /* align the site name to the left */
    padding: 0 10px; /* spacing around the site title */
}

.hamburger-menu {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 24px; /* adjust height of the whole menu */
}

.hamburger-menu .bar {
    background-color: #ccc; /* color of the bar */
    height: 4px; /* thickness of each bar */
    width: 32px; /* width of each bar */
    border-radius: 2px; /* rounded edges */
}

/* The Hamburger Menu */
#mobile-navigation-menu {
    z-index: 9999; /* on top of other content */
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5; 
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    
    /* display: none; */
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.2s linear;
}

#mobile-navigation-menu.open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s; /* apply the transition immediately when opening */
}

.mobile-nav a {
    padding: 10px 20px;
    text-decoration: none;
    text-align: center;
    color: #333;
    border-bottom: 1px solid #ddd; /* separator between items */
}

.mobile-nav a:last-child {
    border-bottom: none; /* remove separator for the last item */
}

.mobile-nav a:hover {
    background-color: #ddd; /* change hover color as desired */
}

#avatar-icon {
    display: inline-block;
    margin-left: 5px; 
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
}

#avatar-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#site-title-button a {
    color: #ccc;
}

#site-title-button {

lib/Dancer2/Plugin/LiteBlog/Scaffolder/Data.pm  view on Meta::CPAN


// Now handle the showing/hiding logic of the header based on scrolling
window.addEventListener('scroll', function () {
    var heroSection = document.getElementById('hero'); // the big Hero header
    var heroBanner = document.getElementById('hero-banner'); // the navigation bar
    var mobileHeader = document.getElementById('mobile-header'); // the mobile compact bar

    mobileHeaderStyle = window.getComputedStyle(mobileHeader);
    var scrollY = window.scrollY || window.pageYOffset;

    // Show the mobile-header if on small screen (<768) and 
    // after user scrolls past heroSection height, or 
    // immediatly if not present.
    if (window.innerWidth <= 768) {
        mobileTriggerPoint = 0;
        if (heroSection && showHeroSection) {
            mobileTriggerPoint = heroSection.clientHeight;
        }
        if (scrollY >= mobileTriggerPoint) {
            mobileHeader.style.display = 'flex';
        } else {
            mobileHeader.style.display = 'none';
        }
    }

    /* Just do nothing if the mobile nav bar is displayed or 
     * if the heroSection is not enabled on this page */ 
    if (mobileHeaderStyle.display == 'flex' || showHeroSection == false) {
        return false;
    }

    /* Always display the hero navigation bar on scrolling */
    if (window.scrollY > heroSection.clientHeight) {
        //heroBanner.style.display = 'flex';
        heroBanner.classList.add('visible-hero')
        heroBanner.classList.remove('hidden-hero')
        heroBanner.style.display = 'flex';
        if (heroSection) { 
            heroSection.classList.remove('visible-hero');
            heroSection.classList.add('hidden-hero');
        }
    } else {
        heroBanner.style.display = 'none';
        heroBanner.classList.remove('visible-hero')
        heroBanner.classList.add('hidden-hero')
        if (heroSection) { 
            heroSection.classList.add('visible-hero');
            heroSection.classList.remove('hidden-hero');
        }
    }
});
</script>
[% END %]

[% IF navigation %]
<!-- Handle the click on the hamburger icon -->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', (event) => {
    // Get the elements
    const menuToggle = document.querySelector('#menu-toggle');
    const mobileMenu = document.querySelector('#mobile-navigation-menu');

    // Add event listener
    menuToggle.addEventListener('click', function() {
        // Toggle the .open class on the mobile menu
        mobileMenu.classList.toggle('open');
    });
});
</script>
[% END %]

[% IF feature.highlight %]
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', (event) => {
    document.querySelectorAll('pre code').forEach((block) => {
        hljs.highlightBlock(block);
    });
});
</script>
[% END %]

    </body>
</html>



( run in 2.661 seconds using v1.01-cache-2.11-cpan-97f6503c9c8 )