Skip to content
This repository was archived by the owner on May 14, 2023. It is now read-only.

Commit 19255fe

Browse files
committed
Header and search-box developed.
1 parent 28abdc6 commit 19255fe

File tree

20 files changed

+301
-2
lines changed

20 files changed

+301
-2
lines changed

src/App.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
<template>
22
<div class="wrapper" id="app">
3-
HELLO WORLD
3+
<bc-header></bc-header>
4+
<div class="page">
5+
<section class="search">
6+
<div class="container">
7+
<div class="box-1">
8+
<search-box></search-box>
9+
</div>
10+
</div>
11+
</section>
12+
</div>
413
</div>
514
</template>
615

716
<script>
8-
export default {};
17+
import BcHeader from './components/header.vue';
18+
import SearchBox from './components/search-box.vue';
19+
20+
export default {
21+
components: {
22+
BcHeader,
23+
SearchBox,
24+
},
25+
};
926
</script>

src/assets/data.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"name": "Aparat",
4+
"colors": [
5+
"#E0E0E0",
6+
"#AEC0FF",
7+
"#00A1CD"
8+
]
9+
},
10+
{
11+
"name": "Mihanblog",
12+
"colors": [
13+
"#ACAC1A",
14+
"#00A1CD"
15+
]
16+
},
17+
{
18+
"name": "Raad",
19+
"colors": [
20+
"#0CAC1A",
21+
"#0010D3",
22+
"#988AAC"
23+
]
24+
}
25+
]

src/assets/fonts/.gitkeep

Whitespace-only changes.

src/assets/images/.gitkeep

Whitespace-only changes.

src/assets/images/logo.svg

Lines changed: 15 additions & 0 deletions
Loading

src/components/header.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<header class="header">
3+
<img src="../assets/images/logo.svg" alt="BrandColors" class="header__logo">
4+
</header>
5+
</template>
6+
7+
<script>
8+
export default {};
9+
</script>

src/components/search-box.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<div class="form-input">
3+
<div class="form-input__text-box">
4+
<input type="text" :id="id" v-model="text">
5+
</div>
6+
<div class="form-input__label">
7+
<transition name="slide-fade">
8+
<label v-if="labelVisibility" :for="id">
9+
<slot>Placeholder</slot>
10+
</label>
11+
</transition>
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script>
17+
/* eslint-disable no-underscore-dangle */
18+
/* eslint-disable object-shorthand */
19+
20+
export default {
21+
data() {
22+
return {
23+
text: '',
24+
id: this._uid,
25+
};
26+
},
27+
computed: {
28+
labelVisibility: function () {
29+
return (this.text === '');
30+
},
31+
},
32+
};
33+
</script>

src/style.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@import "styles/tools/mixins";
2+
@import "styles/tools/transitions";
3+
@import "styles/core/all";
4+
5+
@import "styles/modules/grid";
6+
7+
@import "styles/components/header";
8+
@import "styles/components/form-input";
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
%fullWidth {
2+
display: block;
3+
width: 100%;
4+
}
5+
6+
%form-typography {
7+
font-size: 14px;
8+
font-weight: 300;
9+
}
10+
11+
.form-input {
12+
position: relative;
13+
14+
&__label {
15+
position: absolute;
16+
top: 50%;
17+
left: 4px;
18+
transform: translateY(-50%);
19+
pointer-events: none;
20+
21+
label {
22+
color: #B0BEC5;
23+
@extend %fontFamily;
24+
@extend %fullWidth;
25+
@extend %form-typography;
26+
}
27+
}
28+
29+
&__text-box {
30+
input {
31+
border: none;
32+
@extend %fontFamily;
33+
@extend %fullWidth;
34+
@extend %form-typography;
35+
color: #455A64;
36+
padding: 12px 4px;
37+
}
38+
39+
&:after {
40+
content: '';
41+
border-bottom: 1px solid #263238;
42+
@extend %fullWidth;
43+
}
44+
}
45+
}

