A .gov website belongs to an official government organization in the United States.
+//A lock (🔒) or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
+//diff --git a/src/stable/components/GovBanner/GovBanner.css b/src/stable/components/GovBanner/GovBanner.css index ab128c7d..1a78f4c0 100644 --- a/src/stable/components/GovBanner/GovBanner.css +++ b/src/stable/components/GovBanner/GovBanner.css @@ -26,16 +26,16 @@ flex-direction: column; align-items: center; } -.city-name > span { +.city-name span { display: inline-flex; flex-direction: column; align-items: center; } -.city-name > span:first-child { +.city-name span:first-child { font-size: 0.75em; line-height: 1; } -.city-name > span:last-child { +.city-name span:last-child { font-size: 1em; } @@ -70,12 +70,13 @@ align-items: center; margin-left: 0.25em; } -.official-text .know-text .chevron-container svg { - transition: transform 0.2s ease; + +.chevron-container svg { + transition: transform 0.3s ease-in-out; width: 12px; height: 12px; } -.official-text .know-text .chevron-container svg[aria-expanded='true'] { +.chevron-container svg.rotated { transform: rotate(180deg); } @@ -83,6 +84,9 @@ background-color: #f8f9fa; width: 100%; border-top: 1px solid #dee2e6; + overflow: hidden; + transition: height 0.3s ease-out; + height: 0; } .info-section { diff --git a/src/stable/components/GovBanner/GovBanner.css.map b/src/stable/components/GovBanner/GovBanner.css.map index 581d4705..f02f1c99 100644 --- a/src/stable/components/GovBanner/GovBanner.css.map +++ b/src/stable/components/GovBanner/GovBanner.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["GovBanner.scss","../../../../node_modules/bootstrap/scss/mixins/_breakpoints.scss"],"names":[],"mappings":"AAIA;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;;;AAOV;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;;;ACrEE;ED0EF;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;;;AC1FA;EDgGF;IACE;IACA;IACA;;EAGF;IACE;IACA;IACA;;EAGF;IACE;IACA;IACA;;EAGF;IACE","file":"GovBanner.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["GovBanner.scss","../../../../node_modules/bootstrap/scss/mixins/_breakpoints.scss"],"names":[],"mappings":"AA6LA;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;;AAKN;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;;AAKN;EACE;EACA;EACA;;AAEA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;;;ACjQE;EDsQF;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;IACA;IACA;;EAGF;IACE;IACA;;;ACtRA;ED4RF;IACE;IACA;IACA;;EAGF;IACE;IACA;IACA;;EAGF;IACE;IACA;IACA;;EAGF;IACE","file":"GovBanner.css"} \ No newline at end of file diff --git a/src/stable/components/GovBanner/GovBanner.js b/src/stable/components/GovBanner/GovBanner.js index c117e2ed..80c28707 100644 --- a/src/stable/components/GovBanner/GovBanner.js +++ b/src/stable/components/GovBanner/GovBanner.js @@ -1,3 +1,141 @@ +// import styles from '!!raw-loader!./GovBanner.css'; + +// const template = document.createElement('template'); +// template.innerHTML = ` +// +//
+// `; + +// class GovBanner extends HTMLElement { +// static get observedAttributes() { +// return ['expanded']; +// } + +// constructor() { +// super(); +// const shadow = this.attachShadow({ mode: 'open' }); +// shadow.appendChild(template.content.cloneNode(true)); +// this.expanded = false; +// } + +// get expanded() { +// return this.hasAttribute('expanded'); +// } + +// set expanded(value) { +// const isExpanded = Boolean(value); +// if (isExpanded === this.expanded) { +// return; +// } + +// if (isExpanded) { +// this.setAttribute('expanded', ''); +// } else { +// this.removeAttribute('expanded'); +// } + +// this.dispatchEvent( +// new CustomEvent('expandedchange', { +// detail: { expanded: isExpanded }, +// bubbles: true, +// }), +// ); +// } + +// connectedCallback() { +// this._setupListeners(); +// this._updateExpandedState(this.expanded); +// } + +// disconnectedCallback() { +// const toggleButton = this.shadowRoot.querySelector('.know-text'); +// if (toggleButton) { +// toggleButton.removeEventListener('click', this._handleToggle.bind(this)); +// } +// } + +// attributeChangedCallback(name) { +// if (name === 'expanded') { +// this._updateExpandedState(this.hasAttribute('expanded')); +// } +// } + +// _setupListeners() { +// const toggleButton = this.shadowRoot.querySelector('.know-text'); +// if (toggleButton) { +// toggleButton.addEventListener('click', this._handleToggle.bind(this)); +// } +// } + +// _handleToggle() { +// this.expanded = !this.expanded; +// } + +// _updateExpandedState(isExpanded) { +// const content = this.shadowRoot.querySelector('#content'); +// const button = this.shadowRoot.querySelector('.know-text'); +// const chevron = this.shadowRoot.querySelector('.chevron-container svg'); + +// if (content && button && chevron) { +// button.setAttribute('aria-expanded', isExpanded); +// content.hidden = !isExpanded; + +// // Rotate the chevron when expanded +// if (isExpanded) { +// chevron.classList.add('rotated'); +// } else { +// chevron.classList.remove('rotated'); +// } +// } +// } +// } + +// export { GovBanner as default }; + import styles from '!!raw-loader!./GovBanner.css'; const template = document.createElement('template'); @@ -5,50 +143,50 @@ template.innerHTML = ` -