started search block in header
This commit is contained in:
parent
2e3ffd0d40
commit
0fc1cd12dd
@ -7,6 +7,7 @@ import { ConcernementsStore } from '@/stores/concernements'
|
|||||||
|
|
||||||
import StaticMenu from '@components/block/StaticMenu.vue'
|
import StaticMenu from '@components/block/StaticMenu.vue'
|
||||||
import UserBlock from '@components/block/UserBlock.vue'
|
import UserBlock from '@components/block/UserBlock.vue'
|
||||||
|
import SearchBlock from '@components/block/SearchBlock.vue'
|
||||||
|
|
||||||
import MapConcernements from '@components/MapConcernements.vue'
|
import MapConcernements from '@components/MapConcernements.vue'
|
||||||
import ConcernementMapItem from '@components/ConcernementMapItem.vue'
|
import ConcernementMapItem from '@components/ConcernementMapItem.vue'
|
||||||
@ -35,7 +36,8 @@ export default {
|
|||||||
MapConcernements,
|
MapConcernements,
|
||||||
ConcernementMapItem,
|
ConcernementMapItem,
|
||||||
StaticMenu,
|
StaticMenu,
|
||||||
UserBlock
|
UserBlock,
|
||||||
|
SearchBlock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +50,7 @@ export default {
|
|||||||
</h1>
|
</h1>
|
||||||
<div class="row top">
|
<div class="row top">
|
||||||
<StaticMenu/>
|
<StaticMenu/>
|
||||||
|
<SearchBlock/>
|
||||||
<UserBlock/>
|
<UserBlock/>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
@ -29,7 +29,7 @@ html,body{
|
|||||||
bottom:0;
|
bottom:0;
|
||||||
left:0;
|
left:0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
padding: 1rem 0;
|
padding: 1rem 1em;
|
||||||
>.row{
|
>.row{
|
||||||
@include layout-row();
|
@include layout-row();
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,15 @@ body{
|
|||||||
#app>header#header{
|
#app>header#header{
|
||||||
// background-color: $front;
|
// background-color: $front;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: baseline;
|
||||||
.row{
|
.row{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
>*{
|
>*{
|
||||||
margin-right: 1em;
|
margin-right: 1em;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
@ -34,8 +39,24 @@ body{
|
|||||||
}
|
}
|
||||||
h1.row{
|
h1.row{
|
||||||
font-family: "avara";
|
font-family: "avara";
|
||||||
span.title{
|
margin: 0 1em 0 0;
|
||||||
font-size: 2em;
|
a{
|
||||||
|
margin: 0;
|
||||||
|
span.title{
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.row.top{
|
||||||
|
>*{
|
||||||
|
label,a{
|
||||||
|
padding: 0;
|
||||||
|
span{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,10 @@ import { mapState } from 'pinia'
|
|||||||
// import router from 'vuejs/route'
|
// import router from 'vuejs/route'
|
||||||
import { UserStore } from '@/stores/user'
|
import { UserStore } from '@/stores/user'
|
||||||
|
|
||||||
|
import SvgIcon from '@jamescoyle/vue-icon';
|
||||||
|
import { mdiLoginVariant } from '@mdi/js';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
const userStore = UserStore()
|
const userStore = UserStore()
|
||||||
@ -17,7 +21,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
template: null,
|
template: null,
|
||||||
mail: '',
|
mail: '',
|
||||||
passwd: ''
|
passwd: '',
|
||||||
|
login_path: mdiLoginVariant
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -49,13 +54,19 @@ export default {
|
|||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
SvgIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="login-block">
|
<div id="login-block">
|
||||||
<span>connexion</span>
|
<label>
|
||||||
|
<svg-icon type="mdi" :path="login_path"></svg-icon>
|
||||||
|
<span>connexion</span>
|
||||||
|
</label>
|
||||||
<form action="" @submit.prevent="onSubmitLogin">
|
<form action="" @submit.prevent="onSubmitLogin">
|
||||||
<input type="email" placeholder="email" name="email" v-model="mail">
|
<input type="email" placeholder="email" name="email" v-model="mail">
|
||||||
<input type="password" placeholder="mot de passe" name="passwd" v-model="passwd">
|
<input type="password" placeholder="mot de passe" name="passwd" v-model="passwd">
|
||||||
@ -66,7 +77,7 @@ export default {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
$pad: 1em;
|
$pad: 0.75em;
|
||||||
#login-block{
|
#login-block{
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
@ -79,7 +90,7 @@ export default {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 0 $pad;
|
padding: 0 $pad;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 100%;
|
bottom: 110%;
|
||||||
left: -$pad;
|
left: -$pad;
|
||||||
>*{
|
>*{
|
||||||
margin: 0 0 0.5em 0;
|
margin: 0 0 0.5em 0;
|
||||||
@ -87,7 +98,7 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-height:1px;
|
max-height:1px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
$delay: 4s;
|
$delay: 0.5s;
|
||||||
transition: opacity 0.3s ease-out $delay,max-height 0.3s ease-out $delay, padding 0.3s ease-out $delay + 0.1s;
|
transition: opacity 0.3s ease-out $delay,max-height 0.3s ease-out $delay, padding 0.3s ease-out $delay + 0.1s;
|
||||||
}
|
}
|
||||||
&:hover{
|
&:hover{
|
||||||
|
86
src/components/block/SearchBlock.vue
Normal file
86
src/components/block/SearchBlock.vue
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<script>
|
||||||
|
|
||||||
|
import { mapActions, mapState } from 'pinia'
|
||||||
|
import { StaticsStore } from '@/stores/statics'
|
||||||
|
|
||||||
|
import SvgIcon from '@jamescoyle/vue-icon';
|
||||||
|
import { mdiMagnify } from '@mdi/js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: [],
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
magnify_path: mdiMagnify
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(StaticsStore,['statics'])
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
console.log("search created");
|
||||||
|
// this.loadStatics()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(StaticsStore,['loadStatics']),
|
||||||
|
onSubmitSearch (event) {
|
||||||
|
console.log("onSubmitSearch", event);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
SvgIcon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div id="search-block">
|
||||||
|
<label for="">
|
||||||
|
<svg-icon type="mdi" :path="magnify_path"></svg-icon>
|
||||||
|
<span>recherche</span>
|
||||||
|
</label>
|
||||||
|
<form action="" @submit.prevent="onSubmitSearch">
|
||||||
|
<input type="text">
|
||||||
|
<input type="submit" value="rechercher">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$pad: 0.75em;
|
||||||
|
#search-block{
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
span{
|
||||||
|
display: inline-block;
|
||||||
|
@include btn();
|
||||||
|
}
|
||||||
|
form{
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 0 $pad;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 110%;
|
||||||
|
left: -$pad;
|
||||||
|
>*{
|
||||||
|
margin: 0 0 0.5em 0;
|
||||||
|
}
|
||||||
|
overflow: hidden;
|
||||||
|
max-height:1px;
|
||||||
|
opacity: 0;
|
||||||
|
$delay: 0.5s;
|
||||||
|
transition: opacity 0.3s ease-out $delay,max-height 0.3s ease-out $delay, padding 0.3s ease-out $delay + 0.1s;
|
||||||
|
}
|
||||||
|
&:hover{
|
||||||
|
form{
|
||||||
|
box-shadow: 0 0 5px $btns_back;
|
||||||
|
padding: $pad;
|
||||||
|
max-height: 100px;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.3s ease-out,max-height 0.3s ease-out, padding 0.3s ease-out 0.1s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -3,11 +3,15 @@
|
|||||||
import { mapActions, mapState } from 'pinia'
|
import { mapActions, mapState } from 'pinia'
|
||||||
import { StaticsStore } from '@/stores/statics'
|
import { StaticsStore } from '@/stores/statics'
|
||||||
|
|
||||||
|
import SvgIcon from '@jamescoyle/vue-icon';
|
||||||
|
import { mdiInformationOutline } from '@mdi/js';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: [],
|
props: [],
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
// block: null
|
infos_path: mdiInformationOutline
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -21,22 +25,27 @@ export default {
|
|||||||
...mapActions(StaticsStore,['loadStatics'])
|
...mapActions(StaticsStore,['loadStatics'])
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
// LoginBlock,
|
SvgIcon
|
||||||
// UserTools
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ul>
|
<div id="static-menu">
|
||||||
<li
|
<ul>
|
||||||
v-for="staticnode in statics"
|
<li
|
||||||
v-bind:key="staticnode.id"
|
v-for="staticnode in statics"
|
||||||
>
|
v-bind:key="staticnode.id"
|
||||||
<router-link :to="{ name: 'static', params: { id:staticnode.id } }">{{staticnode.title}}</router-link>
|
>
|
||||||
</li>
|
<router-link :to="{ name: 'static', params: { id:staticnode.id } }">
|
||||||
</ul>
|
<svg-icon type="mdi" :path="infos_path"></svg-icon>
|
||||||
|
<span>{{staticnode.title}}</span>
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ export default {
|
|||||||
</mask>
|
</mask>
|
||||||
<circle cx="12" cy="12" r="12" mask="url(#arrowMask)" fill="white" />
|
<circle cx="12" cy="12" r="12" mask="url(#arrowMask)" fill="white" />
|
||||||
</svg>
|
</svg>
|
||||||
</nav>
|
</nav>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user