Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Break resources in multiple json files & add to vuex module store #91

Merged
merged 35 commits into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d20423c
setup i18n
lostdesign Jun 20, 2019
44cf7cb
Merge branch 'master' into feature-i18n
lostdesign Jun 20, 2019
8f7730c
basic implementation of i18n for text
lostdesign Jun 20, 2019
f86ca12
merge master?
lostdesign Jun 21, 2019
23416bc
add back plugins
lostdesign Jun 21, 2019
f1a8d05
break resources in multiple json files & add to vuex module store
S3B4S Jun 22, 2019
48aeb6f
Find resources from store
S3B4S Jun 22, 2019
b40e3ae
No need for computer property
S3B4S Jun 22, 2019
a57aa26
Add tags fields & add findByTags getter
S3B4S Jun 22, 2019
ba47943
Rename resources module => data, add look up tag, add polyfill for fl…
S3B4S Jun 22, 2019
6912a96
Getters instead of accessing state directly
S3B4S Jun 22, 2019
cf327d0
Add learnjavascript.online & codetogo.io to /javascript
jadjoubran Jul 29, 2019
367e540
add codrops
Aug 6, 2019
fa8dd2e
add podcast category
Aug 6, 2019
576d40d
Merge branch 'master' into features/resources-store
S3B4S Aug 9, 2019
5b9b492
Update resources
S3B4S Aug 9, 2019
71150c7
indendation added
S3B4S Aug 9, 2019
27aaee2
Added JavaScript Questions
jakeherp Aug 13, 2019
72b2fa3
Merge pull request #121 from jakeherp/patch-1
lostdesign Aug 20, 2019
e37f5c9
Merge pull request #117 from fullstack-to/master
lostdesign Aug 20, 2019
215eab1
Merge branch 'master' into patch-1
jadjoubran Aug 20, 2019
fa72e83
Merge pull request #114 from jadjoubran/patch-1
lostdesign Aug 20, 2019
aa03bed
Merge branch 'karn-dev' into features/resources-store
S3B4S Aug 22, 2019
4e4aa46
Merge branch 'dev' into features/resources-store
S3B4S Aug 22, 2019
a10f5d7
WIP
S3B4S Sep 5, 2019
e3a786b
Make deep clone of resources, access state by getter
S3B4S Sep 5, 2019
2a18f11
Remove unused line
S3B4S Sep 5, 2019
5910c42
Add most recent resources collection
S3B4S Sep 5, 2019
967cdfb
Update new store with all current resources, remove store.json
S3B4S Sep 5, 2019
f02cf32
Add tags field to every resource
S3B4S Sep 5, 2019
1e499c7
Remove console.log
S3B4S Sep 5, 2019
b936bf1
.cardsActive -> &Active in sass, rename variable names
S3B4S Sep 6, 2019
2832b2f
Fix active highlight of card
S3B4S Sep 8, 2019
4314632
:recycle: Adjust card/table toggle and table layout
lostdesign Sep 30, 2019
68dfacd
:recycle: Adjust table spacing and color
lostdesign Sep 30, 2019
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 changes: 3 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ These are lovely people who have helped this project:

