Skip to content

Commit

Permalink
Merge pull request #9 from Lissy93/new-themes
Browse files Browse the repository at this point in the history
Adds new themes: Minimal, material and material dark
  • Loading branch information
Lissy93 committed Jun 2, 2021
2 parents 484a625 + af57d8e commit 1c1dd4f
Show file tree
Hide file tree
Showing 22 changed files with 608 additions and 148 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ All fields are optional, unless otherwise stated.
**`section`**
- `name` - String: (required) The title of that section
- `items` - Item[]: (required) An array of items - _See **`item`** below_
- `icon` - String: (optional) An single icon to be displayed next to the title _See **`icon`** below_
- `displayData`: An object with the following fields (all optional)
- `collapsed` - Boolean: If true, the section will be collapsed initially (defaults to `false`)
- `color` - String: A custom accent color for the section, as a hex code or HTML color (e.g. `#fff`)
Expand Down
1 change: 1 addition & 0 deletions public/conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ appConfig:
fontAwesomeKey: 0821c65656
sections:
- name: Getting Started
icon: far fa-star
items:
- title: Source
description: Source code and documentation on GitHub
Expand Down
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default {
@import '@/styles/global-styles.scss';
@import '@/styles/color-palette.scss';
@import '@/styles/color-themes.scss';
@import '@/styles/typography.scss';
body {
background: var(--background);
Expand Down
Binary file added src/assets/fonts/PTMono-Regular.ttf
Binary file not shown.
Binary file added src/assets/fonts/Raleway-Variable.ttf
Binary file not shown.
9 changes: 5 additions & 4 deletions src/components/Configuration/ConfigContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ a.config-button, button.config-button {
div.code-container {
background: var(--config-code-background);
#conf-yaml {
font-family: 'Inconsolata', sans-serif;
.hljs-attr {
#conf-yaml span {
font-family: var(--font-monospace), monospace !important;
&.hljs-attr {
font-weight: bold !important;
}
}
Expand Down Expand Up @@ -252,7 +252,7 @@ a.hyperlink-wrapper {
display: flex;
flex-direction: column;
padding-top: 2rem;
background: var(--background-darker);
background: var(--config-settings-background);
height: calc(100% - 2rem);
h2 {
margin: 1rem auto;
Expand All @@ -271,6 +271,7 @@ a.hyperlink-wrapper {
border-radius: var(--curve-factor);
text-align: left;
opacity: var(--dimming-factor);
color: var(--config-settings-color);
background: var(--config-settings-background);
p.sub-title {
font-weight: bold;
Expand Down
4 changes: 3 additions & 1 deletion src/components/Configuration/CustomCss.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<prism-editor class="my-editor" v-model="customCss" :highlight="highlighter" line-numbers />
<button class="save-button" @click="save()">Save Changes</button>
<p>Note, you will need to refresh the page for your changes to take effect</p>
<p>To remove all custom styles, delete the contents and hit Save Changes</p>
</div>
</template>

Expand Down Expand Up @@ -30,7 +31,7 @@ export default {
},
methods: {
validate(css) {
return css.match(/((?:^\s*)([\w#.@*,:\-.:>,*\s]+)\s*{(?:[\s]*)((?:[A-Za-z\- \s]+[:]\s*['"0-9\w .,/()\-!%]+;?)*)*\s*}(?:\s*))/gmi);
return css === '' || css.match(/((?:^\s*)([\w#.@*,:\-.:>,*\s]+)\s*{(?:[\s]*)((?:[A-Za-z\- \s]+[:]\s*['"0-9\w .,/()\-!%]+;?)*)*\s*}(?:\s*))/gmi);
},
save() {
let msg = '';
Expand All @@ -40,6 +41,7 @@ export default {
localStorage.setItem(localStorageKeys.APP_CONFIG, JSON.stringify(appConfig));
msg = 'Changes saved succesfully';
this.inject(this.customCss);
if (this.customCss === '') setTimeout(() => { location.reload(); }, 1500); // eslint-disable-line no-restricted-globals
} else {
msg = 'Error - Invalid CSS';
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Configuration/EditSiteMeta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default {
display: flex;
flex-direction: column;
padding: 1rem 0;
background: var(--background-darker);
background: var(--config-settings-background);
height: calc(100% - 1rem);
h2 {
margin: 1rem auto;
Expand Down Expand Up @@ -117,6 +117,7 @@ div.form {
min-width: 24rem;
span {
font-size: 1.2rem;
color: var(--config-settings-color);
}
input {
color: var(--config-settings-color);
Expand Down
199 changes: 102 additions & 97 deletions src/components/LinkItems/Collapsable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
tabIndex="-1"
>
<label :for="`collapsible-${uniqueKey}`" class="lbl-toggle" tabindex="-1">
<Icon v-if="icon" :icon="icon" size="small" class="section-icon" />
<h3>{{ title }}</h3>
</label>
<div class="collapsible-content">
Expand All @@ -24,18 +25,23 @@
<script>
import { localStorageKeys } from '@/utils/defaults';
import Icon from '@/components/LinkItems/ItemIcon.vue';
export default {
name: 'CollapsableContainer',
props: {
uniqueKey: String,
title: String,
icon: String,
collapsed: Boolean,
cols: Number,
rows: Number,
color: String,
customStyles: String,
},
components: {
Icon,
},
data() {
return {
isOpen: !this.collapsed,
Expand Down Expand Up @@ -96,105 +102,104 @@ export default {
@import '@/styles/media-queries.scss';
.collapsable {
padding: var(--item-group-padding);
margin: 10px;
padding: var(--item-group-padding);
margin: 10px;
border-radius: var(--curve-factor);
background: var(--item-group-outer-background);
box-shadow: var(--item-group-shadow);
height: fit-content;
width: 100%;
width: stretch;
grid-row-start: span 1;
&.row-2 { grid-row-start: span 2; }
&.row-3 { grid-row-start: span 3; }
&.row-4 { grid-row-start: span 4; }
grid-column-start: span 1;
@include tablet-up {
&.col-2 { grid-column-start: span 2; }
&.col-3 { grid-column-start: span 2; }
&.col-4 { grid-column-start: span 2; }
}
@include laptop-up {
&.col-2 { grid-column-start: span 2; }
&.col-3 { grid-column-start: span 3; }
&.col-4 { grid-column-start: span 3; }
}
@include monitor-up {
&.col-2 { grid-column-start: span 2; }
&.col-3 { grid-column-start: span 3; }
&.col-4 { grid-column-start: span 4; }
}
.wrap-collabsible {
margin-bottom: 1.2rem 0;
}
input[type='checkbox'] {
display: none;
}
label.lbl-toggle {
outline: none;
display: block;
padding: 0.25rem;
cursor: pointer;
border-radius: var(--curve-factor);
background: var(--item-group-outer-background);
box-shadow: var(--item-group-shadow);
height: fit-content;
width: 100%;
width: stretch;
grid-row-start: span 1;
&.row-2 { grid-row-start: span 2; }
&.row-3 { grid-row-start: span 3; }
&.row-4 { grid-row-start: span 4; }
grid-column-start: span 1;
@include tablet-up {
&.col-2 { grid-column-start: span 2; }
&.col-3 { grid-column-start: span 2; }
&.col-4 { grid-column-start: span 2; }
}
@include laptop-up {
&.col-2 { grid-column-start: span 2; }
&.col-3 { grid-column-start: span 3; }
&.col-4 { grid-column-start: span 3; }
}
@include monitor-up {
&.col-2 { grid-column-start: span 2; }
&.col-3 { grid-column-start: span 3; }
&.col-4 { grid-column-start: span 4; }
}
.wrap-collabsible {
margin-bottom: 1.2rem 0;
}
input[type='checkbox'] {
display: none;
}
label {
outline: none;
}
.lbl-toggle {
display: block;
padding: 0.25rem;
cursor: pointer;
border-radius: var(--curve-factor);
transition: all 0.25s ease-out;
text-align: left;
color: var(--item-group-heading-text-color); //var(--item-group-background);
h3 {
margin: 0;
padding: 0;
display: inline;
}
}
.lbl-toggle:hover {
color: var(--item-group-heading-text-color-hover);
}
.lbl-toggle::before {
content: ' ';
display: inline-block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid currentColor;
vertical-align: middle;
margin-right: .7rem;
transform: translateY(-2px);
transition: transform .2s ease-out;
}
.toggle:checked + .lbl-toggle::before {
transform: rotate(90deg) translateX(-3px);
}
.collapsible-content {
max-height: 0px;
overflow: hidden;
transition: max-height .25s ease-in-out;
background: var(--item-group-background);
border-radius: 0 0 var(--curve-factor) var(--curve-factor);
}
.toggle:checked + .lbl-toggle + .collapsible-content {
max-height: 1000px;
transition: all 0.25s ease-out;
text-align: left;
color: var(--item-group-heading-text-color); //var(--item-group-background);
h3 {
margin: 0;
padding: 0;
display: inline;
}
.toggle:checked + .lbl-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.collapsible-content .content-inner {
padding: 0.5rem;
.section-icon {
display: inline;
margin-right: 0.5rem;
}
}
.lbl-toggle:hover {
color: var(--item-group-heading-text-color-hover);
}
.lbl-toggle::before {
content: ' ';
display: inline-block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid currentColor;
vertical-align: middle;
margin-right: .7rem;
transform: translateY(-2px);
transition: transform .2s ease-out;
}
.toggle:checked + .lbl-toggle::before {
transform: rotate(90deg) translateX(-3px);
}
.collapsible-content {
max-height: 0px;
overflow: hidden;
transition: max-height .25s ease-in-out;
background: var(--item-group-background);
border-radius: 0 0 var(--curve-factor) var(--curve-factor);
}
.toggle:checked + .lbl-toggle + .collapsible-content {
max-height: 3000px;
}
.toggle:checked + .lbl-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.collapsible-content .content-inner {
padding: 0.5rem;
}
}
</style>
27 changes: 23 additions & 4 deletions src/components/LinkItems/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
:target="target === 'newtab' ? '_blank' : ''"
:class="`item ${!icon? 'short': ''} size-${itemSize}`"
v-tooltip="getTooltipOptions()"
v-bind:style="customStyles"
rel="noopener noreferrer" tabindex="0"
:id="`link-${id}`"
:style="`--open-icon: ${getUnicodeOpeningIcon()}; ${customStyles}`"
>
<!-- Item Text -->
<div class="tile-title" :id="`tile-${id}`" >
<div :class="`tile-title ${!icon? 'bounce': ''}`" :id="`tile-${id}`" >
<span class="text">{{ title }}</span>
<div class="overflow-dots">...</div>
<p class="description">{{ description }}</p>
</div>
<!-- Item Icon -->
<Icon :icon="icon" :url="url" :size="itemSize" :color="color" v-bind:style="customStyles" />
<Icon :icon="icon" :url="url" :size="itemSize" :color="color"
v-bind:style="customStyles" class="bounce" />
<!-- Small icon, showing opening method on hover -->
<ItemOpenMethodIcon class="opening-method-icon" :isSmall="!icon" :openingMethod="target"
:position="itemSize === 'medium'? 'bottom right' : 'top right'"/>
Expand Down Expand Up @@ -89,6 +91,14 @@ export default {
delay: { show: 600, hide: 200 },
};
},
getUnicodeOpeningIcon() {
switch (this.target) {
case 'newtab': return '"\\f360"';
case 'sametab': return '"\\f24d"';
case 'iframe': return '"\\f2d0"';
default: return '"\\f054"';
}
},
},
mounted() {
this.manageTitleEllipse();
Expand Down Expand Up @@ -205,7 +215,7 @@ export default {
}
.tile-title {
height: fit-content;
min-height: 1rem;
min-height: 1.2rem;
span.text {
text-align: left;
padding-left: 10%;
Expand All @@ -228,6 +238,15 @@ export default {
&.size-large {
height: 100px;
}
p.description {
display: none;
}
&:before {
display: none;
font-family: FontAwesome;
content: var(--open-icon, "\f054") !important;
}
}
</style>
Expand Down
Loading

0 comments on commit 1c1dd4f

Please sign in to comment.