Restructured to use 'phrases'.

This commit is contained in:
PeekabooSteam
2023-02-17 17:05:02 +00:00
parent 5b7bf63909
commit 282d2ff9bf
2 changed files with 31 additions and 20 deletions

View File

@@ -214,9 +214,16 @@ body {
text-align: center; text-align: center;
} }
#aic-descriptor .aic-descriptor-components { #aic-descriptor .aic-descriptor-phrase {
border-bottom: 1px solid #ccc;
display:flex; display:flex;
flex-direction: row; 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 { #aic-descriptor .aic-descriptor-components .aic-descriptor-component {
@@ -230,10 +237,11 @@ body {
#aic-descriptor .aic-descriptor-component-value:after { #aic-descriptor .aic-descriptor-component-value:after {
content:","; content:",";
margin-right:5px;
} }
#aic-descriptor .aic-descriptor-component:last-of-type .aic-descriptor-component-value:after { #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 { #aic-descriptor .aic-descriptor-section:last-of-type .aic-descriptor-component:last-of-type .aic-descriptor-component-value:after {

View File

@@ -1,9 +1,7 @@
import { AICFormation } from "./AICFormation";
import { AICFormation_Azimuth } from "./AICFormation/Azimuth"; import { AICFormation_Azimuth } from "./AICFormation/Azimuth";
import { AICFormation_Range } from "./AICFormation/Range"; import { AICFormation_Range } from "./AICFormation/Range";
import { AICFormation_Single } from "./AICFormation/Single"; import { AICFormation_Single } from "./AICFormation/Single";
import { AICFormationDescriptorSection } from "./AICFormationDescriptorSection"; import { AICFormationDescriptorSection } from "./AICFormationDescriptorSection";
// import { AICFormationDescriptor } from "./aicformationdescriptor"
export class AIC { export class AIC {
@@ -148,31 +146,36 @@ export class AIC {
$sectionLabel.innerText = section.label; $sectionLabel.innerText = section.label;
$section.appendChild( $sectionLabel ); $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(); let $phrase = newDiv();
$component.classList.add( "aic-descriptor-component" ); $phrase.classList.add( "aic-descriptor-phrase" );
let $componentLabel = newDiv(); for ( const component of phrase.getComponents() ) {
$componentLabel.classList.add( "aic-descriptor-component-label" );
$componentLabel.innerText = component.label;
let $componentValue = newDiv(); let $component = newDiv();
$componentValue.classList.add( "aic-descriptor-component-value" ); $component.classList.add( "aic-descriptor-component" );
$componentValue.innerText = component.value;
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 ); $phrase.appendChild( $component );
$component.appendChild( $componentValue );
}
$components.appendChild( $component ); $section.appendChild( $phrase );
} }
$section.appendChild( $components );
$descriptor.appendChild( $section ); $descriptor.appendChild( $section );
} }