Skip to content

ISSUE-30: Main Layout #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>entropychat.app</title>
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
</head>
<body>
<noscript>
Expand Down
Binary file added client/src/assets/logo-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/assets/logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
122 changes: 122 additions & 0 deletions client/src/components/community/ChannelButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<template>
<div class="channel-button" :class="selected && 'active'">
<div>
<i data-feather="hash" class="hashtag"></i>
<span>{{name}}</span>
</div>
<div class="actions" v-if="true">
<i data-feather="user-plus" class="add"></i>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<i data-feather="user-plus" class="add"></i>
<svg class="add" viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="23" y1="11" x2="17" y2="11"></line></svg>

Copy link
Author

@carlan carlan Jul 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about lots of things while doing the layout and kept my fingers out of many things intentionally. Otherwise, CJ won't have anything to show on stream 😉

My intentions with my PR's are create a starting point where CJ can pick where I left off and create content. Well, apart from the Docker one, that's a real fix.

Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now. Eventually we will remove feathers icons and use the icons shidotmoe created.

<i data-feather="settings" class="settings"></i>
</div>
</div>
</template>

<script>
import { onMounted } from '@vue/composition-api';

export default {
props: {
name: {
type: String,
required: true,
},
selected: {
type: Boolean,
default: false,
},
},
setup() {
onMounted(() => {
// eslint-disable-next-line no-undef
feather.replace();
});
},
};
</script>

<style lang="scss">
.channel-button {
display: flex;
align-items: center;
justify-content: space-between;

padding: 5px 3px;

border-radius: 5px;

background-color: transparent;
transition: background-color 0.3s;

cursor: pointer;

.actions {
visibility: hidden;
}

div {
display: flex;
align-items: center;
}

div span {
font-size: 13px;

margin-left: 5px;

color: $septenary;
}

&:hover {
background-color: $senary;
// padding: 3px 3px;

div span {
font-weight: bold;
color: $white;
}

div.actions {
visibility: visible;
}
}

.hashtag {
width: 18px;
height: 18px;

color: $symbol;
}

.add {
width: 16px;
height: 16px;

color: $symbol;

cursor: pointer;

transition: color 0.3s;

&:hover {
color: $white;
}
}

.settings {
width: 16px;
height: 16px;

margin-left: 4px;

color: $symbol;

cursor: pointer;

transition: color 0.3s;

&:hover {
color: $white;
}
}
}
</style>
61 changes: 61 additions & 0 deletions client/src/components/community/Communities.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<template>
<div class="communities">
<CommunityButton :isHome="true" />

<div class="separator"></div>

<CommunityButton draggable="true" />
<CommunityButton :hasNotifications="true" :mentions="1" draggable="true" />
<CommunityButton draggable="true" />
<CommunityButton :mentions="1" draggable="true" />
<CommunityButton :hasNotifications="true" draggable="true" />
<CommunityButton draggable="true" />
<CommunityButton draggable="true" />
<CommunityButton draggable="true" />
<CommunityButton draggable="true" />
<CommunityButton draggable="true" />
<CommunityButton draggable="true" />
</div>
</template>

<script>
import CommunityButton from '@/components/community/CommunityButton.vue';

export default {
components: {
CommunityButton,
},
};
</script>

<style lang="scss">
@import '@/styles/abstracts/_variables.scss';

.communities {
grid-area: COM;

max-height: 100vh;
overflow-y: scroll;

display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;

background-color: $quaternary;
padding: 11px 0;

&::-webkit-scrollbar {
display: none;
-ms-overflow-style: none;
scrollbar-width: none;
}

.separator {
width: 32px;

border-bottom: 2px solid $quinary;
margin-bottom: 8px;
}
}
</style>
117 changes: 117 additions & 0 deletions client/src/components/community/CommunityButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<template>
<button :class="[ 'community-button',
isHome && 'home' || 'notHome',
hasNotifications && 'notification',
mentions > 0 && 'mention', ]">
<span v-if="isHome"><img src="@/assets/logo-white.png" /></span>
</button>
</template>

<script>
export default {
props: {
selected: {
type: Boolean,
default: false,
},
isHome: {
type: Boolean,
default: false,
},
hasNotifications: {
type: Boolean,
default: false,
},
mentions: Number,
},
};
</script>

<style lang="scss">
.community-button {
width: 48px;
height: 48px;

display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;

margin-bottom: 8px;

background-color: $secondary;

cursor: pointer;

position: relative;

border-radius: 25px;

img {
width: 32px;
height: 32px;
}

transition: border-radius .3s, background-color .3s;

&.active, &:hover {
border-radius: 15px;
}

&.home {
background-color: $primary;

&.active, &:hover {
background-color: $green;
}
}

&.notHome {
&.active, &:hover {
background-color: $discord;
}
}

&.notification {
&::before {
content: '';

width: 9px;
height: 9px;

position: absolute;
left: -17px;
top: calc(50% - 4.5px);

background-color: $white;
border-radius: 25px;
}
}

&.mention {
&::after {
// TODO: Bind to computed property or something
content: '1';

width: auto;
height: 16px;

position: absolute;
bottom: -4px;
right: -4px;

background-color: $notification;
border-radius: 12px;
padding: 0 4px;

border: 4px solid $quinary;

text-align: right;
font-size: 13px;
font-weight: bold;

color: $white;
}
}
}
</style>
Loading