Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Menteur
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
Menteur
Commits
67e46413
Unverified
Commit
67e46413
authored
Apr 26, 2020
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(client): Card
parent
0eb3d339
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
1 deletion
+59
-1
App.vue
client/src/App.vue
+4
-1
Card.vue
client/src/components/Card.vue
+55
-0
No files found.
client/src/App.vue
View file @
67e46413
...
...
@@ -3,6 +3,7 @@
<HelloWorld
/>
<Sockets/>
<div
id=
"game"
>
<Card
value=
"ace"
color=
"hearts"
/>
<label
for=
"messages"
>
Choose a message:
</label>
<select
v-model=
"message"
name=
"message"
id=
"messages"
>
<option
value=
"WAITING"
>
J'attends
</option>
...
...
@@ -22,6 +23,7 @@
import
VueSocketIO
from
'vue-socket.io'
import
Vuex
,
{
mapGetters
,
mapMutations
}
from
'vuex'
;
import
HelloWorld
from
"./components/HelloWorld"
;
import
Card
from
"./components/Card"
;
import
Sockets
from
"./Sockets"
;
import
{
store
}
from
'./vuex-store'
...
...
@@ -44,7 +46,8 @@
store
:
store
,
components
:
{
HelloWorld
,
Sockets
Sockets
,
Card
},
data
:
function
()
{
return
{
...
...
client/src/components/Card.vue
0 → 100644
View file @
67e46413
<
template
>
<div
class=
"card"
>
<img
class=
"card-pic"
v-bind:src=
"imageSrc()"
>
<p>
{{
text
()
}}
</p>
</div>
</
template
>
<
script
>
export
default
{
name
:
"Card"
,
props
:
{
value
:
String
,
color
:
String
,
},
methods
:
{
imageSrc
()
{
return
`/img/
${
this
.
value
}
_of_
${
this
.
color
}
.png`
},
text
:
function
()
{
// Translate
let
valueText
=
{
"2"
:
"Deux"
,
"3"
:
"Trois"
,
"4"
:
"Quatre"
,
"5"
:
"Cinq"
,
"6"
:
"Six"
,
"7"
:
"Sept"
,
"8"
:
"Huit"
,
"9"
:
"Neuf"
,
"10"
:
"Dix"
,
"jack"
:
"Valet"
,
"queen"
:
"Dame"
,
"king"
:
"Roi"
,
"ace"
:
"As"
}[
this
.
value
];
let
colorText
=
{
"hearts"
:
"Coeur"
,
"spades"
:
"Pique"
,
"clubs"
:
"Trèfle"
,
"diamonds"
:
"Carreau"
}[
this
.
color
];
// Capitalize
valueText
=
valueText
.
charAt
(
0
).
toUpperCase
()
+
valueText
.
slice
(
1
);
colorText
=
colorText
.
charAt
(
0
).
toUpperCase
()
+
colorText
.
slice
(
1
);
return
`
${
valueText
}
de
${
colorText
}
`
}
}
}
</
script
>
<
style
scoped
>
.card-pic
{
max-width
:
150px
;
}
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment