From 282d2ff9bf9fb164df4b4f3d437b7b96ab4c1129 Mon Sep 17 00:00:00 2001 From: PeekabooSteam Date: Fri, 17 Feb 2023 17:05:02 +0000 Subject: [PATCH] Restructured to use 'phrases'. --- client/public/stylesheets/layout.css | 12 +++++++-- client/src/aic/aic.ts | 39 +++++++++++++++------------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/client/public/stylesheets/layout.css b/client/public/stylesheets/layout.css index 63ccc67b..bef25a8c 100644 --- a/client/public/stylesheets/layout.css +++ b/client/public/stylesheets/layout.css @@ -214,9 +214,16 @@ body { text-align: center; } -#aic-descriptor .aic-descriptor-components { +#aic-descriptor .aic-descriptor-phrase { + border-bottom: 1px solid #ccc; display:flex; flex-direction: row; + margin-bottom:5px; + padding-bottom:2px; +} + +#aic-descriptor .aic-descriptor-phrase:last-of-type { + margin-bottom: 0; } #aic-descriptor .aic-descriptor-components .aic-descriptor-component { @@ -230,10 +237,11 @@ body { #aic-descriptor .aic-descriptor-component-value:after { content:","; + margin-right:5px; } #aic-descriptor .aic-descriptor-component:last-of-type .aic-descriptor-component-value:after { - content:";"; + content:"; "; } #aic-descriptor .aic-descriptor-section:last-of-type .aic-descriptor-component:last-of-type .aic-descriptor-component-value:after { diff --git a/client/src/aic/aic.ts b/client/src/aic/aic.ts index 7fc70c64..a9d65322 100644 --- a/client/src/aic/aic.ts +++ b/client/src/aic/aic.ts @@ -1,9 +1,7 @@ -import { AICFormation } from "./AICFormation"; import { AICFormation_Azimuth } from "./AICFormation/Azimuth"; import { AICFormation_Range } from "./AICFormation/Range"; import { AICFormation_Single } from "./AICFormation/Single"; import { AICFormationDescriptorSection } from "./AICFormationDescriptorSection"; -// import { AICFormationDescriptor } from "./aicformationdescriptor" export class AIC { @@ -148,31 +146,36 @@ export class AIC { $sectionLabel.innerText = section.label; $section.appendChild( $sectionLabel ); - - let $components = newDiv(); - $components.classList.add( "aic-descriptor-components" ); - for ( const component of section.getComponents() ) { + for ( const phrase of section.getPhrases() ) { - let $component = newDiv(); - $component.classList.add( "aic-descriptor-component" ); + let $phrase = newDiv(); + $phrase.classList.add( "aic-descriptor-phrase" ); - let $componentLabel = newDiv(); - $componentLabel.classList.add( "aic-descriptor-component-label" ); - $componentLabel.innerText = component.label; + for ( const component of phrase.getComponents() ) { - let $componentValue = newDiv(); - $componentValue.classList.add( "aic-descriptor-component-value" ); - $componentValue.innerText = component.value; + let $component = newDiv(); + $component.classList.add( "aic-descriptor-component" ); + + let $componentLabel = newDiv(); + $componentLabel.classList.add( "aic-descriptor-component-label" ); + $componentLabel.innerText = component.label; + + let $componentValue = newDiv(); + $componentValue.classList.add( "aic-descriptor-component-value" ); + $componentValue.innerText = component.value; + + $component.appendChild( $componentLabel ); + $component.appendChild( $componentValue ); - $component.appendChild( $componentLabel ); - $component.appendChild( $componentValue ); + $phrase.appendChild( $component ); + + } - $components.appendChild( $component ); + $section.appendChild( $phrase ); } - $section.appendChild( $components ); $descriptor.appendChild( $section ); }