openspaceaarhus / osaawebsite

1 stars 4 forks source link

Tilføj spaceapi widget til forsiden #21

Open blackthornedk opened 6 days ago

blackthornedk commented 6 days ago

Vi mangler en widget på forsiden, der loader spaceapi status. Den skal ligge over nyheder men under 'bliv medlem', så den er over 'folden' på siden.

Jeg havde tænkt mig at lave en to-part løsning, hvor der loades en IFrame i et NoScript tag, og hvis JS er enabled, bliver der vist et logo og en status, baseret på det JSON output der kommer fra SpaceApi. Iframen kræver lidt kode på selve SpaceAPI siden, som udstiller en status rendered server side, fx i PHP.

blackthornedk commented 3 days ago

The static changes on spaceapi is done: English version: https://spaceapi.osaa.dk/status/static/ Danish version: https://spaceapi.osaa.dk/status/static/da/

The pages are somewhat responsive, and should be used for an iframe on osaa.dk, which is only visible in a noscript tag. It the user actually uses JavaScript, we should embed the logo and text directly, without hideous borders.

blackthornedk commented 3 days ago

Confirmed that the NoScript tag works for iframes, in both FireFox and Chrome: image The bottom version is loaded inside Noscript:

<!DOCTYPE html>
<html>
    <body>
        <h1>SpaceApi EN</h1>
        <iframe src="https://spaceapi.osaa.dk/status/static/" title="OSAA SpaceApi English">
        </iframe>
        <noscript>
            <h1>SpaceApi DA</h1>
            <iframe src="https://spaceapi.osaa.dk/status/static/da/" title="OSAA SpaceApi Danish">
            </iframe>
        </noscript>
    </body>
</html>