Compare commits

..

2 Commits

Author SHA1 Message Date
Kevin
75bb55a6a3 🎨 Simplify search.vue & minor changes 2019-11-15 18:27:34 +01:00
Kevin
5388f2fe44 🎨 Simplify toggling between views 2019-11-15 17:56:44 +01:00
11 changed files with 72 additions and 87 deletions

View File

@@ -1,5 +1,3 @@
{ {
"editor.formatOnSave": false, "editor.formatOnSave": false
"vue-i18n-ally.localesPaths": "locales",
"i18n-ally.localesPaths": "locales"
} }

View File

@@ -2,6 +2,25 @@
<html {{ HTML_ATTRS }}> <html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}> <head {{ HEAD_ATTRS }}>
{{ HEAD }} {{ HEAD }}
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.webgems.io"]);
_paq.push(["setDomains", ["*.webgems.io"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stats.lost.services/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//stats.lost.services/matomo.php?idsite=1&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
</head> </head>
<body {{ BODY_ATTRS }}> <body {{ BODY_ATTRS }}>
{{ APP }} {{ APP }}

13
components/CardsView.vue Normal file
View File

@@ -0,0 +1,13 @@
<template lang="pug">
.cards
Card(v-for='resource in resources' :resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
</template>
<script>
import Card from './Card'
export default {
components: { Card },
props: ['resources', 'createCopyUrl', 'activeCard'],
}
</script>

13
components/TableView.vue Normal file
View File

@@ -0,0 +1,13 @@
<template lang="pug">
table
TableRow(v-for='resource in resources' :resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
</template>
<script>
import TableRow from '../components/TableRow'
export default {
components: { TableRow },
props: ['resources', 'createCopyUrl', 'activeCard'],
}
</script>

View File

@@ -15,10 +15,10 @@ export default {
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }, { hid: 'description', name: 'description', content: pkg.description },
{ hid: 'keywords', name: 'keywords', content: 'css, html, php, server, resources, design, gems, nuxt, javascript, tutorials, development, software'}, { hid: 'keywords', name: 'keywords', content: 'css, html, php, server, resources, design, gems, nuxt, javascript, tutorials, development, software'},
{ name: 'robots', content: 'index, follow' }, { name: 'robots', content: 'index, follow' },
{ name: 'distribution', content: 'global'}, { name: 'distribution', content: 'global'},
{ name:'theme-color', content: '#ffffff' }, { name:'theme-color', content: '#ffffff' },
{ name: 'msapplication-TileColor', content: '#da532c' }, { name: 'msapplication-TileColor', content: '#da532c' },
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#5bbad5' }, { rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#5bbad5' },
@@ -62,10 +62,6 @@ export default {
plugins: [ plugins: [
'~/plugins/i18n.js', '~/plugins/i18n.js',
{
src: '~/plugins/vue-matomo.js',
ssr: false,
},
], ],
/* /*
** Nuxt.js modules ** Nuxt.js modules

7
package-lock.json generated
View File

@@ -1,5 +1,5 @@
{ {
"name": "webgems.io", "name": "webgems",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
@@ -13651,11 +13651,6 @@
"vue-style-loader": "^4.1.0" "vue-style-loader": "^4.1.0"
} }
}, },
"vue-matomo": {
"version": "3.12.0-5",
"resolved": "https://registry.npmjs.org/vue-matomo/-/vue-matomo-3.12.0-5.tgz",
"integrity": "sha512-n69Nmry7Eg0vooGlEMViaAbjsMGM5Hfno0G9C0o8q5aNIShzez5h2JCLRdHktC1ZdI7p4Wtg0csm++zIO+tWCQ=="
},
"vue-meta": { "vue-meta": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-1.6.0.tgz", "resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-1.6.0.tgz",

View File

@@ -17,9 +17,8 @@
"cross-env": "^5.2.0", "cross-env": "^5.2.0",
"nuxt": "^2.4.0", "nuxt": "^2.4.0",
"nuxt-clipboard2": "^0.2.1", "nuxt-clipboard2": "^0.2.1",
"vue-i18n": "^8.11.2",
"ramda": "^0.26.1", "ramda": "^0.26.1",
"vue-matomo": "^3.12.0-5" "vue-i18n": "^8.11.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.6.4", "@babel/core": "^7.6.4",

View File

@@ -3,21 +3,21 @@
transition(name="fade-title" @after-enter="afterEnter") transition(name="fade-title" @after-enter="afterEnter")
h1(v-if="showTitle") {{ category.title }} h1(v-if="showTitle") {{ category.title }}
transition(name="fade-card") transition(name="fade-card")
.cards(v-if="areCardsVisible && showCards") div(v-if="showCards")
template(v-for='resource in category.resources' ) component(
Card(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle') :is="areCardsVisible ? 'CardsView' : 'TableView'"
transition(name="fade-card") :resources="category.resources"
table(v-if="!areCardsVisible && showCards") :createCopyUrl="createCopyUrl"
template(v-for='resource in category.resources' ) :activeCard='activeCard'
TableRow(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle') )
</template> </template>
<script> <script>
import Card from '../components/Card' import CardsView from '../components/CardsView'
import TableRow from '../components/TableRow' import TableView from '../components/TableView'
export default { export default {
components: { Card, TableRow }, components: { CardsView, TableView },
data() { data() {
return { return {
categoryRouteTitle: this.$route.params.category, categoryRouteTitle: this.$route.params.category,

View File

@@ -3,26 +3,24 @@
transition(name="fade-title" @after-enter="afterEnter") transition(name="fade-title" @after-enter="afterEnter")
h1(v-if="showTitle") Search h1(v-if="showTitle") Search
transition(name="fade-card") transition(name="fade-card")
.cards(v-if="areCardsVisible && showCards") div(showCards)
template(v-if="resources.length") component(
template(v-for='resource in resources' ) v-if="resources.length"
Card(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle') :is="areCardsVisible ? 'CardsView' : 'TableView'"
p(v-else) No results :createCopyUrl="createCopyUrl"
transition(name="fade-card") :activeCard="activeCard"
table(v-if="!areCardsVisible && showCards") :resources="resources"
template(v-if="resources.length") )
template(v-for='resource in resources' )
TableRow(:resource='resource' :key='resource.title' :createCopyUrl="createCopyUrl" :isActive='activeCard === resource.cleanTitle')
p(v-else) No results p(v-else) No results
</template> </template>
<script> <script>
import Card from '../components/Card' import CardsView from '../components/CardsView'
import TableRow from '../components/TableRow' import TableView from '../components/TableView'
import * as R from 'ramda' import * as R from 'ramda'
export default { export default {
components: { Card, TableRow }, components: { CardsView, TableView },
data() { data() {
return { return {
activeCard: '', activeCard: '',

View File

@@ -1,34 +0,0 @@
import Vue from 'vue'
import VueMatomo from 'vue-matomo'
export default ({
app,
}) => {
Vue.use(VueMatomo, {
router: app.router,
// Configure your matomo server and site by providing
host: 'https://stats.lost.services',
siteId: 1,
// Changes the default .js and .php endpoint's filename
// Default: 'piwik'
trackerFileName: 'matomo',
// Enables link tracking on regular links. Note that this won't
// work for routing links (ie. internal Vue router links)
// Default: true
enableLinkTracking: true,
// Require consent before sending tracking information to matomo
// Default: false
requireConsent: false,
// Whether to track the initial page view
// Default: true
trackInitialView: true,
// Whether or not to log debug information
// Default: false
debug: false,
})
}

View File

@@ -175,18 +175,6 @@
"desc": "Messed up some of your commits? Make it undone", "desc": "Messed up some of your commits? Make it undone",
"url": "https://bokub.github.io/git-history-editor/", "url": "https://bokub.github.io/git-history-editor/",
"tags": ["import", "export", "author", "messages"] "tags": ["import", "export", "author", "messages"]
},
{
"title": "CodeSandbox.io",
"desc": "CodeSandbox is an online code editor with a focus on creating and sharing web application projects",
"url": "https://codesandbox.io/",
"tags": ["development", "ide","editor", "share", "testing"]
},
{
"title": "Postwoman.io",
"desc": "The Postwoman API request builder helps you create your requests faster, saving you precious time on your development.",
"url": "https://Postwoman.io/",
"tags": ["testing","api"]
} }
] ]
} }