- [lostdesign](https://github.com/lostdesign) : Active Contributor and currently also the main contributor.
* twitter: @lostdesign
- [Kevin](https://github.com/S3B4S) :dog:
- [Kevin](https://github.com/S3B4S) :dog:
- [jacobparis](https://github.com/jacobparis) : Team Devcord
* twitter: @jacobmparis
57 changes: 10 additions & 47 deletions components/Card.vue
Original file line number Diff line number Diff line change
@@ -1,58 +1,25 @@
<template lang="pug">
.card(:class="active")
p.card--title {{title}}
p.card--description {{desc}}
.card(:class="{ cardActive: isActive }")
p.card--title {{resource.title}}
p.card--description {{resource.desc}}
.card--links
a.card--reference(@click='createCopyUrl') Copy
a.card--reference(@click='createCopyUrl(resource)') Copy
br
a.card--target(:href="url" :target='title' rel='noreferrer') Open
a.card--target(:href="resource.url" :target='resource.title' rel='noreferrer') Open
</template>

<script>
export default {
props: ['title', 'desc', 'url'],
data(){
return {
active:''
}
},
methods: {
async createCopyUrl() {
try {
let currentPath = this.$router.history.current.path
let reference = this.createReferenceTag(this.$props.title)

await this.$copyText(`https://webgems.io${currentPath}?card=${reference}`)
this.$router.push(`${currentPath}?card=${reference}`)
} catch (e) {
console.error(e);
}
},
createReferenceTag(tag){
return tag.replace(/ /g, '').toLowerCase()
},
checkReference(){
const query = this.$route.query.card
const title = this.createReferenceTag(this.$props.title)

this.active = title === query
? 'card--active'
: ''
},
},
mounted() {
this.checkReference();
},
watch: {
'$route': function() {
this.checkReference();
}
}
props: ['resource', 'isActive', 'createCopyUrl'],
}
</script>


<style lang="scss" scoped>
.cardActive {
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of doing .cardActive we could continue with sass and do:

&Active {
    box-shadow:inset 0px 0px 0px 3px #08e5ff;
}

I'd prefer it that way, to keep a consistent structure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

box-shadow:inset 0px 0px 0px 3px #08e5ff;
}

.card {
background: #2D3748;
border-radius: .3rem;
Expand All @@ -62,10 +29,6 @@ export default {
flex-direction: column;
position: relative;

&--active {
box-shadow:inset 0px 0px 0px 3px #08e5ff;
}

&--reference {
cursor: pointer;
}
Expand Down
40 changes: 38 additions & 2 deletions components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,34 @@
template(v-for='category in categories')
//- nuxt-link(:to='$i18n.path(category.slug)') {{ category.title }}
nuxt-link(:to='category.slug') {{ category.title }}
div(class="toggleWrapper" @click="toggleCardsShown")
div(class="viewToggle" :class="{active: cardsShown}") Cards
div(class="viewToggle" :class="{active: !cardsShown}") Table
</template>

<script>
import { mapMutations } from "vuex";

export default {
data() {
return {
categories: [{ slug: '', title: '' }],
Copy link
Owner

Choose a reason for hiding this comment

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

Well i guess we should define now if single or double quotes - the codebase is already mixed with both.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Think we should do this when we implement Prettier, I think I want to do this as the next thing.

categories: [{ slug: "", title: "" }]
};
},
computed: {
cardsShown() {
return this.$store.getters['Sidebar/isCardsShown']
}
},
created() {
this.categories = this.$store.getters['data/resources'].map(({ title, slug }) => ({ title, slug }))
},
methods: {
...mapMutations({
toggleCardsShown: "Sidebar/toggleCardsShown"
})
}
}
};
</script>

<style lang="scss" scoped>
Expand All @@ -29,6 +44,27 @@ export default {
padding: 0.5rem 1rem 0.5rem 1rem;
font-weight: 600;
}
div {
cursor: pointer;
}
.toggleWrapper {
display: grid;
grid-template-columns: 1fr 1fr;
width: min-content;
border: 3px;
border-color: #08e5ff;
border-style: solid;
border-radius: 0.5rem;
overflow: hidden;
}
.viewToggle {
padding: 0 0.2rem;
color: #008190;
}
.active {
background-color: #08e5ff;
color: #232331;
}
}

@media (max-width: 400px) {
Expand Down
38 changes: 38 additions & 0 deletions components/TableHead.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template lang="pug">
tr.tableHead
th.tableHead--title {{title}}
Copy link
Owner

Choose a reason for hiding this comment

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

Due to this, i realised myself that we apply BEM wrong? Did i always do that :D ?

It's .block__element--modifier 🤔 And I guess I also did .block--element___modifier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess? I haven't touched CSS at all, I'll leave the BEM changes up to you

th.tableHead--description {{desc}}
th.tableHead--links {{url}}
</template>

<script>
export default {
props: ["title", "desc", "url"],
};
</script>


<style lang="scss" scoped>
.tableHead {
background: #2d3748;
padding: 0.25rem;
transition: 0.2s ease-in-out;
width: 1fr;
display: grid;
grid-template-columns: minmax(150px, 2fr) 8fr 125px;

&--title {
color: #008190;
}

&--description {
color: #008190;
line-height: 1.3;
}

&--links {
cursor: pointer;
color: #008190;
}
}
</style>
82 changes: 82 additions & 0 deletions components/TableRow.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<template lang="pug">
tr.tableRow(:class="{ rowActive: isActive }")
td.tableRow--title {{resource.title}}
td.tableRow--description {{resource.desc}}
td.tableRow--links
tr
td
a.tableRow--reference(@click='createCopyUrl(resource)') Copy
td
a.tableRow--target(:href="resource.url" :target='resource.title' rel='noreferrer') Open
</template>

<script>
export default {
props: ['resource', 'isActive', 'createCopyUrl'],
};
</script>


<style lang="scss" scoped>
.rowActive {
box-shadow:inset 0px 0px 0px 3px #08e5ff;
}
.tableRow {
background: #2d3748;
padding: 0.25rem;
transition: 0.2s ease-in-out;
width: 1fr;
display: grid;
grid-template-columns: minmax(150px, 2fr) 8fr 125px;

&--title {
color: white;
}

&--description {
color: #008190;
line-height: 1.3;
margin-right: 10px;
}

&--links {
cursor: pointer;

tr {
width: 100%;
display: flex;
justify-content: space-between;
}

img {
width: 1rem;
margin-left: 0.5rem;
}

&:hover::before {
opacity: 0.5;
}
}

&--reference {
&::before {
position: absolute;
height: 0.9rem;
width: 0.9rem;
margin-left: -1.15rem;
margin-top: -0.1rem;
content: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzA4ZTVmZiI+PHBhdGggZD0iTSA0IDIgQyAzLjkwNSAyIDMuODE1NjA5NCAyLjAxNDM0MzggMy43MjQ2MDk0IDIuMDI3MzQzOCBDIDMuNDM0NjA5NCAyLjE0MzM0MzggMy4xMzk3MDMxIDIuMjU3MDkzOCAyLjg0NTcwMzEgMi4zNzEwOTM4IEMgMi4zMzQ3MDMxIDIuNzMzMDkzOCAyIDMuMzI2IDIgNCBMIDIgMTggTCA0IDE4IEwgNCA0IEwgMTggNCBMIDE4IDIgTCA0IDIgeiBNIDggNiBDIDYuODk1IDYgNiA2Ljg5NSA2IDggTCA2IDIwIEMgNiAyMS4xMDUgNi44OTUgMjIgOCAyMiBMIDIwIDIyIEMgMjEuMTA1IDIyIDIyIDIxLjEwNSAyMiAyMCBMIDIyIDggQyAyMiA2Ljg5NSAyMS4xMDUgNiAyMCA2IEwgOCA2IHogTSAxNyA4LjA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kwNjIgMTYuMjMyIDguMDAxOTUzMSAxNyA4LjAwMTk1MzEgeiBNIDEyLjM3MzA0NyAxNC4yMTI4OTEgTCAxMC4yOTI5NjkgMTYuMjkyOTY5IEMgMTAuMTAzOTY5IDE2LjQ4MTk2OSAxMCAxNi43MzMgMTAgMTcgQyAxMCAxNy4yNjcgMTAuMTAzOTY5IDE3LjUxODAzMSAxMC4yOTI5NjkgMTcuNzA3MDMxIEMgMTAuNjcxOTY5IDE4LjA4NjAzMSAxMS4zMjgwMzEgMTguMDg1MDMxIDExLjcwNzAzMSAxNy43MDcwMzEgTCAxMy43ODcxMDkgMTUuNjI2OTUzIEwgMTIuMzczMDQ3IDE0LjIxMjg5MSB6IiBmaWxsPSIjMDhlNWZmIi8+PC9zdmc+Cg==");
}
}
&--target {
&::before {
position: absolute;
height: 0.9rem;
width: 0.9rem;
margin-left: -1.15rem;
margin-top: -0.1rem;
content: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzA4ZTVmZiI+PHBhdGggc3R5bGU9ImxpbmUtaGVpZ2h0Om5vcm1hbDt0ZXh0LWluZGVudDowO3RleHQtYWxpZ246c3RhcnQ7dGV4dC1kZWNvcmF0aW9uLWxpbmU6bm9uZTt0ZXh0LWRlY29yYXRpb24tc3R5bGU6c29saWQ7dGV4dC1kZWNvcmF0aW9uLWNvbG9yOiMwMDA7dGV4dC10cmFuc2Zvcm06bm9uZTtibG9jay1wcm9ncmVzc2lvbjp0Yjtpc29sYXRpb246YXV0bzttaXgtYmxlbmQtbW9kZTpub3JtYWwiIGQ9Ik0gNSAzIEMgMy45MDY5MzcyIDMgMyAzLjkwNjkzNzIgMyA1IEwgMyAxOSBDIDMgMjAuMDkzMDYzIDMuOTA2OTM3MiAyMSA1IDIxIEwgMTkgMjEgQyAyMC4wOTMwNjMgMjEgMjEgMjAuMDkzMDYzIDIxIDE5IEwgMjEgMTIgTCAxOSAxMiBMIDE5IDE5IEwgNSAxOSBMIDUgNSBMIDEyIDUgTCAxMiAzIEwgNSAzIHogTSAxNCAzIEwgMTQgNSBMIDE3LjU4NTkzOCA1IEwgOC4yOTI5Njg4IDE0LjI5Mjk2OSBMIDkuNzA3MDMxMiAxNS43MDcwMzEgTCAxOSA2LjQxNDA2MjUgTCAxOSAxMCBMIDIxIDEwIEwgMjEgMyBMIDE0IDMgeiIgZm9udC13ZWlnaHQ9IjQwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIHdoaXRlLXNwYWNlPSJub3JtYWwiIG92ZXJmbG93PSJ2aXNpYmxlIiBmaWxsPSIjMDhlNWZmIi8+PC9zdmc+Cg==");
}
}
}
</style>
55 changes: 17 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading