Skip to content

Commit

Permalink
Merge pull request #305 from bcgov/feature/innkeeperUiStyle
Browse files Browse the repository at this point in the history
Innkeeper styling
  • Loading branch information
loneil authored Oct 6, 2022
2 parents 9c93ecb + 7e1a749 commit c981144
Show file tree
Hide file tree
Showing 16 changed files with 280 additions and 244 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions services/tenant-ui/frontend/src/assets/forms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Specific to form fields, layout, spacing, etc

.field {
> label {
display: block !important;
> .p-progress-spinner {
height: 1em;
width: 1em;
}
}
> small.p-error {
display: block !important;
}
}
144 changes: 144 additions & 0 deletions services/tenant-ui/frontend/src/assets/layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
@import 'variables.scss';

// General application layout and styles for the 'containing' components (nav, content, etc)

body {
margin: 0;
}

// The app layout
.layout-container {
display: flex;
flex-direction: row;
align-items: flex-start;
min-height: 100vh;
width: 100%;
.layout-sidebar {
align-self: stretch;
background-color: $tenant-ui-primary-color;
color: $tenant-ui-text-on-primary;
min-width: 20em;
}
// Innkeeper specifics
&.innkeeper-layout .layout-sidebar {
background-color: $innkeeper-ui-primary-color;
color: $innkeeper-ui-text-on-primary;
}

.layout-page {
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
}

.layout-header {
flex: 0;
background-color: white;
}

.layout-content {
flex: 1;
background-color: #e4e4e4;
padding: 0.5em;
}
}

