Today style fix

This commit is contained in:
2020-08-22 02:30:21 +05:00
parent 03f3465799
commit de2c54b9c0

View File

@@ -1,98 +1,45 @@
<template> <template>
<div> <div class="container mx-auto mb-5 border-b">
<div class="py-6 flex justify-center lg:justify-end md:justify-end"> <div>
<h3 <h2 class="text-gray-800 text-3xl text-right mt-3 mb-2 MvAamu"
class="text-gray-800 text-3xl MvAamu" style="font-weight: 100;"
style="direction: rtl; font-weight: 100;"
>
މިއަދުގެ ޙުލާސާ
</h3>
</div>
<!-- featured section -->
<div
class="flex flex-wrap md:flex-no-wrap space-x-0 md:space-x-6 mb-5 border-b"
>
<!-- sub-main posts -->
<div class="md:w-4/7">
<div v-for="subarticle in subarticles" :key="subarticle.id">
<a
:href="'/article/' + subarticle.id"
class="rounded w-full flex flex-col md:flex-row mb-10"
> >
<div class="bg-white rounded px-4"> މިއަދުގެ ޚުލާޞާ
<div </h2>
class="md:mt-0 text-gray-800 font-semibold text-xl xl:text-md lg:text-md mb-2 text-right leading-8 sm:leading-9 md:leading-9 MvTyper hover:underline" </div>
v-text="subarticle.title"
style="direction:rtl;"
></div>
<div class="flex justify-end items-center"> <div class="flex md:-mx-4 flex-wrap md:px-0 flex-row-reverse">
<div> <div class="w-full md:w-1/2 px-4 py-4">
<p <div>
class="font-semibold text-gray-700 text-sm capitalize MvTyper" <img :src="article.featured_image" class="rounded" />
v-text="subarticle.source.name"
></p>
</div>
<img
:src="subarticle.source.logo"
class="h-10 w-10 rounded-full ml-1 object-cover"
/>
</div>
<div
class="text-gray-600 text-md mt-1 flex justify-end items-center"
>
<p
class="text-gray-600 text-sm text-right mb-2 MvTyper"
style="direction:rtl;"
>
{{
subarticle.published_date | dhivehiDate
}}
</p>
</div>
<p
class="block md:hidden p-2 pl-0 pt-1 text-sm text-gray-600 MvTyper"
style="direction:rtl;"
v-text="subarticle.body[0]"
></p>
</div>
<img
:src="subarticle.featured_image"
class="block md:hidden lg:block rounded-md h-64 md:h-32 m-4 md:m-0"
/>
</a>
</div> </div>
</div> <div class="flex flex-col justify-end">
<a
<!-- main post --> :href="'/article/' + article.id"
<div class="text-2xl md:text-3xl lg:text-3xl leading-11 text-gray-700 pb-4 pt-4 MvTyper font-semibold hover:underline"
class="mb-4 lg:mb-0 p-4 lg:p-0 w-full md:w-4/7 relative rounded block"
v-if="article"
>
<a :href="'/article/' + article.id">
<img
:src="article.featured_image"
class="rounded-md object-cover w-full h-3/4"
/>
</a>
<a :href="'/article/' + article.id">
<h1
class="text-gray-800 text-xl xl:text-md lg:text-md font-bold mt-2 mb-2 leading-9 hover:underline text-right MvTyper"
style="direction:rtl;" style="direction:rtl;"
v-text="article.title" v-text="article.title"
></h1> ></a>
</a> <p
class="ml-1 mb-4 text-gray-600 text-right MvTyper"
style="direction:rtl;"
>
{{ article.body[0].slice(0,200) }}...
</p>
</div>
<div class="flex justify-end items-center"> <div class="flex justify-end items-center mt-3">
<div> <div>
<p <a
class="font-semibold text-gray-700 text-sm capitalize MvTyper" :href="'/source/' + article.source.slug"
v-text="article.source.name" class="hover:underline"
></p> >
<p
class="font-semibold text-gray-700 text-sm capitalize MvTyper"
v-text="article.source.name"
></p>
</a>
</div> </div>
<img <img
@@ -112,8 +59,91 @@
</p> </p>
</div> </div>
</div> </div>
<div class="w-full md:w-1/4">
<div class="flex md:-mx-4 flex-wrap mb-7 md:px-0 rtl">
<div
class="w-1/2 md:w-full lg:w-full px-4 md:px-8 lg:px-8 py-4"
v-for="subarticle in subarticles"
:key="subarticle.id"
>
<div class="flex justify-end">
<img
:src="subarticle.featured_image"
class="rounded"
/>
</div>
<div class="flex justify-end">
<a
:href="'/article/' + subarticle.id"
class="text-md leading-9 font-semibold py-3 text-gray-700 MvTyper"
v-text="subarticle.title"
style="direction:rtl;"
></a>
</div>
<div class="flex flex-row-reverse justify-between mt-2">
<div class="flex justify-end items-center">
<div>
<p
class="font-semibold text-gray-600 text-sm capitalize MvTyper"
v-text="subarticle.source.name"
></p>
</div>
<img
:src="subarticle.source.logo"
class="h-8 w-8 rounded-full ml-1 object-cover"
/>
</div>
</div>
</div>
</div>
</div>
<div class="w-full md:w-1/4 px-4 py-4">
<ul
style="list-style: none; float: right; padding: 0px;"
class="mt-8 sm:mt-8 md:mt-0 lg:mt-0"
>
<li
class="pb-8"
v-for="listarticle in listarticles"
:key="listarticle.id"
>
<div class="flex justify-end">
<a
:href="'/article/' + listarticle.id"
class="text-md leading-normal text-gray-800 pb-4 MvTyper text-right hover:underline"
style="direction:rtl;"
v-text="listarticle.title"
>
</a>
</div>
<div class="border-b mb-3"></div>
<div class="flex justify-between items-center flex-row-reverse">
<div class="flex items-end flex-col">
<a
:href="'/source/' + listarticle.source.slug"
class="hover:underline"
>
<span
class="MvTyper text-sm text-gray-600"
v-text="listarticle.source.name"
></span>
</a>
</div>
<div>
<span class="MvTyper text-sm text-gray-600">{{listarticle.published_date | dhivehiDate}}</span>
</div>
</div>
</li>
</ul>
</div>
</div> </div>
<!-- end featured section -->
</div> </div>
</template> </template>
@@ -124,8 +154,9 @@ export default {
name: "todays-pick", name: "todays-pick",
data() { data() {
return { return {
article: null, article: [],
subarticles: [] subarticles: [],
listarticles: []
}; };
}, },
@@ -142,7 +173,8 @@ export default {
.get("api/today") .get("api/today")
.then(response => { .then(response => {
this.article = response.data[0]; this.article = response.data[0];
this.subarticles = response.data.slice(1, 5); this.subarticles = response.data.slice(1, 3);
this.listarticles = response.data.slice(3, 7);
}) })
.catch(error => { .catch(error => {
console.log(error); console.log(error);