Skip to content

Commit

Permalink
general section
Browse files Browse the repository at this point in the history
  • Loading branch information
ntdo2506 committed Mar 23, 2021
1 parent 8d05b29 commit cac3712
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 11 deletions.
23 changes: 14 additions & 9 deletions components/BigElement.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<template>
<div
v-if="data"
class="bg-secondary shadow rounded-3 p-2 border-top border-primary border-5"
v-if="socialData"
class="color-bg shadow rounded-3 p-2 border-top border-primary border-5"
style="width: 250px"
>
<div class="m-3">
<a-row justify="center" type="flex">
<a-col :span="6" class="mr-5">
<a-icon
:style="{ fontSize: '25px', color: '#e71b2b' }"
:type="data.icon"
:style="{ fontSize: '25px', color: 'hsl(348, 97%, 39%)' }"
:type="socialData.icon"
/>
</a-col>
<a-col :span="6" class="text-white-50">{{ data.title }}</a-col>
<a-col :span="6" class="text-white-50">{{ socialData.title }}</a-col>
</a-row>
</div>
<div>
<h1 class="text-white fw-bolder" style="font-size: 60px">
{{ data.subscriberCount }}
{{ socialData.subscriberCount }}
</h1>
<p class="text-white-75 lh-base fw-light">FOLLOWERS</p>
<p class="text-warning">- {{ data.percent }} Today</p>
<p class="text-white-50 lh-lg">FOLLOWERS</p>
<p class="text-success">- {{ socialData.percent }} Today</p>
</div>
</div>
</template>

<script>
export default {
props: {
data: {
socialData: {
type: Object,
default: () => {
return {
Expand All @@ -42,3 +42,8 @@ export default {
},
}
</script>
<style>
.color-bg {
background-color: #252b43;
}
</style>
48 changes: 48 additions & 0 deletions components/GeneralSection.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template>
<div>
<h1 class="text-white">Social Media Dashboard</h1>
<div class="d-flex flex-row">
<div v-for="(socialData, index) in items" :key="index">
<BigElement :social-data="socialData" class="m-3" />
</div>
</div>
</div>
</template>

<script>
import BigElement from '~/components/BigElement'
export default {
components: { BigElement },
data() {
return {
items: [
{
icon: 'youtube',
title: '@ntdo',
subscriberCount: 1000,
percent: 20,
},
{
icon: 'youtube',
title: '@ntdo',
subscriberCount: 1000,
percent: 20,
},
{
icon: 'youtube',
title: '@ntdo',
subscriberCount: 1000,
percent: 20,
},
{
icon: 'youtube',
title: '@ntdo',
subscriberCount: 1000,
percent: 20,
},
],
}
},
}
</script>
9 changes: 7 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="container">
<div>
<BigElement />
<GeneralSection />
</div>
<a-row type="flex">
<small-component
Expand Down Expand Up @@ -37,7 +37,11 @@
</template>

<script lang="ts">
export default {}
import Vue from 'vue'
import GeneralSection from '~/components/GeneralSection.vue'
export default Vue.extend({
components: { GeneralSection },
})
</script>

<style>
Expand All @@ -48,5 +52,6 @@ export default {}
justify-content: center;
align-items: center;
text-align: center;
background-color: #20222f;
}
</style>

0 comments on commit cac3712

Please sign in to comment.