-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathIconsHome.vue
80 lines (75 loc) · 1.66 KB
/
IconsHome.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
<div>
<div class="grid p-4">
<Flipped :flip-id="set.slug" v-for="set in iconSets" :key="set.slug">
<div>
<Flipped :inverse-flip-id="set.slug">
<div class="card shadow p-4" role="button" @click="handleNavigate(set.slug)">
<div class="icon-grid">
<template v-for="icon in set.icons">
<Flipped
v-if="icon.flipped"
:flip-id="`${set.slug}-${icon.key}`"
:key="`${set.slug}-${icon.key}`"
translate
scale
>
<div class="icon flipped bg-green"></div>
</Flipped>
<div v-else class="icon bg-grey" :key="`${set.slug}-${icon.key}`"></div>
</template>
</div>
</div>
</Flipped>
</div>
</Flipped>
</div>
</div>
</template>
<script>
import Flipped from "../src/Flipped";
import iconData from "./icon-data";
export default {
name: "IconsHome",
components: {
Flipped
},
data() {
return {
iconSets: iconData
};
},
methods: {
handleNavigate(slug) {
this.$router.push(`/icons/${slug}`);
}
}
};
</script>
<style scoped>
.flow {
font-family: "flow";
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 16px;
}
.card {
background: white;
}
.icon {
display: inline-block;
margin: 0 auto;
width: 48px;
height: 48px;
border-radius: 4px;
}
.icon-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-auto-rows: 48px;
grid-gap: 16px;
grid-auto-flow: dense;
}
</style>