...
 
Commits (4)
:root {
--red: 0;
--green: 157;
--blue: 224;
--green: 118;
--blue: 168;
--color-accent: rgb(var(--red), var(--green), var(--blue));
--color-accent-light: rgba(var(--red), var(--green), var(--blue), 0.25);
--color-accent-ultralight: rgba(var(--red), var(--green), var(--blue), 0.06);
......@@ -17,6 +17,8 @@
--color-background: var(--color-white);
}
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
@font-face {
font-family: "icomoon";
src: url("../fonts/icomoon.eot?ymi5f6");
......@@ -76,9 +78,9 @@ body {
margin: 0;
padding: 0;
background-color: rgba(0, 0, 0, 0.03);
font-family: "Helvetica Neue", "Helvetica", sans-serif;
font-family: "Open Sans", "Helvetica", sans-serif;
font-size: 1rem;
line-height: 1.2;
line-height: 1.4;
}
/* scale up font size when we reach 76 characters per line */
......@@ -139,6 +141,7 @@ ol,
blockquote,
figure {
margin: 1rem 0 0.75rem;
font-size: 1rem;
}
p {
......@@ -181,7 +184,7 @@ Styles for containers
}
.content-container {
max-width: 1400px;
margin: 3rem auto 6rem auto;
margin: 0 auto 3rem auto;
display: flex;
justify-content: center;
}
......
<template>
<header class='profile' :style='headerStyles'>
<div class="profile-image" :style='profileStyles'></div>
<div class='profile-information'>
<h1 class='profile-name'>{{name}}</h1>
<p class='profile-bio'>{{bio}}</p>
<header class='profile' :class="{ 'has-image': hasImage }" :style='headerStyles'>
<div class="profile-content">
<div class="profile-image-container">
<div class="profile-image" :style='profileStyles'></div>
</div>
<div class='profile-information'>
<h1 class='profile-name'>{{name}}</h1>
<p class='profile-bio'>{{bio}}</p>
</div>
</div>
</header>
</template>
<script>
export default {
data () {
return {
hasImage: false
}
},
computed: {
name() {
if (this.$store.state.settings.name) {
return this.$store.state.settings.name;
return this.$store.state.settings.name
}
return this.$store.state.info && this.$store.state.info.name
? this.$store.state.info.name
: this.$i18n.t("title");
return this.$store.state.info && this.$store.state.info.name ? this.$store.state.info.name : this.$i18n.t("title")
},
bio() {
if (this.$store.state.settings.bio) {
return this.$store.state.settings.bio;
return this.$store.state.settings.bio
}
return this.$store.state.info && this.$store.state.info.bio
? this.$store.state.info.bio
: this.$i18n.t("subtitle");
return this.$store.state.info && this.$store.state.info.bio ? this.$store.state.info.bio : this.$i18n.t("subtitle")
},
profileStyles() {
let styles = {
backgroundImage: this.$store.state.jwt
? "url('img/client.png')"
: "url('img/logo.png')"
};
backgroundImage: this.$store.state.jwt ? "url('img/client.png')" : "url('img/logo.png')"
}
if (this.$store.state.settings.profileImage) {
styles.backgroundImage = `url('${
this.$store.state.settings.profileImage
}')`;
styles.backgroundPosition = `${
this.$store.state.settings.profileImageMetadata.x
}% ${this.$store.state.settings.profileImageMetadata.y}%`;
} else if (
this.$store.state.info &&
this.$store.state.info.profileImage
) {
styles.backgroundImage = `url('${
this.$store.state.info.profileImage
}')`;
styles.backgroundPosition = `${
this.$store.state.info.profileImageMetadata.x
}% ${this.$store.state.info.profileImageMetadata.y}%`;
styles.backgroundImage = `url('${this.$store.state.settings.profileImage}')`
styles.backgroundPosition = `${this.$store.state.settings.profileImageMetadata.x}% ${this.$store.state.settings.profileImageMetadata.y}%`
} else if (this.$store.state.info && this.$store.state.info.profileImage) {
styles.backgroundImage = `url('${this.$store.state.info.profileImage}')`
styles.backgroundPosition = `${this.$store.state.info.profileImageMetadata.x}% ${this.$store.state.info.profileImageMetadata.y}%`
}
return styles;
return styles
},
headerStyles() {
let styles = {
backgroundColor:
this.$store.state.info && this.$store.state.info.color
? this.$store.state.info.color.hex
: "#DDEAED"
};
: "#0076a8"
}
this.hasImage = false
if (this.$store.state.settings && this.$store.state.settings.color) {
styles.backgroundColor = this.$store.state.settings.color
? this.$store.state.settings.color.hex
: "#DDEAED";
styles.backgroundColor = this.$store.state.settings.color ? this.$store.state.settings.color.hex : "#0076a8"
}
if (
this.$store.state.settings &&
this.$store.state.settings.headerImage === ""
) {
if (this.$store.state.settings && this.$store.state.settings.headerImage === "") {
return styles;
} else if (
this.$store.state.settings &&
this.$store.state.settings.headerImage
) {
styles.backgroundImage = `url('${
this.$store.state.settings.headerImage
}')`;
styles.backgroundPosition = `${
this.$store.state.settings.headerImageMetadata.x
}% ${this.$store.state.settings.headerImageMetadata.y}%`;
} else if (this.$store.state.settings && this.$store.state.settings.headerImage) {
styles.backgroundImage = `url('${this.$store.state.settings.headerImage}')`
styles.backgroundPosition = `${this.$store.state.settings.headerImageMetadata.x}% ${this.$store.state.settings.headerImageMetadata.y}%`
this.hasImage = true
} else if (this.$store.state.info && this.$store.state.info.headerImage) {
styles.backgroundImage = `url('${this.$store.state.info.headerImage}')`;
styles.backgroundPosition = `${
this.$store.state.info.headerImageMetadata.x
}% ${this.$store.state.info.headerImageMetadata.y}%`;
styles.backgroundImage = `url('${this.$store.state.info.headerImage}')`
styles.backgroundPosition = `${this.$store.state.info.headerImageMetadata.x}% ${this.$store.state.info.headerImageMetadata.y}%`
this.hasImage = true
}
return styles;
return styles
}
}
};
}
</script>
<style>
.profile {
position: relative;
width: 100%;
color: #4a4a4a;
/* Note: the background colour and image are dynamically set on the
header itself, based on the site configuration settings. */
width: 100%;
padding: 1rem 1rem 0;
color: white;
background-size: cover;
text-align: center;
}
.profile.has-image::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
}
.profile-content {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
max-width: 1400px;
min-height: 16rem;
margin: 0 auto;
padding: .5rem 0;
}
.profile-information {
/* offset background against padding on profile__material */
margin: 1rem -1rem 0;
padding: 0.25rem 0;
background-color: rgba(0, 0, 0, 0.55);
margin: .5rem 1rem;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
color: white;
}
.profile-name {
position: relative;
margin: 0;
/* numbered font weights won’t work in all browsers, will default to bold weight */
padding-bottom: 0.5rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.4);
font-size: 1.5rem;
font-weight: 400;
line-height: 1.2;
}
.profile-bio {
margin: 0 auto 0.25rem;
max-width: 42em;
font-size: 1.25rem;
margin: 0.5rem 0 0;
font-size: 1.15rem;
}
.profile-image-container {
flex: 1 1 auto;
min-width: 4rem;
max-width: 7rem;
margin: .5rem 1rem;
}
.profile-image {
width: 7rem;
margin: 0 auto;
padding-bottom: 7rem;
width: 100%;
padding-bottom: 100%;
border: 0.2rem solid #fff;
border-radius: 50%;
background-color: #fff;
background-size: cover;
box-sizing: content-box;
overflow: hidden;
}
.profile-image img {
display: block;
width: 100%;
height: auto;
box-sizing: content-box;
}
</style>
<template>
<nav class="nav">
<ul>
<ul class="content-container">
<li class="nav__item">
<span v-if="settingsDisabled" class="nav__link is-disabled" v-t="'nav.me'"></span>
<nuxt-link v-if="!settingsDisabled" to="/" class="nav__link" v-t="'nav.me'"></nuxt-link>
......@@ -29,22 +29,15 @@ export default {
<style>
.nav {
display: flex;
user-select: none;
overflow: hidden;
overflow-x: auto;
font-size: 1.5rem;
line-height: 2;
font-size: 1rem;
background: var(--color-accent-ultralight, rgba(0, 0, 0, 0.02));
text-transform: uppercase;
}
.nav ul {
display: flex;
flex: 1 0 auto;
align-items: center;
justify-content: center;
margin: 0;
margin: 0 auto;
padding: 0 2rem;
list-style: none;
border-bottom: 1px solid #dbdbdb;
}
.nav__item {
......@@ -53,23 +46,18 @@ export default {
}
.nav__link {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: -1px;
padding: 0.5em 1em;
vertical-align: top;
cursor: pointer;
display: block;
padding: 1em;
border-bottom: 2px solid transparent;
color: #4a4a4a;
color: #000;
text-decoration: none;
}
.nav__link:not(.is-disabled):hover,
.nav__link:not(.is-disabled):focus {
border-bottom-color: #363636;
border-bottom-color: #000;
border-bottom-width: 2px;
color: #363636;
color: #000;
}
.nav__link.nuxt-link-exact-active {
......@@ -78,7 +66,7 @@ export default {
}
.nav__link.is-disabled {
color: #ccc;
color: rgba(0, 0, 0, .3);
cursor: not-allowed;
}
</style>
......@@ -134,6 +134,7 @@ export default {
background-color: var(--color-accent-ultralight);
border-radius: 0.2rem;
max-width: 50rem;
font-size: 1rem;
}
.response__profile-image {
display: flex;
......
<template>
<div class="content-container">
<section>
<section class="settings">
<form action="" @submit.prevent="saveInfo">
<div class="form-input">
<label for="name" v-t="'settings.name.label'"></label>
......@@ -194,6 +194,9 @@
</script>
<style>
.settings {
padding: 1rem 0;
}
.preview-box {
width: 6.25rem;
border: 1px solid #333;
......@@ -287,4 +290,4 @@
transform: rotate(359deg);
}
}
</style>
\ No newline at end of file
</style>