diff --git a/Public/API/V1/GetABCFile.php b/Public/API/V1/GetABCFile.php index 21cb9b6..c3dfe72 100644 --- a/Public/API/V1/GetABCFile.php +++ b/Public/API/V1/GetABCFile.php @@ -7,21 +7,29 @@ $tuneDir = __DIR__ . '/../../../LocalStorage/Tunes'; $targetTuneID = $_GET['tune-id']; -$data = (new DatabaseInteractions())->RunOneSelect( +$result = (new DatabaseInteractions())->RunOneSelect( queryBuilder: SQLQueryBuilderWrapper::SELECT_ONE( table: 'Tunes', id: $targetTuneID ) ->cols(cols: [ - 'T.ABC', + 'T.*', ]) ); +$temp = new \App\Dataclasses\ABCWrapper($result); + +/* +header(header: "Content-type: text/text"); +echo($temp->Build()); +die(); +*/ + /* $filePath = "$tuneDir/$targetTuneID/primary.abc"; $temp = file_get_contents(filename: $filePath); */ header(header: "Content-type: text/xml"); -echo $data['ABC']; +echo $temp->Build(); die(); diff --git a/Public/Static/CSS/Elements/Columns.css b/Public/Static/CSS/Elements/Columns.css new file mode 100644 index 0000000..4951361 --- /dev/null +++ b/Public/Static/CSS/Elements/Columns.css @@ -0,0 +1,14 @@ + +.container { + display: flex; + width: 100%; +} + +.left, .right { + width: 25%; +} + +.center { + width: 50%; +} + diff --git a/Public/Static/CSS/Elements/DescriptionLists.css b/Public/Static/CSS/Elements/DescriptionLists.css new file mode 100644 index 0000000..30a6370 --- /dev/null +++ b/Public/Static/CSS/Elements/DescriptionLists.css @@ -0,0 +1,85 @@ + +dl { + display: inline-block; + margin: 0 0 1rem 0; + width: 100%; + position: relative; +} +dt { + font-weight: normal; + margin: 0 0 0 0; +} +dd { + font-weight: normal; + margin: 0 0 1em 0; +} + +@media only screen and (min-width: 200mm) { + dt { + display: inline-block; + vertical-align: text-top; + width: 10rem; + margin-top: 0; + margin-bottom: 0.5em; + } + dd { + display: inline-block; + width: 100%; + vertical-align: text-top; + padding-left: 5mm; + padding-right: 11rem; + box-sizing: border-box; + margin-top: 0; + margin-left: 0; + margin-bottom: 0.5em; + margin-right: -11rem; + } +} + +.DLContainer { + margin-bottom: 2rem; +} + +.DLContainer > dl { + padding: 0.1rem 0 0.1rem 1rem; + margin: 0 0 2.2rem 0; + border-width: var(--outline-width); + border-style: none none none solid; + border-color: var(--foreground-color); + overflow: visible; +} +@media only screen and (max-width: 180mm) { + .DLContainer > dl { + padding: 0.1rem 0 0.1rem 0.6rem; + margin: 0 0 2.2rem -0.5rem; + width: 100%; + box-sizing: content-box; + border-width: 0.15rem; + border-style: none none none solid; + border-color: var(--foreground-color); + overflow: visible; + } +} +.DLContainer > *:first-child, .DLContainer > a:first-child > * { + margin-top: 0; + margin-bottom: 0.5em; +} +.DLContainer > h2:first-child, .DLContainer > h3:first-child, .DLContainer > a:first-child > h2, .DLContainer > a:first-child > h3 { + margin-top: -0.3em; + display: inline-block; +} +.DLContainer > *:last-child { + margin-bottom: 0; +} +.DLContainer > .button-box:last-child { + margin: 0 -1rem -1rem 0; + padding: 0 0 0 0; +} + +.DLContainer > .heading-of-hideable-content { + margin-bottom: -0.3em; +} + +.DLContainer > .heading-of-hideable-content + div { + margin-top: 1.5rem; +} diff --git a/Public/Static/CSS/Elements/HomePage.css b/Public/Static/CSS/Elements/HomePage.css index 966504f..4750064 100644 --- a/Public/Static/CSS/Elements/HomePage.css +++ b/Public/Static/CSS/Elements/HomePage.css @@ -3,7 +3,6 @@ .InnerContent { margin: 0 auto; - text-align: center; } input[type="text"] { diff --git a/Public/Static/CSS/Elements/NavBar.css b/Public/Static/CSS/Elements/NavBar.css new file mode 100644 index 0000000..771184f --- /dev/null +++ b/Public/Static/CSS/Elements/NavBar.css @@ -0,0 +1,29 @@ + + +nav ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + background-color: #333; +} + +nav li { + float: left; +} + +nav li a { + display: block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +nav li a:hover:not(.active) { + background-color: #111; +} + +nav .active { + background-color: #04AA6D; +} diff --git a/Public/Static/JS/General/ABCWrapper.js b/Public/Static/JS/General/ABCWrapper.js index 0252516..ec56c8b 100644 --- a/Public/Static/JS/General/ABCWrapper.js +++ b/Public/Static/JS/General/ABCWrapper.js @@ -4,7 +4,7 @@ function RenderABC(containerID, targetTuneID) API_GET("/V1/GetABCFile.php?tune-id=" + targetTuneID).then(payload => { - ABCJS.renderAbc( + const tunes = ABCJS.renderAbc( containerID, payload, { @@ -19,11 +19,10 @@ function RenderABC(containerID, targetTuneID) titlefont: "Atkinson Hyperlegible", voicefont: "Atkinson Hyperlegible", wordsfont: "Atkinson Hyperlegible", - } + }, } ); - - + document.getElementById('RawABCReadout').innerHTML = payload; }) .catch(error => { diff --git a/Templates/Pages/index.html.twig b/Templates/Pages/index.html.twig index a957349..4555aac 100644 --- a/Templates/Pages/index.html.twig +++ b/Templates/Pages/index.html.twig @@ -8,7 +8,6 @@ {% endblock %} \ No newline at end of file