console.log('clicked')" x-data="{ menuStartHeight: 100, init() { $refs.menu.style.setProperty( '--menu-height', this.menuStartHeight + 'px' ); }, handleScroll() { const scrollPosition = window.pageYOffset; const animationStart = 40; const animationEnd = 100; const animationPct = Math.min( Math.max( (scrollPosition - animationStart) / (animationEnd - animationStart), 0 ), 1 ); const getAnimatedValue = (start, end) => { return start + (end - start) * animationPct; }; const menuEndHeight = 50; const menuHeight = getAnimatedValue(this.menuStartHeight, menuEndHeight); $refs.menu.style.setProperty( '--menu-height', menuHeight + 'px' ); const menuBackgroundColorOpacityStart = 0; const menuBackgroundColorOpacityEnd = 1; const menuBackgroundColorOpacity = getAnimatedValue( menuBackgroundColorOpacityStart, menuBackgroundColorOpacityEnd ); $refs.menu.style.setProperty( '--background-color-opacity', menuBackgroundColorOpacity ); const menuColorStart = 255; const menuColorEnd = 0; const color = getAnimatedValue(menuColorStart, menuColorEnd); $refs.menu.style.setProperty( '--color', `rgba(${color}, ${color}, ${color}, 1)` ); $refs.menu.style.setProperty( '--logo-overlay-translate-y', (scrollPosition * -0.5) + 'px' ); $refs.menu.style.setProperty( '--logo-overlay-opacity', Math.max(1 - scrollPosition * 0.005, 0) ); // TODO: The link color should really be Green Dragon Green. // const menuHeader = this.$refs.menuHeader; // menuHeader.style.opacity = Math.min(scrollPosition * 0.01, 1); } }" style=" --background-color-opacity: 0; --color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, var(--background-color-opacity)); color: var(--color); " >
Pub
Food
Green Dragon
Events
Contact
Green Dragon
Pub
Food
Events
Contact
Green Dragon
News
22nd September 2024
Curry night is back!
19th August 2024
Bulk beer pricing announced
25th March 2024
Green Dragon wins CAMRA pub of the year award!