summaryrefslogtreecommitdiff
path: root/rannak/endPage/main.js
blob: 4101cd2d2cac9857fa21555c392484ac88828942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const spans = document.querySelectorAll("span");

if (localStorage.roll != undefined){

    let roll = localStorage.roll;
    spans[0].innerHTML = roll;
    delete localStorage.roll;

    if (roll == 'Kaitseliitlase'){
        document.querySelector('h3').innerHTML = 'Soomusmasinate teekond:';
        spans[1].innerHTML = 'Asukoht: ' + localStorage.asula;
        //spans[2].innerHTML = 'Soomusmasinad möödusid sinust: ' + localStorage.kaugus ' km kauguselt.';
        spans[2].innerHTML = `Soomusmasinad möödusid sinust: ${localStorage.kaugus}  km kauguselt.`

        delete localStorage.asula;
        delete localStorage.kaugus;
    }

    else if (roll == 'Direktori'){
        document.querySelector('h3').innerHTML = 'Balti keti andmed:';
        spans[1].innerHTML = 'Asula: ' + localStorage.asula;
        spans[2].innerHTML = 'Kaugus: ' + localStorage.kaugus;
        spans[3].innerHTML = 'Balti keti pikkus: ' + localStorage.teekond;



        spans[4].innerHTML = "<br><br><h3><strong>Kõne</strong></h3><br>"
        spans[5].innerHTML = localStorage.kone;
        delete localStorage.kone;



        delete localStorage.asula;
        delete localStorage.kaugus;
        delete localStorage.teekond;
    }
}