From fa136f536fd849eee6a92dea62c449a4cf60bfdf Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 27 Dec 2020 10:35:16 -0600 Subject: [PATCH] Add more video rows --- pages/benchmarks.vue | 101 ++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/pages/benchmarks.vue b/pages/benchmarks.vue index d9efe32..22984c2 100644 --- a/pages/benchmarks.vue +++ b/pages/benchmarks.vue @@ -1,6 +1,6 @@ @@ -125,18 +87,58 @@ export default { }, data: function () { return { - benchmarkVideos: [], - performanceVideos: [], videoRows: { - benchmarks: { + 'video-benchmarks': { + heading: 'Video Editing Benchmarks', + matchesCondition: video => { + return video.tags.includes('benchmark') && video.tags.includes('video-and-motion-tools') + }, + videos: [] + }, + 'music-and-audio-tools': { + heading: 'Music and DAW Performance', + matchesCondition: video => { + return video.tags.includes('music-and-audio-tools') + }, + videos: [] + }, + // 'science-and-research-software': { + // heading: 'Science and Research', + // matchesCondition: video => { + // return video.tags.includes('science-and-research-software') + // }, + // videos: [] + // }, + 'photo-and-graphic-tools': { + heading: 'Photography and Design Compatibility', + matchesCondition: video => { + return video.tags.includes('photo-and-graphic-tools') + }, + videos: [] + }, + 'games': { + heading: 'Gaming Benchmarks', + matchesCondition: video => { + return video.tags.includes('benchmark') && video.tags.includes('games') + }, + videos: [] + }, + 'benchmarks': { heading: 'Benchmark Videos', matchesCondition: video => video.tags.includes('benchmark'), videos: [] }, - performance: { + 'performance': { heading: 'Performance Videos', matchesCondition: video => video.tags.includes('performance'), videos: [] + }, + + 'other': { + heading: 'More Videos', + // Always true + matchesCondition: () => true, + videos: [] } } } @@ -156,17 +158,6 @@ export default { }, created () { - // const videoRows = [ - // { - // name: 'benchmarks', - // matchesCondition: video => video.tags.includes('benchmark') - // }, - // { - // name: 'performance', - // matchesCondition: video => video.tags.includes('performance') - // } - // ] - // Move videos to relevant categories this.allVideos.forEach((video, index) => { // console.log('video.name', video.name) @@ -185,6 +176,8 @@ export default { }) + console.log('lengths', Object.values(this.videoRows).map(row => [row.heading, row.videos.length])) + }, head() { return {