Files
fruit-project/src/components/Header.vue

71 lines
1.3 KiB
Vue

<template>
<header id="header" class="main-nav">
<router-link to="/">
<img src="https://www.cycloid.io/themes/cycloid/images/owl_logo.png" alt="Cycloid.io" />
<h1>Fruits</h1>
</router-link>
<button class="action-btn" @click="() => $store.commit('toggleModal')">+</button>
</header>
</template>
<script>
export default {
name: "Header"
};
</script>
<style lang="less">
header {
background-color: @color-2;
box-shadow: 0 0px 14px 0px #cecece;
h1 {
margin: 0;
font-size: 28px;
font-weight: lighter;
}
&.main-nav {
position: sticky;
top: 0;
left: 0;
right: 0;
z-index: 15;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1rem;
height: @headerHeight;
transition: all 0.3s ease-in-out;
a {
display: flex;
align-items: center;
img {
width: 35px;
height: 35px;
margin-right: 1rem;
}
}
.action-btn {
width: 42px;
height: 42px;
border: none;
border-radius: 50%;
color: @color-2;
font-size: 28px;
font-weight: lighter;
text-align: center;
background: linear-gradient(112.4deg, #1c9797 11.05%, #147171 89.93%);
&:hover {
background: linear-gradient(0deg, #1c9797 11.05%, #147171 89.93%);
}
}
}
}
</style>