// The Login screen layout
.traction-login {
.logo {
display: block;
margin-left: auto;
margin-right: auto;
}
.logo-bc {
@extend .logo;
width: 18em;
}
.logo-traction {
@extend .logo;
width: 20em;
}

.cover-image {
background-repeat: no-repeat;
background-size: cover;
.copyright {
color: white;
font-size: 0.5em;
background-color: rgba($color: #000000, $alpha: 0.5);
padding: 0 0.5em;
margin: 1em;
position: absolute;
bottom: 0;
right: 0;
}
}
}

// Sidebar layout styling
.traction-sidebar {
.sidebar-app-title {
font-size: 1.6em;
text-align: center;
padding: 0.5em;
margin: 0.5em;
background-color: $tenant-ui-accent-color;
text-transform: uppercase;
word-wrap: break-word;
}
// Innkeeper specifics
&.innkeeper-sidebar .sidebar-app-title {
background-color: white;
color: $innkeeper-ui-primary-color;
margin: 0.5em 1em;
letter-spacing: 3px;
}

.p-panelmenu {
.p-panelmenu-panel {
* {
border: none !important;
font-weight: normal !important;
background-color: $tenant-ui-primary-color !important;
color: $tenant-ui-text-on-primary !important;
}
.p-submenu-list {
padding-left: 1.5em !important;
}
// Override the order of the drop down icon
.p-panelmenu-header-link {
display: flex;
span {
&.pi-chevron-right,
&.pi-chevron-down {
order: 2;
margin-left: auto;
}
}
.p-menuitem-icon {
font-size: 1.3em;
}
}
}
}
// Innkeeper specifics
&.innkeeper-sidebar .p-panelmenu .p-panelmenu-panel * {
background-color: $innkeeper-ui-primary-color !important;
color: $innkeeper-ui-text-on-primary !important;
}
}

// Header Layout Styling
.traction-header {
&.p-toolbar {
background-color: white !important;
border-radius: 0 !important;
}
}

.row {
display: flex;
flex-direction: row;
margin: 10px;
}
15 changes: 15 additions & 0 deletions services/tenant-ui/frontend/src/assets/primevueComponents.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Global modifications to PrimeVue components here
// Note if general global theming (colors mostly) needs changing, look to the pulled in _theme file
// Can adjust ALL instances of a PrimeVue component her by just overriding the classes,
// or if you want a component that only sometimes gets modified, can add another .traction class to it
// like if we want a bunch of tables to get overriden style (but still want other customizable or default,
// add .traction-table and nest style from that

// Dialogs
.p-dialog-content {
input {
min-width: 400px;
}
}

// TODO: move more customization into here
27 changes: 3 additions & 24 deletions services/tenant-ui/frontend/src/assets/style.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
@import '_theme.scss'; // copied from '~primevue/resources/themes/nova/theme.css'

.row {
display: flex;
flex-direction: row;
margin: 10px;
}
.p-dialog-content {
input {
min-width: 400px;
}
}
.field {
>label {
display: block !important;
>.p-progress-spinner {
height: 1em;
width: 1em;
}
}
>small.p-error {
display: block !important;
}
}

@import 'layout.scss';
@import 'forms.scss';
@import 'primevueComponents.scss'
5 changes: 4 additions & 1 deletion services/tenant-ui/frontend/src/assets/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ $tenant-ui-secondary-color: #3c5973; // Buttons, actions
$tenant-ui-accent-color: #96c230;
$tenant-ui-secondary-active: darken( $tenant-ui-secondary-color, 10% );
$tenant-ui-shadow: lighten( $tenant-ui-secondary-color, 30% );
$tenant-ui-flat-highlight: #ebeef3;
$tenant-ui-flat-highlight: #ebeef3;

$innkeeper-ui-primary-color: #30403e;
$innkeeper-ui-text-on-primary: #ffffff;
30 changes: 3 additions & 27 deletions services/tenant-ui/frontend/src/components/Login.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="grid w-screen h-screen">
<div class="traction-login grid w-screen h-screen">
<div class="col-12 md:col-6 xl:col-4">
<div class="px-8">
<div class="pt-4 pb-6">
Expand Down Expand Up @@ -33,33 +33,9 @@ const { config } = storeToRefs(useConfigStore());
</script>

<style scoped lang="scss">
.logo {
display: block;
margin-left: auto;
margin-right: auto;
}
.logo-bc {
@extend .logo;
width: 18em;
}
.logo-traction {
@extend .logo;
width: 20em;
}
// See layout.scss for generalized common login layout stuff
// Set the image specific to this component here though
.cover-image {
background-image: url('/img/default-login-image.jpg');
background-repeat: no-repeat;
background-size: cover;
.copyright {
color: white;
font-size: 0.5em;
background-color: rgba($color: #000000, $alpha: 0.5);
padding: 0 0.5em;
margin: 1em;
position: absolute;
bottom: 0;
right: 0;
}
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<template>
<div class="parent">
<Button @click="toggleProfile">
<div class="badge-img" />
</Button>
</div>
<Menu ref="menu" :model="items" :popup="true" />
</template>

<script setup lang="ts">
// Vue
import { ref } from 'vue';
// PrimeVue
import Button from 'primevue/button';
import Menu from 'primevue/menu';
// State
const menu = ref();
/**
* Toggle the profile menu
*/
const toggleProfile = (event: any) => {
menu.value.toggle(event);
};
const items = [
{
label: 'Logout',
icon: 'pi pi-sign-out',
url: '/innkeeper', // TODO: this should be a logout route
},
];
</script>

<style scoped>
button {
background-color: rgba(0, 0, 0, 0);
border: 0;
border-radius: 50%;
padding: 0;
transition: all 0.2s ease-in-out;
}
.badge-img {
background-image: url('/img/innkeeper/innkeeper-badge.png');
width: 45px;
height: 45px;
background-size: cover;
}
button:enabled:hover {
background-color: rgba(0, 0, 0, 0);
border: 0;
transform: scale(1.1);
}
</style>
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
<template>
<div class="grid w-screen h-screen">
<div class="traction-login grid w-screen h-screen">
<div class="col-12 md:col-6 xl:col-4">
<div class="px-8">
<div class="pt-4 pb-6">Image and text UX TBD</div>
<div class="pt-4 pb-6">
<img src="/img/bc/bc_logo.png" class="logo-bc" />

<img
src="/img/logo/traction-logo-bc-text.svg"
class="logo-traction"
/>
</div>

<div class="py-8">
<LoginForm />
<InnkeeperLoginForm />
</div>
</div>
</div>

<div class="cover-image hidden md:block col-0 md:col-6 xl:col-8 p-0">
<span class="copyright"> Photo by Julia Volk on StockSnap </span>
</div>
</div>
</template>

<script setup lang="ts">
import LoginForm from '@/components/innkeeper/InnkeeperLoginForm.vue';
import InnkeeperLoginForm from '@/components/innkeeper/InnkeeperLoginForm.vue';
</script>

<style scoped lang="scss">
.logo {
display: block;
margin-left: auto;
margin-right: auto;
}
.logo-bc {
@extend .logo;
width: 18em;
}
.logo-traction {
@extend .logo;
width: 20em;
// See layout.scss for generalized common login layout stuff
// Set the image specific to this component here though
.cover-image {
background-image: url('/img/innkeeper/innkeeper-login-image.jpg');
}
</style>
Loading

0 comments on commit c981144

Please sign in to comment.