Skip to content

Commit

Permalink
Merge pull request #16 from nih-sparc/feat-logo-CU-m12yn8
Browse files Browse the repository at this point in the history
Logo - CU-m12yn8
  • Loading branch information
cameronbaney authored Mar 11, 2021
2 parents 6ee4a1f + f855b05 commit 157bd28
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/assets/img/sparc-logo/sparc-alt-logo-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/img/sparc-logo/sparc-alt-logo-primary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/img/sparc-logo/sparc-alt-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/img/sparc-logo/sparc-logo-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/img/sparc-logo/sparc-logo-primary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/img/sparc-logo/sparc-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/components/SparcLogo/SparcLogo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<div>
<img :src="logoSrc" alt="Logo for SPARC">
</div>
</template>

<script>
export default {
name: 'SparcLogo',
props: {
type: {
type: String,
default: 'primary'
},
secondary: {
type: Boolean,
default: false
}
},
computed: {
logoSrc: function() {
return require (`@/assets/img/sparc-logo/sparc-${this.secondary ? 'alt-' : ''}logo-${this.type}.svg`)
}
}
}
</script>

<style lang="scss" scoped>
img {
display: block;
height: auto;
width: 100%;
}
</style>
63 changes: 63 additions & 0 deletions src/stories/logo/demo-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@import '../../assets/_variables.scss';
.logo-demo-styles {
margin-top: 4rem;
.logo-primary {
padding: 0 6rem;
}
.logo-white,
.logo-black {
align-items: center;
box-sizing: border-box;
display: flex;
justify-content: center;;
height: 18.75rem;
padding: 6.875rem 4.0625rem;
&.logo-white {
background: #000;
}
&.logo-black {
background: $background;
}
}
.logo-usage-wrap {
@media (min-width: 48em) {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
}

.demo-logo-usage {
align-items: center;
box-sizing: border-box;
display: flex;
height: 17rem;
justify-content: center;
margin: 1rem 0;
padding: 2.5rem;
position: relative;
width: 17rem;
@media (min-width: 48em) {
margin: 1rem;
}
&.cross:before {
background: linear-gradient(45deg, transparent 49.8%, #979797 49.9%, #979797 50.1%, transparent 50.2%), linear-gradient(-45deg, transparent 49.8%, #979797 49.9%, #979797 50.1%, transparent 50.2%);
content: '';
height: 100%;
left: 0;
position: absolute;
top: 0;
transform: scale(1.05);
width: 100%;
}
&.logo-1 {
background: $purple;
}
&.logo-2 {
background: $darkBlue;
}
&.logo-3 {
background: $background;
}
}
}
101 changes: 101 additions & 0 deletions src/stories/logo/logo.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import SparcLogo from '@/components/SparcLogo/SparcLogo.vue'

import './demo-styles.scss';

export default {
title: 'Components/Logo',
includeStories: []
}

export const Logo = () => ({
components: { SparcLogo },
template: `
<div class="logo-demo-styles">
<div class="bx--grid">
<div class="bx--row mb-32">
<div class="bx--col">
<div class="logo-primary">
<sparc-logo type="primary" />
</div>
</div>
</div>
<div class="bx--row mb-32">
<div class="bx--col">
<div class="logo-white">
<sparc-logo type="white" />
</div>
</div>
<div class="bx--col">
<div class="logo-black">
<sparc-logo type="black" />
</div>
</div>
</div>
<div class="bx--row">
<div class="bx--col">
<div class="logo-usage-wrap">
<div class="logo-1 demo-logo-usage cross">
<sparc-logo class="logo" type="primary" />
</div>
<div class="logo-2 demo-logo-usage cross">
<sparc-logo class="logo" type="primary" />
</div>
<div class="logo-3 demo-logo-usage">
<sparc-logo class="logo" type="primary" />
</div>
</div>
</div>
</div>
</div>
</div>
`
})
export const Secondary = () => ({
components: { SparcLogo },
template: `
<div class="logo-demo-styles">
<div class="bx--grid">
<div class="bx--row mb-32">
<div class="bx--col">
<div class="logo-primary">
<sparc-logo type="primary" :secondary="true" />
</div>
</div>
</div>
<div class="bx--row mb-32">
<div class="bx--col">
<div class="logo-white">
<sparc-logo type="white" :secondary="true" />
</div>
</div>
<div class="bx--col">
<div class="logo-black">
<sparc-logo type="black" :secondary="true" />
</div>
</div>
</div>
<div class="bx--row">
<div class="bx--col">
<div class="logo-usage-wrap">
<div class="logo-1 demo-logo-usage cross">
<sparc-logo class="logo" type="primary" :secondary="true" />
</div>
<div class="logo-2 demo-logo-usage cross">
<sparc-logo class="logo" type="primary" :secondary="true" />
</div>
<div class="logo-3 demo-logo-usage">
<sparc-logo class="logo" type="primary" :secondary="true" />
</div>
</div>
</div>
</div>
</div>
</div>
`
})
Loading

0 comments on commit 157bd28

Please sign in to comment.