Skip to content
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

Lysiane store #5

Draft
wants to merge 69 commits into
base: preprod
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
16c8b75
working on cart
Lysianedon May 19, 2022
efc501a
merged computed
Lysianedon May 19, 2022
90a0d1b
added article item to cart view
Lysianedon May 19, 2022
fde9aa1
updated cart css
Lysianedon May 23, 2022
a3a1275
added bulma css buttons
Lysianedon May 23, 2022
5dcb4e0
added tabs bulms
Lysianedon May 23, 2022
c4409af
added tabs bulms
Lysianedon May 23, 2022
f686c8f
added tabs bulma
Lysianedon May 23, 2022
c017d80
added tabs bulma
Lysianedon May 23, 2022
574a9a8
all clrean
Lysianedon May 23, 2022
19e55e7
Merge branch 'cart' of https://github.com/multi-coop/shopping-cart-vu…
Lysianedon May 23, 2022
862a867
added nav functions
Lysianedon May 23, 2022
ff7d42c
working on Article css
Lysianedon May 23, 2022
2eb58a9
Merge branch 'lysiane-bulma' of https://github.com/multi-coop/shoppin…
Lysianedon May 23, 2022
464ec45
added redirection to full article page
Lysianedon May 23, 2022
53002ee
working on responsive homeview
Lysianedon May 23, 2022
13ce1c8
working on notification display
Lysianedon May 24, 2022
5611cc7
working on notification
Lysianedon May 24, 2022
5ebfb05
adding notificationDisplay function
Lysianedon May 24, 2022
ebe013e
working on responsive
Lysianedon May 24, 2022
c2c51bb
working on responsive
Lysianedon May 24, 2022
2706c76
added notification on added article
Lysianedon May 24, 2022
cb46f89
fixing bug responsive homeview
Lysianedon May 24, 2022
48d42e4
merged lysiane bukma css
Lysianedon May 24, 2022
d9bc798
adding emptyCart function
Lysianedon May 24, 2022
caf8d22
adding emptycart function
Lysianedon May 24, 2022
e471dfd
merge from lysiane-bulma
Lysianedon May 24, 2022
0a6f772
pulling from every branches
Lysianedon May 24, 2022
b876ff8
pulling from every branches
Lysianedon May 24, 2022
a0cdc32
working on store
Lysianedon May 24, 2022
85af097
working on responsive homeview
Lysianedon May 25, 2022
50f814e
working on cart css
Lysianedon May 25, 2022
56e0f02
working on css cartview
Lysianedon May 25, 2022
4a2f08e
added deleteArticle function
Lysianedon May 25, 2022
5383c52
merged from lysiane-store
Lysianedon May 25, 2022
756dbb4
merged from lysiane-store
Lysianedon May 25, 2022
68eef85
added deleteArticle function
Lysianedon May 25, 2022
4315a52
working on cart functions
Lysianedon May 25, 2022
99e66d8
debugged function addarticle
Lysianedon May 25, 2022
b4591cd
merged branch lysiane-store
Lysianedon May 25, 2022
965fbb9
added function delete + finished component cartArticle
Lysianedon May 25, 2022
534e63b
working on cartview
Lysianedon May 25, 2022
67ca15f
added total
Lysianedon May 25, 2022
a966fb9
added getter totalPrice
Lysianedon May 25, 2022
85182a8
added total
Lysianedon May 25, 2022
0070494
test
Lysianedon May 25, 2022
482c547
math round getter total
Lysianedon May 25, 2022
2e75e1c
merged from lysiane-store
Lysianedon May 25, 2022
1df914f
working on responsive cartview
Lysianedon May 25, 2022
3fe25c0
update nav
Lysianedon May 25, 2022
10d0d37
finished articleview
Lysianedon May 26, 2022
bd55c74
added addToCart function to articleview
Lysianedon May 26, 2022
d1a007d
added notification
Lysianedon May 26, 2022
feed3c0
finished responsive articleview
Lysianedon May 26, 2022
e2bf08c
finished responsive articleview
Lysianedon May 27, 2022
ba96a03
working on article
Lysianedon May 27, 2022
cd64911
refactoring functions with mixins
Lysianedon May 27, 2022
068064c
added mountingAPI function
Lysianedon May 27, 2022
9c54b33
added mountingAPI
Lysianedon May 27, 2022
098d0dc
mounting API : all good
Lysianedon May 27, 2022
056dee3
added mountingAPI
Lysianedon May 27, 2022
8c06005
removed mountingAPI
Lysianedon May 27, 2022
81bc074
merged with branch lysiane-bulma
Lysianedon May 27, 2022
8bfc5b0
merged with branch lysiane-bulma
Lysianedon May 27, 2022
69f24ed
cleaning code
Lysianedon May 27, 2022
80a7ae0
updated mixins + added it to cartview
Lysianedon May 27, 2022
e8dae63
updated mixins
Lysianedon May 27, 2022
dbc0e3d
cleaning code
Lysianedon May 27, 2022
4e59477
cleaned code
Lysianedon May 27, 2022
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
4,301 changes: 3,668 additions & 633 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"buefy": "^0.9.21",
"bulma": "^0.9.4",
"core-js": "^3.8.3",
"sass-loader": "^13.0.0",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vuex": "^3.6.2"
Expand All @@ -24,7 +27,9 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.0.0",
"node-sass": "^7.0.1",
"prettier": "^2.4.1",
"sass-loader": "^13.0.0",
"vue-template-compiler": "^2.6.14"
}
}
152 changes: 135 additions & 17 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,95 @@
<template>
<div id="app">
<h1>Your shopping Website</h1>
<nav>
<router-link
to="/" class="onglet">
Inventory
</router-link>
<router-link
to="/cart" class="onglet">
Cart : {{ $store.state.addedArticlesCount }} article(s)
</router-link>
</nav>

