Difference between revisions of "Widget:Homepage"

From LINKS Community Center
Jump to: navigation, search
(6 intermediate revisions by 2 users not shown)
Line 231: Line 231:
 
         }
 
         }
  
 +
        @media only screen and (orientation: portrait) {
 +
            .snippet-header, .snippet-body {
 +
                font-size: .75em;
 +
            }
 +
 +
            form.hp-search button {
 +
                display: none;
 +
            }
 +
        }
 
     </style>
 
     </style>
    <link rel="stylesheet" href="https://www.safetyinnovation.center/widget/styles.css">
 
  
 
     <script>
 
     <script>
Line 501: Line 509:
 
         </script>
 
         </script>
  
        <!-- BEGIN CHAT BOT -->
+
<!-- BEGIN SAFETY.WIDGET -->
        <div id="chat-wrapper">
+
<link rel="stylesheet" href="https://www.safetyinnovation.center/widget/styles.css">
            <div id="chat-window" class="closed-chat">
+
<div id="safety-widget"></div>
                <div id="chat-window-controls">
+
<script src="https://www.safetyinnovation.center/widget/script.js"></script>
                    <button id="resize-chat" style="visibility:hidden">&larr;</button>
+
<!-- END SAFETY.WIDGET -->
                    <button id="close-chat">&times;</button>
 
                </div>
 
                <div id="chat-window-content">
 
                    <div style="padding: 1rem; text-align: center;">
 
                        <img src="https://synergiesproject.eu/wp-content/uploads/2024/04/synergies_project_logo-600x204.png"
 
                            style="height: 3rem;">
 
                        <br><br>
 
                        If you want to know more about
 
                        the evolution of the LINKS Community Center,
 
                        have a closer look at SYNERGIES.
 
                        <br><br>
 
                        <a href="https://synergiesproject.eu/" target="_blank">synergiesproject.eu</a>
 
                    </div>
 
                </div>
 
            </div>
 
            <div id="chat-button">
 
                <img src="https://synergiesproject.eu/wp-content/uploads/2024/04/synergies_project_logo-600x204.png"
 
                    style="height: 50px; margin: 0;" alt="SYNERGIES">
 
            </div>
 
        </div>
 
        <script>
 
            const chatWindow = document.getElementById('chat-window');
 
            const chatContent = document.getElementById('chat-window-content');
 
            const resizeBtn = document.getElementById('resize-chat');
 
            const closeBtn = document.getElementById('close-chat');
 
            const chatBtn = document.getElementById('chat-button');
 
  
            chatBtn.addEventListener('click', () => {
 
                chatWindow.classList.toggle('closed-chat');
 
            });
 
            resizeBtn.addEventListener('click', () => {
 
                chatWindow.classList.toggle('maximized-chat');
 
            });
 
            closeBtn.addEventListener('click', () => {
 
                chatWindow.classList.add('closed-chat');
 
            });
 
 
            const url = 'https://widget.safety-base.intern';
 
            fetch(url, { method: 'HEAD' })
 
                .then(response => {
 
                    if (response.ok) {
 
                        resizeBtn.style.visibility = 'visible';
 
                        chatContent.innerHTML = `
 
                        <iframe id="embedded-page" src="${url}" frameborder="0"
 
                        style="width:100%;aspect-ratio:9/16;"
 
                        ></iframe>
 
                        `;
 
                    }
 
                })
 
                .catch(error => console.error('Error during URL check', error));
 
        </script>
 
        <!-- END CHAT BOT -->
 
 
</includeonly>
 
</includeonly>

Revision as of 15:30, 6 May 2024

Second version of the LINKS Community Center homepage.
Do not modify!