From 94f9559fe5863bbe42fc0c5e03ef9ef575d1d6f6 Mon Sep 17 00:00:00 2001 From: dChiamp Date: Wed, 22 Jul 2020 10:57:36 -0700 Subject: [PATCH 1/9] adds sectionAwards --- .../SectionAwards/SectionAwards.stories.js | 60 ++++++++ .../SectionAwards/SectionAwards.vue | 133 ++++++++++++++++++ src/components/global/CountUp.vue | 62 ++++++++ src/directives/IntersectionObserver.vue | 101 +++++++++++++ 4 files changed, 356 insertions(+) create mode 100644 src/components/SectionAwards/SectionAwards.stories.js create mode 100644 src/components/SectionAwards/SectionAwards.vue create mode 100644 src/components/global/CountUp.vue create mode 100644 src/directives/IntersectionObserver.vue diff --git a/src/components/SectionAwards/SectionAwards.stories.js b/src/components/SectionAwards/SectionAwards.stories.js new file mode 100644 index 0000000..2279ac5 --- /dev/null +++ b/src/components/SectionAwards/SectionAwards.stories.js @@ -0,0 +1,60 @@ +import SectionAwards from "./SectionAwards" +import API from "@/static/db.json" + +const Awards = [ + { + total: 2, + text: "BET awards" + }, + { + total: 20, + text: "Clio awards" + }, + { + total: 13, + text: "Cannes Lions" + }, + { + total: 5, + text: "Webby Awards" + }, + { + total: 12, + text: "Grammys" + }, + { + total: 5, + text: "Latin Grammys" + }, + { + total: 8, + text: "Cyclope Awards" + }, + { + total: 6, + text: "Shorts Awards" + }, + { + total: 2, + text: "Music Video Festival Brazil" + }, + { + total: 7, + text: "Berlin Music Video Awards" + } +] + +export default { + title: "@dchiamp / SectionAwards" +} + +export const Default = () => ({ + components: { SectionAwards }, + data() { + return { + api: API, + awards: Awards + } + }, + template: `` +}) diff --git a/src/components/SectionAwards/SectionAwards.vue b/src/components/SectionAwards/SectionAwards.vue new file mode 100644 index 0000000..b48e1d9 --- /dev/null +++ b/src/components/SectionAwards/SectionAwards.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/src/components/global/CountUp.vue b/src/components/global/CountUp.vue new file mode 100644 index 0000000..eb64fc5 --- /dev/null +++ b/src/components/global/CountUp.vue @@ -0,0 +1,62 @@ + + + diff --git a/src/directives/IntersectionObserver.vue b/src/directives/IntersectionObserver.vue new file mode 100644 index 0000000..b409cb0 --- /dev/null +++ b/src/directives/IntersectionObserver.vue @@ -0,0 +1,101 @@ + From 734e689a9bf3ab8543f789ebceda43914cea279f Mon Sep 17 00:00:00 2001 From: dChiamp Date: Wed, 22 Jul 2020 11:01:31 -0700 Subject: [PATCH 2/9] adds more responsive styles --- src/components/SectionAwards/SectionAwards.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SectionAwards/SectionAwards.vue b/src/components/SectionAwards/SectionAwards.vue index b48e1d9..2fe7f59 100644 --- a/src/components/SectionAwards/SectionAwards.vue +++ b/src/components/SectionAwards/SectionAwards.vue @@ -15,7 +15,7 @@ element="span" :to="award.total" :start-count="startCount" - :duration="2000" + :duration="1200" />

@@ -91,10 +91,11 @@ export default { flex-direction: row; justify-content: flex-start; align-items: center; - margin: 10px 0; + margin: 0 0 10px 0; .count { font-size: 50px; + font-weight: 400; min-width: 75px; height: auto; text-align: center; From 2fa1f0a63055889ee5831806006789d4d9297f66 Mon Sep 17 00:00:00 2001 From: dChiamp Date: Wed, 22 Jul 2020 11:21:32 -0700 Subject: [PATCH 3/9] adds mrore responsivce styles --- src/components/SectionAwards/SectionAwards.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/SectionAwards/SectionAwards.vue b/src/components/SectionAwards/SectionAwards.vue index 2fe7f59..63a2910 100644 --- a/src/components/SectionAwards/SectionAwards.vue +++ b/src/components/SectionAwards/SectionAwards.vue @@ -62,7 +62,7 @@ export default { position: relative; background-color: var(--color-pink); color: var(--color-black); - padding: var(--unit-gutter); + padding: 60px 50px; box-sizing: border-box; .title { @@ -91,7 +91,7 @@ export default { flex-direction: row; justify-content: flex-start; align-items: center; - margin: 0 0 10px 0; + margin: 10px 0; .count { font-size: 50px; @@ -121,6 +121,8 @@ export default { columns: 1; } .award { + margin: 0 0 10px 0; + .count { font-size: 20px; min-width: 30px; From d87f1cd317bbb95cf7042e4def092ba7b4f127bd Mon Sep 17 00:00:00 2001 From: dChiamp Date: Wed, 22 Jul 2020 11:26:10 -0700 Subject: [PATCH 4/9] adds title prop --- src/components/SectionAwards/SectionAwards.stories.js | 2 +- src/components/SectionAwards/SectionAwards.vue | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/SectionAwards/SectionAwards.stories.js b/src/components/SectionAwards/SectionAwards.stories.js index 2279ac5..3852318 100644 --- a/src/components/SectionAwards/SectionAwards.stories.js +++ b/src/components/SectionAwards/SectionAwards.stories.js @@ -56,5 +56,5 @@ export const Default = () => ({ awards: Awards } }, - template: `` + template: `` }) diff --git a/src/components/SectionAwards/SectionAwards.vue b/src/components/SectionAwards/SectionAwards.vue index 63a2910..4fa686d 100644 --- a/src/components/SectionAwards/SectionAwards.vue +++ b/src/components/SectionAwards/SectionAwards.vue @@ -6,7 +6,7 @@ class="section-awards" @has-intersected="hasIntersected()" > -

+

  • @@ -38,6 +38,10 @@ export default { CountUp }, props: { + title: { + type: String, + default: "Awards" + }, awards: { type: Array, default: () => [] From 14a34e0e9f5561204e6dd1fb70a6ceae1a6c185e Mon Sep 17 00:00:00 2001 From: dChiamp Date: Wed, 22 Jul 2020 11:28:58 -0700 Subject: [PATCH 5/9] changes containing div to section tag --- src/components/SectionAwards/SectionAwards.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SectionAwards/SectionAwards.vue b/src/components/SectionAwards/SectionAwards.vue index 4fa686d..ce0a668 100644 --- a/src/components/SectionAwards/SectionAwards.vue +++ b/src/components/SectionAwards/SectionAwards.vue @@ -1,5 +1,5 @@ -