Skip to content

Commit

Permalink
Refactor logos, first step
Browse files Browse the repository at this point in the history
  • Loading branch information
Tirokk committed May 18, 2021
1 parent 453bd7a commit ff6cc30
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 343 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ocelot.social is a nonprofit social, action and knowledge network that connects
* **Action**: Don't just read about how to make the world a better place, but come into **Action** by following provided suggestions on the **Action** tab provided by other people or **Organisations**.

<p align="center">
<img src="webapp/static/img/custom/welcome.svg" alt="Ocelot-Social" width="40%" height="40%">
<img src="webapp/static/img/custom/logo-squared.svg" alt="ocelot.social" width="40%" height="40%">
</p>

## Live demo
Expand Down
1 change: 1 addition & 0 deletions backend/src/config/links.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding
export default {
ORGANIZATION: 'https://ocelot.social',
DONATE: 'https://ocelot-social.herokuapp.com/donations',
Expand Down
10 changes: 10 additions & 0 deletions backend/src/config/logos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// this file is duplicated in `backend/src/config/logos.js` and `webapp/constants/logos.js` and replaced on rebranding
// this are the paths in the webapp
export default {
LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg',
LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg',
LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg',
LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg',
LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg',
LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg',
}
2 changes: 2 additions & 0 deletions backend/src/config/metadata.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// this file is duplicated in `backend/src/config/metadata.js` and `webapp/constants/metadata.js` and replaced on rebranding
export default {
APPLICATION_NAME: 'ocelot.social',
APPLICATION_SHORT_NAME: 'ocelot',
APPLICATION_DESCRIPTION: 'ocelot.social Community Network',
COOKIE_NAME: 'ocelot-social-token',
ORGANIZATION_NAME: 'ocelot.social Community',
ORGANIZATION_JURISDICTION: 'City of Angels',
}
3 changes: 2 additions & 1 deletion backend/src/middleware/email/templateBuilder.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import mustache from 'mustache'
import CONFIG from '../../config'
import logosWebapp from '../../config/logos.js'

import * as templates from './templates'

const from = CONFIG.EMAIL_DEFAULT_SENDER
const welcomeImageUrl = new URL(`/img/custom/welcome.svg`, CONFIG.CLIENT_URI)
const welcomeImageUrl = new URL(logosWebapp.LOGO_WELCOME_PATH, CONFIG.CLIENT_URI)

const defaultParams = {
supportUrl: CONFIG.SUPPORT_URL,
Expand Down
12 changes: 7 additions & 5 deletions webapp/components/LoginForm/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<base-card>
<template #imageColumn>
<a :href="links.ORGANIZATION" :title="$t('login.moreInfo', metadata)" target="_blank">
<img class="image" alt="Welcome" src="/img/custom/welcome.svg" />
<logo type="welcome" />
</a>
</template>
<h2 class="title">{{ $t('login.login') }}</h2>
Expand Down Expand Up @@ -56,13 +56,15 @@
</template>

<script>
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
import links from '~/constants/links.js'
import metadata from '~/constants/metadata.js'
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
import Logo from '~/components/Logo/Logo'
export default {
components: {
LocaleSwitch,
Logo,
},
data() {
return {
Expand Down Expand Up @@ -122,9 +124,9 @@ export default {
margin-top: $space-large;
margin-bottom: $space-small;
}
.image {
width: 100%;
}
// .image {
// width: 100%;
// }
}
.password-wrapper {
Expand Down
52 changes: 44 additions & 8 deletions webapp/components/Logo/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
<template>
<component :is="tag" class="ds-logo" :class="[inverse && 'ds-logo-inverse']">
<svg-logo v-if="!inverse" class="ds-logo-svg" />
<svg-logo-inverse v-else class="ds-logo-svg" />
<img v-if="!inverse" class="ds-logo-svg" :alt="metadata.APPLICATION_NAME + ' ' + logo.alt" :src="logo.path" :style="logoWidth" />
<img v-else class="ds-logo-svg" :alt="metadata.APPLICATION_NAME + ' ' + logo.alt" :src="logo.path" :style="logoWidth" />
</component>
</template>

<script>
import svgLogo from '~/static/img/custom/Logo-Horizontal.svg'
import svgLogoInverse from '~/static/img/custom/Logo-Horizontal-Dark.svg'
import logos from '~/constants/logos.js'
import metadata from '~/constants/metadata.js'
/**
* This component displays the brand's logo.
* @version 1.0.0
*/
export default {
name: 'Logo',
components: {
svgLogo,
svgLogoInverse,
},
props: {
/**
* Logo type
*/
type: {
type: String,
required: true,
},
/**
* Logo type
*/
width: {
type: String,
default: null,
},
/**
* Inverse the logo
*/
Expand All @@ -34,6 +45,31 @@ export default {
default: 'div',
},
},
data() {
const logosObject = {
header: { path: logos.LOGO_HEADER_PATH, alt: 'Header', widthDefault: '130px'},
welcome: { path: logos.LOGO_WELCOME_PATH, alt: 'Welcome', widthDefault: '200px'},
signup: { path: logos.LOGO_SIGNUP_PATH, alt: 'Sign Up', widthDefault: '200px'},
logout: { path: logos.LOGO_LOGOUT_PATH, alt: 'Logging Out', widthDefault: '200px'},
passwordReset: { path: logos.LOGO_PASSWORD_RESET_PATH, alt: 'Reset Your Password', widthDefault: '200px'},
maintenance: { path: logos.LOGO_MAINTENACE_RESET_PATH, alt: 'Under Maintenance', widthDefault: '75%'},
}
return {
logo: logosObject[this.type],
metadata,
}
},
computed: {
logoWidth() {
let width = ''
if (this.width === null) {
width = this.logo.widthDefault
} else {
width = this.width
}
return `width: ${width};`
},
},
}
</script>

Expand Down
4 changes: 3 additions & 1 deletion webapp/components/Registration/RegistrationSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<base-card>
<template #imageColumn>
<a :href="links.ORGANIZATION" :title="$t('login.moreInfo', metadata)" target="_blank">
<img class="image" alt="Welcome" src="/img/custom/welcome.svg" />
<logo type="signup" />
</a>
</template>

Expand Down Expand Up @@ -47,6 +47,7 @@ import links from '~/constants/links.js'
import metadata from '~/constants/metadata.js'
import ComponentSlider from '~/components/ComponentSlider/ComponentSlider'
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
import Logo from '~/components/Logo/Logo'
import RegistrationSlideCreate from './RegistrationSlideCreate'
import RegistrationSlideEmail from './RegistrationSlideEmail'
import RegistrationSlideInvite from './RegistrationSlideInvite'
Expand All @@ -58,6 +59,7 @@ export default {
components: {
ComponentSlider,
LocaleSwitch,
Logo,
RegistrationSlideCreate,
RegistrationSlideEmail,
RegistrationSlideInvite,
Expand Down
5 changes: 3 additions & 2 deletions webapp/components/_new/generic/BaseCard/BaseCard.story.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { storiesOf } from '@storybook/vue'
import helpers from '~/storybook/helpers'
import logos from '~/constants/logos.js'
import BaseCard from './BaseCard.vue'

storiesOf('Generic/BaseCard', module)
Expand Down Expand Up @@ -33,7 +34,7 @@ storiesOf('Generic/BaseCard', module)
template: `
<base-card style="width: 600px;">
<template #imageColumn>
<img class="image" alt="Example image" src="/img/custom/welcome.svg" />
<img class="image" alt="Example image" src="${logos.LOGO_WELCOME_PATH}" />
</template>
<h2 class="title">I am a card heading</h2>
<p>And I am a paragraph.</p>
Expand All @@ -46,7 +47,7 @@ storiesOf('Generic/BaseCard', module)
template: `
<base-card style="width: 600px;">
<template #imageColumn>
<img class="image" alt="Example image" src="/img/custom/welcome.svg" />
<img class="image" alt="Example image" src="${logos.LOGO_WELCOME_PATH}" />
</template>
<h2 class="title">I am a card heading</h2>
<p>And I am a paragraph.</p>
Expand Down
1 change: 1 addition & 0 deletions webapp/constants/links.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// this file is duplicated in `backend/src/config/links.js` and `webapp/constants/links.js` and replaced on rebranding
export default {
ORGANIZATION: 'https://ocelot.social',
DONATE: 'https://ocelot-social.herokuapp.com/donations',
Expand Down
10 changes: 10 additions & 0 deletions webapp/constants/logos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// this file is duplicated in `backend/src/config/logos.js` and `webapp/constants/logos.js` and replaced on rebranding
// this are the paths in the webapp
export default {
LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg',
LOGO_SIGNUP_PATH: '/img/custom/logo-squared.svg',
LOGO_WELCOME_PATH: '/img/custom/logo-squared.svg',
LOGO_LOGOUT_PATH: '/img/custom/logo-squared.svg',
LOGO_PASSWORD_RESET_PATH: '/img/custom/logo-squared.svg',
LOGO_MAINTENACE_RESET_PATH: '/img/custom/logo-squared.svg',
}
3 changes: 2 additions & 1 deletion webapp/constants/metadata.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// this file is duplicated in `backend/src/config/metadata.js` and `webapp/constants/metadata.js` and replaced on rebranding
export default {
APPLICATION_NAME: 'ocelot.social',
APPLICATION_SHORT_NAME: 'ocelot',
APPLICATION_DESCRIPTION: 'ocelot.social Community Network',
COOKIE_NAME: 'ocelot-social-token',
ORGANIZATION_NAME: 'ocelot.social Community',
ORGANIZATION_JURISDICTION: 'City of Angels',
COOKIE_NAME: 'ocelot-social-token',
}
2 changes: 1 addition & 1 deletion webapp/layouts/basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ds-flex-item width="5.5%" />
<ds-flex-item style="flex-grow: 1" width="20%">
<a @click="redirectToRoot">
<logo />
<logo type="header" />
</a>
</ds-flex-item>
<ds-flex-item width="20%" style="flex-grow: 0">
Expand Down
2 changes: 1 addition & 1 deletion webapp/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ds-flex class="main-navigation-flex">
<ds-flex-item :width="{ base: '142px' }">
<nuxt-link :to="{ name: 'index' }" v-scroll-to="'.main-navigation'">
<logo />
<logo type="header" />
</nuxt-link>
</ds-flex-item>
<ds-flex-item
Expand Down
12 changes: 3 additions & 9 deletions webapp/maintenance/source/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
<ds-flex-item :width="{ base: '100%', sm: 1, md: 1 }">
<ds-space>
<a :href="links.ORGANIZATION" :title="$t('login.moreInfo', metadata)" target="_blank">
<img
class="image"
alt="Under maintenance"
src="/img/custom/under-maintenance.svg"
/>
<logo type="maintenance" />
</a>
</ds-space>
</ds-flex-item>
Expand Down Expand Up @@ -42,11 +38,13 @@ import emails from '~/constants/emails.js'
import links from '~/constants/links.js'
import metadata from '~/constants/metadata.js'
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
import Logo from '~/components/Logo/Logo'
export default {
layout: 'blank',
components: {
LocaleSwitch,
Logo,
},
data() {
return { links, metadata, supportEmail: emails.SUPPORT }
Expand All @@ -55,8 +53,4 @@ export default {
</script>

<style lang="scss">
.image {
width: 75%;
height: auto;
}
</style>
7 changes: 6 additions & 1 deletion webapp/pages/logout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ds-flex>
<ds-flex-item :width="{ base: '100%' }" centered>
<ds-space style="text-align: center" margin-top="large" margin-bottom="xxx-small" centered>
<img style="width: 200px" alt="Logging out" src="/img/custom/logout.svg" />
<logo type="logout" />
</ds-space>
<ds-space style="text-align: center" margin-top="small" margin-bottom="xxx-small" centered>
<ds-heading tag="h3" soft>Logging out...</ds-heading>
Expand All @@ -14,8 +14,13 @@
</template>

<script>
import Logo from '~/components/Logo/Logo'
export default {
layout: 'blank',
components: {
Logo,
},
async beforeCreate() {
await this.$store.dispatch('auth/logout')
this.$router.replace('/login')
Expand Down
4 changes: 3 additions & 1 deletion webapp/pages/password-reset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<base-card>
<template #imageColumn>
<a :href="links.ORGANIZATION" :title="$t('login.moreInfo', metadata)" target="_blank">
<img class="image" alt="Reset your password" src="/img/custom/password-reset.svg" />
<logo type="passwordReset" />
</a>
</template>
<nuxt-child />
Expand All @@ -18,10 +18,12 @@
import links from '~/constants/links.js'
import metadata from '~/constants/metadata.js'
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
import Logo from '~/components/Logo/Logo'
export default {
components: {
LocaleSwitch,
Logo,
},
layout: 'no-header',
data() {
Expand Down
48 changes: 0 additions & 48 deletions webapp/static/img/custom/Logo-Horizontal-Dark.svg

This file was deleted.

2 changes: 1 addition & 1 deletion webapp/static/img/custom/Logo-Horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ff6cc30

Please sign in to comment.