Added sidebar (#224)
Co-authored-by: widlam <mikolaj.widla@gmail.com> Reviewed-on: #224 Reviewed-by: Adam Bem <bema@noreply.example.com> Co-authored-by: Mikolaj Widla <widlam@noreply.example.com> Co-committed-by: Mikolaj Widla <widlam@noreply.example.com>
This commit is contained in:
		
							
								
								
									
										55
									
								
								Frontend/src/components/sidebar/SidebarComponent.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								Frontend/src/components/sidebar/SidebarComponent.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
<script setup>
 | 
			
		||||
import { ref , onMounted } from 'vue'
 | 
			
		||||
import SidebarToolLinkComponent from './SidebarToolLinkComponent.vue';
 | 
			
		||||
import SidebarMenuElementComponent from './SidebarMenuElementComponent.vue';
 | 
			
		||||
import logoDark from '@assets/logo_biale.svg';
 | 
			
		||||
import logoWhite from '@assets/logo_czarne.svg';
 | 
			
		||||
 | 
			
		||||
const logoR11 = ref( logoDark );
 | 
			
		||||
 | 
			
		||||
function isDarkModeSet(){
 | 
			
		||||
    return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
onMounted( () => {
 | 
			
		||||
    changeLogoForTheme();
 | 
			
		||||
} )
 | 
			
		||||
 | 
			
		||||
function changeLogoForTheme(){
 | 
			
		||||
    if (isDarkModeSet()) {
 | 
			
		||||
    logoR11.value = logoDark;
 | 
			
		||||
    } else{
 | 
			
		||||
        logoR11.value = logoWhite;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
    <aside class="relative top-0 left-0 z-40 w-1/12 h-screen transition-transform -translate-x-full sm:translate-x-0" >
 | 
			
		||||
        <div class="h-full px-3 py-4 overflow-y-auto bg-gray-100 dark:bg-gray-800">
 | 
			
		||||
            <a href="https://release11.com/">
 | 
			
		||||
                <img :src="logoR11" class="w-72 h-16 p-2 dark:bg-gray-800"/>
 | 
			
		||||
            </a>
 | 
			
		||||
            <ul class="space-y-2 font-medium">
 | 
			
		||||
                <sidebar-menu-element-component category-name="XML">
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/xml/xslt" element-content="XSLT" /></li>
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/xml/xpath" element-content="XPath" /></li>
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/xml/xsd" element-content="XSD" /></li>
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/xml/xquery" element-content="XQuery" /></li>
 | 
			
		||||
                </sidebar-menu-element-component>
 | 
			
		||||
 | 
			
		||||
                <sidebar-menu-element-component category-name="Formatter">
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/format/XML" element-content="XML Formatter" /></li>
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/format/HTML" element-content="HTML Formatter" /></li>
 | 
			
		||||
                    <li><SidebarToolLinkComponent path-to="/format/JSON" element-content="JSON Formatter" /></li>
 | 
			
		||||
                </sidebar-menu-element-component>
 | 
			
		||||
 | 
			
		||||
                <li><SidebarToolLinkComponent class="text-left" path-to="/rest/mock" element-content="REST Mock" /></li>
 | 
			
		||||
 | 
			
		||||
            </ul>
 | 
			
		||||
        </div>
 | 
			
		||||
    </aside>
 | 
			
		||||
</template>
 | 
			
		||||
		Reference in New Issue
	
	Block a user