Skip to content
Snippets Groups Projects
Select Git revision
  • b3ed632cdefaba78d22d15025ec38c6d306d9a47
  • main default protected
  • Gabes-testing-branch
  • 81-as-a-child-i-want-a-very-flashy-and-modern-looking-webpage-that-will-draw-me-in-and-keep-me
  • locationApporvalFormValidationUpdate
  • 74-as-a-user-i-want-to-see-a-page-of-local-authorities-so-that-i-can-easily-source-contact-details
  • businesses
  • 77-as-a-user-i-want-to-be-able-to-use-the-application-on-any-device-e-g-iphone-ipad-laptop
  • 69-as-a-user-i-would-like-a-town-specific-page-which-shows-all-trails-for-that-town-so-that-i-can
  • 80-as-a-convenience-enthusiast-i-want-a-drop-down-menu-to-be-able-to-quickly-scan-qr-codes-i-find
  • 82-as-a-site-admininstrator-i-want-to-be-able-to-review-submited-trail-checkpoints-by-bussiness
  • 68-as-a-user-i-would-like-to-see-a-map-containing-all-landmarks-for-a-trail-and-a-suggested-path
  • 70-as-a-repeat-trail-visitor-i-want-to-be-able-to-create-an-account-so-i-can-save-and-review-my
  • towns
  • DTFrontEnd
  • 52-as-a-user-i-would-like-to-see-a-map-of-the-landmarks-so-that-i-can-figure-out-where-to-go
  • 73-as-a-qr-scanning-connoisseur-i-want-to-unlock-stickers-after-scanning-a-qr-code-to-feel-a-sense
  • QRCodes
  • consumers
  • foreignkeys
  • cleanup
21 results

allTrails.html

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    allTrails.html 2.45 KiB
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>All Trails</title>
        <link rel="stylesheet" th:href="@{css/allTrails.css}">
        <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    </head>
    <body>
    
    <header>
        <ul class="flexList">
            <li class="listButton" th:each="trail : ${trails}">
                <a class="listA" th:onclick="'update(' + ${trail.id} + ');'" th:id="'li' + ${trail.id}" th:text="${trail.name}"></a>
            </li>
        </ul>
    </header>
    
    <main>
        <section class="trailInfoBox" th:each="trail : ${trails}" th:id="${trail.id}">
            <h1 th:text="${trail.description}"></h1>
        </section>
    
    
    
    </main>
    
    
    <script type="text/javascript" th:src="@{scripts/allTrails.js}"></script>
    <script th:inline="javascript">
        function fade(element) {
            var op = 1;  // initial opacity
            var timer = setInterval(function () {
                if (op <= 0.1){
                    clearInterval(timer);
                    element.style.display = 'none';
                }
                element.style.opacity = op;
                element.style.filter = 'alpha(opacity=' + op * 100 + ")";
                op -= op * 0.1;
            }, 50);
        }
    
        function unfade(element) {
            var op = 0.1;  // initial opacity
            element.style.display = 'block';
            var timer = setInterval(function () {
                if (op >= 1){
                    clearInterval(timer);
                }
                element.style.opacity = op;
                element.style.filter = 'alpha(opacity=' + op * 100 + ")";
                op += op * 0.1;
            }, 10);
        }
        async function update(id){
            await updateTrailInfo(id);
            selectTrail('li' + id);
        }
        async function updateTrailInfo(id){
            let blocks = document.getElementsByClassName('trailInfoBox');
            let clicked = document.getElementById(id);
            let active = null;
            for (let i = 0; i < blocks.length; i++) {
                if (blocks[i].style.display === 'block') {
                    active = blocks[i];
                }
            }
            if (active == null) {
                unfade(clicked)
            } else if (active !== clicked) {
                fade(active);
                unfade(clicked)
            }
    
        }
        function selectTrail(string) {
            let listEl = document.getElementsByClassName('listA')
            for (let i = 0; i < listEl.length; i++) {
                listEl[i].classList.remove('selected')
            }
            document.getElementById(string).classList.add("selected")
    
        }
    </script>
    </body>
    </html>