From e5394d6ea02ad1324a1157965c49ed80ac0a35ca Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 22 Nov 2020 10:05:01 +0530 Subject: [PATCH] Responsive grid in Channel. --- src/components/Channel.vue | 42 +++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/components/Channel.vue b/src/components/Channel.vue index 2ba933ae..3797ad4f 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -3,27 +3,38 @@

{{ channel.name }}

- +


-
+
{{ item.title }}
- {{ timeFormat(item.duration) }} +
+ + {{ timeFormat(item.duration) }} + + + + {{ item.views }} views + +
@@ -56,23 +67,8 @@ export default { .then(data => (this.channel = data)) .then(() => (document.title = this.channel.name + " - Piped")); }, - timeFormat(duration) { - var pad = function(num, size) { - return ("000" + num).slice(size * -1); - }; - - var time = parseFloat(duration).toFixed(3), - hours = Math.floor(time / 60 / 60), - minutes = Math.floor(time / 60) % 60, - seconds = Math.floor(time - minutes * 60); - - var str = ""; - - if (hours > 0) str += pad(hours, 2) + ":"; - - str += pad(minutes, 2) + ":" + pad(seconds, 2); - - return str; + timeFormat(d) { + return require("@/utils/TimeUtils.js").default.timeFormat(d); } } };