<div class="tabs is-medium is-right">
<!-- Title -->
<h1 class="is-hidden-mobile p-2">Green Shopping</h1>
<!-- Logo -->
<span class="icon icon-leaf is-large p-4"></span>
<!-- Navbar -->
<ul class="is-flex-desktop">
<li
:class="tab1 === true ? 'is-active' : '' "
@click="activateTab1"
>
<router-link
to="/"
>
<span class="icon icon-apparel"></span>
<div class="is-hidden-mobile">Collections</div>
</router-link>
</li>
<li
:class="tab2 ? 'is-active' : '' "
@click="activateTab2"
>
<router-link
to="/cart">
<span class="icon icon-cart"></span>
<div class="mobile is-hidden-tablet">{{ $store.state.addedArticlesCount }}</div>
<div class="is-hidden-mobile">{{ $store.state.addedArticlesCount }} {{singOrPlur}}</div>
</router-link>
</li>
</ul>

</div>
<router-view />
</div>
</template>

<script>
import 'bulma'
import { mapGetters } from 'vuex'
export default{
name: 'App',
data(){
return{
tab1 : true,
tab2: false
}
},
methods : {
activateTab1 : function(){
this.tab1 = true
this.tab2 = false
},
activateTab2 : function(){
this.tab2 = true
this.tab1 = false
},
},
computed: {
...mapGetters({
singOrPlur: 'singularOrPlurial',
})
},
}
</script>

<style>

#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
background-color: #f7f6f2;
}
html{
background-color: #f7f6f2;

nav {
padding: 30px;
}

h1{
font-weight: bold !important;
font-size: 1.5rem !important;
color: #5c7061;
}

.tabs{
background-color:#d8d4cc;
padding: 2%;
}

nav a {
Expand All @@ -37,9 +101,63 @@ nav a.router-link-exact-active {
color: #42b983;
}

.onglet{
border: 1px solid black;
padding: 1%;
margin: 1%;
/*------- ICONMOON CSS ----- */
@font-face {
font-family: 'icomoon';
src: url('@/fonts/icomoon.eot?2q5z0o');
src: url('@/fonts/icomoon.eot?2q5z0o#iefix') format('embedded-opentype'),
url('@/fonts/icomoon.ttf?2q5z0o') format('truetype'),
url('@/fonts/icomoon.woff?2q5z0o') format('woff'),
url('@/fonts/icomoon.svg?2q5z0o#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}

[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-leaf:before {
content: "\e9a4";
}

.icon-basket:before {
content: "\e901";
}
.icon-shopping:before {
content: "\e901";
}
.icon-cart:before {
content: "\e901";
}
.icon-ecommerce:before {
content: "\e901";
}
.icon-cart1:before {
content: "\e93a";
}
.icon-apparel:before {
content: "\e903";
}
.icon-shopping-cart:before {
content: "\e900";
}
.icon-view-show:before {
content: "\e902";
}

/*------- END OF ICONMOON CSS ----- */

</style>
127 changes: 96 additions & 31 deletions src/components/Article.vue
Original file line number Diff line number Diff line change
@@ -1,74 +1,139 @@
<template>
<div class="wrapper">
<h2> {{ articleInfo.title }} </h2>
<router-link :to="`/article/${articleInfo.id}`">
<h2 class="title"> {{ articleInfo.title }} </h2>
</router-link>

<router-link :to="`/article/${articleInfo.id}`">
<img :src="articleInfo.image" alt="" srcset="">
</router-link>
<h2> {{ articleInfo.price }}€ </h2>

<button
@click="addArticleToCart(articleInfo.id), incrementCount()"
:class="articleInfo.id">
Ajouter
@click="addArticleToCart(articleInfo.id), incrementCount(), displayNotification()"
:class="articleInfo.id"
class="button is-medium btn-buy is-hidden-mobile">
Add to cart
</button>

<router-link :to="`/article/${articleInfo.id}`">
<button>Voir</button>
<button class="button is-outlined is-medium is-hidden-mobile">
See details
</button>
</router-link>
<!-- MOBILE VERSION -->
<div class="mobile-btns">
<button
@click="addArticleToCart(articleInfo.id), incrementCount(), displayNotification()"
:class="articleInfo.id"
class="button is-medium btn-buy mobile is-hidden-tablet">
<span class="icon-basket"></span>
</button>


<router-link :to="`/article/${articleInfo.id}`">
<button class="button is-outlined is-medium mobile is-hidden-tablet">
<span class="icon-view-show"></span>
</button>
</router-link>

</div>
</div>
</template>

<script>
import { mapActions } from 'vuex'
import {mixinArticles} from '@/mixins/mixins'
export default{
name: 'ArticleItem',
mixins : [mixinArticles],
props : {
articleInfo : {
type : Object,
default : Object
}
},
data(){
return{

}
},
methods : mapActions([
'incrementCount',
'decrementCount',
'addArticleToCart'
]),

// async mounted(){
// const data = await fetch('https://fakestoreapi.com/products')
// const response = await data.json()
// console.log(response)
// }
}
</script>

<style scoped>
.wrapper{
border: 1px solid black;
width: 30vw;
margin: auto;
min-width: 30vw;
box-sizing: border-box;
padding: 2%;
margin-bottom: 2%;
height:60vh;
height:58.5vh;
overflow-y: scroll;
border: 1px solid grey;
margin: 3% 15%;
border: 1px solid #D0C9C0;
}

.wrapper:hover{
border-color: #6D8B74;;
}
.title{
font-size: 1.2rem;
}

.title:hover{
color: #6D8B74;
}

h2{
font-size: 1.4rem;
font-weight:bold;
margin: 4%;
}

img{
max-width: 30%;
max-width: 9vw;
width:9vw;
max-height: 22vh;
height: 22vh;
}

button{
font-weight: bold;
padding: 1%;
width: 5vw;
margin: 2%;
}
.btn-buy{
background-color: #6D8B74;
color: white;
}
/*-- MEDIA QUERIES ---------- */
@media(max-width: 1024px){
.wrapper{
width: 40vw;
}

img{
width: fit-content;
max-width: 20vw;
}
}

@media(max-width: 425px){
.wrapper{
width: 80vw;
}

img{
width: fit-content;
max-width: 55vw;
}
}
/*------- ICONMOON CSS ----- */
.icon-basket:before {
content: "\e901";
}

.icon-ecommerce:before {
content: "\e901";
}

.icon-shopping-cart:before {
content: "\e900";
}
.icon-view-show:before {
content: "\e902";
}
/*------- END OF ICONMOON CSS ----- */
</style>
Loading