src/styles/components/_header.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.header {
2+
background-color: $header__background-color--primary;
3+
border-bottom: 1px solid $header__border-bottom-color--primary;
4+
padding: 12px 0;
5+
6+
&__logo {
7+
display: block;
8+
margin: 0 auto;
9+
}
10+
}

src/styles/core/.gitkeep

Whitespace-only changes.

src/styles/core/_all.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import "variables";
2+
@import "reset";
3+
@import "global";

src/styles/core/_global.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
body {
2+
background-color: $background-color;
3+
}
4+
5+
.page {
6+
padding-top: 58px;
7+
}

src/styles/core/_reset.scss

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
* {
2+
outline: none;
3+
box-sizing: border-box;
4+
5+
&:after,
6+
&:before {
7+
outline: none;
8+
}
9+
}
10+
11+
html, body, div, span, applet, object, iframe,
12+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
13+
a, abbr, acronym, address, big, cite, code,
14+
del, dfn, em, img, ins, kbd, q, s, samp,
15+
small, strike, strong, sub, sup, tt, var,
16+
b, u, i, center,
17+
dl, dt, dd, ol, ul, li,
18+
fieldset, form, label, legend,
19+
table, caption, tbody, tfoot, thead, tr, th, td,
20+
article, aside, canvas, details, embed,
21+
figure, figcaption, footer, header, hgroup,
22+
menu, nav, output, ruby, section, summary,
23+
time, mark, audio, video {
24+
margin: 0;
25+
padding: 0;
26+
border: 0;
27+
font-size: 100%;
28+
font: inherit;
29+
vertical-align: baseline;
30+
}
31+
32+
article, aside, details, figcaption, figure,
33+
footer, header, hgroup, menu, nav, section {
34+
display: block;
35+
}
36+
37+
body {
38+
line-height: 1;
39+
}
40+
41+
ol, ul {
42+
list-style: none;
43+
}
44+
45+
blockquote, q {
46+
quotes: none;
47+
}
48+
49+
blockquote:before, blockquote:after,
50+
q:before, q:after {
51+
content: '';
52+
content: none;
53+
}
54+
55+
table {
56+
border-collapse: collapse;
57+
border-spacing: 0;
58+
}

src/styles/core/_variables.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$background-color: #ffffff;
2+
3+
// Header
4+
$header__background-color--primary: #ffffff;
5+
$header__border-bottom-color--primary: #90A4AE;

src/styles/modules/.gitkeep

Whitespace-only changes.

src/styles/modules/_grid.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.container {
2+
max-width: 900px;
3+
margin: 0 auto;
4+
}
5+
6+
.box-1 {
7+
width: 50%;
8+
margin: 0 auto;
9+
}

src/styles/tools/.gitkeep

Whitespace-only changes.

src/styles/tools/_mixins.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
%clearfix {
2+
&:before,
3+
&:after {
4+
content: " ";
5+
display: table;
6+
}
7+
&:after {
8+
clear: both;
9+
}
10+
}
11+
12+
%fontFamily {
13+
font-family: 'Roboto', sans-serif;
14+
}
15+
16+
%defaultTransition {
17+
transition: all 300ms;
18+
}

src/styles/tools/_transitions.scss

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// slide fade
2+
.slide-fade-enter-active {
3+
transition: all .3s ease;
4+
}
5+
6+
.slide-fade-leave-active {
7+
transition: all .2s cubic-bezier(1.0, 0.5, 0.8, 1.0);
8+
}
9+
10+
.slide-fade-enter,
11+
.slide-fade-leave-to {
12+
transform: translateX(10px);
13+
opacity: 0;
14+
}
15+
16+
17+
// slide up
18+
.slide-up-enter {
19+
opacity: 0;
20+
transform: translateY(20px);
21+
}
22+
23+
.slide-up-enter-active {
24+
transition: all 300ms;
25+
}
26+
27+
.slide-up-leave-active {
28+
transition: all 200ms ease;
29+
}
30+
31+
.slide-up-leave {
32+
opacity: 1;
33+
}
34+
35+
.slide-up-leave-to {
36+
transform: translateY(40px);
37+
}

0 commit comments

Comments
 (0)