Skip to content

Canvas implementation #30

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

Merged
merged 1 commit into from
Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 33 additions & 0 deletions src/components/newBadge/Buttons.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<div>
<v-layout justify-center row>
<v-btn-group class = "buttongroup">
<v-btn class = "button">
<i class="fas fa-mouse-pointer"></i>
</v-btn>
<v-btn class = "button">
<i class="fas fa-pen"></i>
</v-btn>
<v-btn class = "button">
<i class="fas fa-eraser"></i>
</v-btn>
<v-btn class = "button">
<i class="fas fa-square"></i>
</v-btn>
<v-btn class = "button">
<i class="fas fa-circle"></i>
</v-btn>
<v-btn class = "button">
<i class="fas fa-magic"></i>
</v-btn>
<v-btn>T</v-btn>
</v-btn-group>
</v-layout>
</div>
</template>

<style>
.button {
padding: 0px, 5px;
}
</style>
11 changes: 10 additions & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue';
import Router from 'vue-router';
import AuthView from './views/AuthView';
import HomeView from './views/HomeView';
import NewBadge from './views/NewBadge';
import OrgView from './views/OrgView';
import Upload from "./views/Upload.vue";
import AuthService from './services/authService';
Expand Down Expand Up @@ -33,6 +34,14 @@ export default new Router({
next(authService.isLoggedIn());
}
},
{
path:'/newBadge',
name: 'newBadge',
component: NewBadge,
beforeEnter: (to, from, next) => {
next(authService.isLoggedIn());
}
},
{
path: '/org/:name',
name: 'orgView',
Expand All @@ -42,4 +51,4 @@ export default new Router({
}
}
]
});
});
101 changes: 57 additions & 44 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,44 +1,57 @@
<template>
<div>
<v-layout class="ma-5" justify-center>
<div v-if="!isLoading">
<UserDetails/>
<div class="mt-5 orgs">Organizations</div>
<OrgList/>
</div>
<div v-if="isLoading">
<img src="@/assets/loaders/block.svg" alt="loading...">
</div>
</v-layout>
</div>
</template>

<script>
import UserDetails from '../components/home/UserDetails';
import OrgList from '../components/home/OrgList';

export default {
name: 'HomeView',
computed: {
isLoading() {
return this.$store.state.user == '' && this.$store.state.userOrgs == ''
? true
: false;
}
},
components: {
UserDetails,
OrgList
},
created() {
this.$store.dispatch('loadUser');
this.$store.dispatch('loadUserOrgs');
}
};
</script>

<style lang="scss" scoped>
.orgs {
font-size: 20px;
}
</style>
<template>
<div>
<v-layout class="ma-5" justify-center>
<div v-if="!isLoading">
<v-btn style="margin-bottom: 30px;">
<a href="#/newbadge">Create a New Badge</a>
</v-btn>
<UserDetails/>
<div class="mt-5 orgs">
<center>Organizations</center></div>
<OrgList/>
</div>
<div v-if="isLoading">
<img src="@/assets/loaders/block.svg" alt="loading...">
</div>
</v-layout>
</div>
</template>

<script>
import UserDetails from '../components/home/UserDetails';
import OrgList from '../components/home/OrgList';

export default {
name: 'HomeView',
computed: {
isLoading() {
return this.$store.state.user == '' && this.$store.state.userOrgs == ''
? true
: false;
}
},
components: {
UserDetails,
OrgList
},
created() {
this.$store.dispatch('loadUser');
this.$store.dispatch('loadUserOrgs');
}
};
</script>

<style lang="scss" scoped>
.orgs {
font-size: 20px;
}

A {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
</style>
54 changes: 54 additions & 0 deletions src/views/NewBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<template>
<body style ="background-image: url('https://png.pngtree.com/thumb_back/fh260/background/20190331/pngtree-vector-white-abstract-background-design-templates-collection-wit-image_94438.jpg'); background-repeat: repeat;">
<div class = "mt-5 orgs">
<h1 style ="font-family: georgia; font-size: 45px;">
<center>
<b>Create a New Badge!</b>
</center>
</h1>
<h2 style ="margin-bottom: 30px; font-family: georgia; font-size: 25px;">
<center>
<b>Design your own badge for your organization.</b>
</center>
</h2>
<Buttons/>
<v-layout style="margin: 10px;" justify-center="">
<canvas id = "canvas" width="900" height="600">
</canvas>
</v-layout>
</div>
</body>
</template>

<script>
import Buttons from '../components/newBadge/Buttons';

export default {
name: 'NewBadge',
components: {
Buttons
}
}

function draw() {
var canvas = document.getElementById('canvas');
if (canvas.getContext) {
var ctx = newCanvas.getContext('2d');
}
}
</script>

<style>
canvas {
background-color: white;
margin: auto;
display: block;
border: 2px solid gray;
border-radius: 2px;
}

.title {
padding: 20px;
font-size: 80px;
}
</style>