Skip to content

Commit

Permalink
Update autocomplete style and vite configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
José Luis Pereira committed Aug 25, 2022
1 parent 18e7a8b commit 1223dcb
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/style/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
--color-base-background: 23,23,23;
--color-base-foreground: 38,38,38;
--color-base-200: 30, 41, 59;
--color-base-300: 30, 41, 59;
--color-base-300: 55, 65, 81;
--color-base-content: 255, 255, 255;
}
2 changes: 1 addition & 1 deletion pages/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ project: Your project
Welcome to *{{ frontmatter.project }}*, a website of taxon pages generated from the {{ frontmatter.project }} Project, a comprehensive collaborative effort managed in [TaxonWorks](https://taxonworks.org).

## Get started!
<autocomplete-otu/>
<autocomplete-otu class="w-80"/>

## Announcements
* 5/1/2022 - We've grown!
Expand Down
25 changes: 17 additions & 8 deletions src/components/Autocomplete/Autocomplete.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
min-w-full
p-1.5
pl-10
text-gray-900
dark:bg-slate-800
text-base-content
rounded
border
sm:text-sm
dark:text-white
placeholder:text-sm
dark:border-slate-700
border-gray-300
dark:placeholder:text-slate-400
Expand All @@ -41,20 +40,30 @@

<ul
v-if="list.length"
class="autocomplete__list list absolute z-[500] max-h-52 overflow-y-auto border bg-white dark:bg-gray-800 dark:border-gray-700"
class="
autocomplete__list
list
absolute
z-[500]
max-h-52
w-full
overflow-y-auto
border
bg-base-foreground
border-base-300
!m-0"
>
<li
v-for="item in list"
:key="item.id"
class="
autocomplete__item
p-2 border-b
bg-white
text-sm
cursor-pointer
hover:bg-gray-200
dark:border-gray-700
dark:bg-gray-800"
hover:bg-secondary-color
hover:bg-opacity-5
border-base-300"
@click="selectItem(item)"
>
<span v-html="item[label]" />
Expand Down
8 changes: 8 additions & 0 deletions src/modules/home/router/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Homepage from '../views/index.vue'

export default [{
name: 'homepage',
path: '/',
alias: '/home',
component: Homepage,
}]
24 changes: 24 additions & 0 deletions src/modules/home/views/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class="container mx-auto text-center mt-36 flex flex-col justify-center">
<h1 class="text-4xl">
Welcome to TaxonPages
</h1>
<p class="m-4">
It seems you don't have a index or home file in your /pages folder, create one to replace this page.
</p>
<div class="flex justify-center">
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
/>
</div>
</div>
</template>

<script setup>
</script>
4 changes: 2 additions & 2 deletions src/modules/otus/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
mb-2
md:min-w-fit
md:ml-2
md:mb-0
w-60
md:mb-0
w-80
"
url="/otus/autocomplete"
query-param="term"
Expand Down
10 changes: 7 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import {

import dynamicRoutes from '~pages'

const moduleRoutes = import.meta.globEager('@/modules/**/router/*.js')
const routerObjects = [].concat(...Object.values(moduleRoutes).map(route => route.default))
const coreModuleRoutes = import.meta.globEager('@/modules/**/router/*.js', { import: 'default' })
const userModuleRoutes = import.meta.globEager('#/modules/**/router/*.js', { import: 'default' })
const moduleRoutes = [].concat(
...Object.values(coreModuleRoutes),
...Object.values(userModuleRoutes)
)
const { base_url, hash_mode } = __APP_ENV__

const router = createRouter({
Expand All @@ -17,7 +21,7 @@ const router = createRouter({

routes: [
...dynamicRoutes,
...routerObjects,
...moduleRoutes
]
})

Expand Down
3 changes: 2 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default () => {
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
'@': path.resolve(__dirname, './src'),
'#': path.resolve(__dirname)
},
},
plugins: [
Expand Down

0 comments on commit 1223dcb

Please sign in to comment.