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

Commit ef5516a

Browse files
committed
Brand colors are developed.
1 parent 19255fe commit ef5516a

File tree

7 files changed

+112
-1
lines changed

7 files changed

+112
-1
lines changed

src/App.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,42 @@
99
</div>
1010
</div>
1111
</section>
12+
<section class="brand">
13+
<div class="container">
14+
<brand-row v-for="item in colorData">
15+
<h2 slot="title">{{ item.name }}</h2>
16+
17+
<template v-for="color in item.colors">
18+
<color-box slot="colors" :color="color"></color-box>
19+
</template>
20+
</brand-row>
21+
</div>
22+
</section>
1223
</div>
1324
</div>
1425
</template>
1526

1627
<script>
28+
/* eslint-disable object-shorthand */
29+
1730
import BcHeader from './components/header.vue';
1831
import SearchBox from './components/search-box.vue';
32+
import BrandRow from './components/brand-row.vue';
33+
import ColorBox from './components/color-box.vue';
34+
35+
import colorData from './assets/data.json';
1936
2037
export default {
38+
data() {
39+
return {
40+
colorData: colorData,
41+
};
42+
},
2143
components: {
2244
BcHeader,
2345
SearchBox,
46+
BrandRow,
47+
ColorBox,
2448
},
2549
};
2650
</script>

src/components/brand-row.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<div class="brand-row">
3+
<div class="brand-row__brand-title">
4+
<slot name="title">
5+
<h2>Brand Title</h2>
6+
</slot>
7+
</div>
8+
<div class="brand-row__brand-colors">
9+
<slot name="colors">
10+
<color-box color="#EA1D5D"></color-box>
11+
</slot>
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script>
17+
import ColorBox from './color-box.vue';
18+
19+
export default {
20+
components: {
21+
ColorBox,
22+
},
23+
};
24+
</script>

src/components/color-box.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<div class="color-box" :style="{ backgroundColor: color }" :data-clipboard-text="color"></div>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: ['color'],
8+
};
9+
</script>

src/style.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66

77
@import "styles/components/header";
88
@import "styles/components/form-input";
9+
@import "styles/components/color-box";
10+
@import "styles/components/brand-row";

src/styles/components/_brand-row.scss

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.brand-row {
2+
@extend %clearfix;
3+
background-color: #ffffff;
4+
display: block;
5+
width: 100%;
6+
padding: 8px 0;
7+
8+
&__brand-title {
9+
@extend %fontFamily;
10+
float: left;
11+
width: 218px;
12+
font-size: 18px;
13+
font-weight: 400;
14+
color: #607D8B;
15+
margin-top: 20px;
16+
}
17+
18+
&__brand-colors {
19+
@extend %clearfix;
20+
float: left;
21+
width: calc(100% - 218px);
22+
23+
.color-box {
24+
float: left;
25+
}
26+
}
27+
28+
&:not(:last-child) {
29+
border-bottom: 1px solid #CFD8DC;
30+
}
31+
}

src/styles/components/_color-box.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.color-box {
2+
width: 70px;
3+
height: 40px;
4+
border-radius: 8px;
5+
margin: 8px;
6+
cursor: pointer;
7+
8+
&:hover:after {
9+
content: '';
10+
display: block;
11+
width: 100%;
12+
height: 100%;
13+
background-color: rgba(0, 0, 0, 0.5);
14+
border-radius: 8px;
15+
}
16+
}

src/styles/core/_global.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ body {
33
}
44

55
.page {
6-
padding-top: 58px;
6+
.search {
7+
padding-top: 58px;
8+
}
9+
.brand {
10+
padding-top: 90px;
11+
}
712
}

0 commit comments

Comments
 (0)