From 6cec662ec4ac4c77ba997ab569a970efb7a8af16 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 5 May 2021 19:05:19 +0900 Subject: [PATCH] Improve ad --- src/client/components/date-separated-list.vue | 2 +- src/client/components/global/ad.vue | 14 ++++++++++++-- src/client/pages/gallery/post.vue | 2 +- src/client/pages/instance/ads.vue | 1 + src/client/pages/page.vue | 2 +- src/client/ui/default.widgets.vue | 4 ++-- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/client/components/date-separated-list.vue b/src/client/components/date-separated-list.vue index 9636ee053c..34085cc070 100644 --- a/src/client/components/date-separated-list.vue +++ b/src/client/components/date-separated-list.vue @@ -92,7 +92,7 @@ export default defineComponent({ return [h(MkAd, { class: 'a', // advertiseの意(ブロッカー対策) key: item.id + ':ad', - prefer: 'horizontal', + prefer: ['horizontal', 'horizontal-big'], }), el]; } else { return el; diff --git a/src/client/components/global/ad.vue b/src/client/components/global/ad.vue index ee2a7ebe92..f88a1d2026 100644 --- a/src/client/components/global/ad.vue +++ b/src/client/components/global/ad.vue @@ -30,7 +30,7 @@ export default defineComponent({ props: { prefer: { - type: String, + type: Array, required: true }, specify: { @@ -50,7 +50,7 @@ export default defineComponent({ if (props.specify) { ad = props.specify; } else { - let ads = instance.ads.filter(ad => ad.place === props.prefer); + let ads = instance.ads.filter(ad => props.prefer.includes(ad.place)); if (ads.length === 0) { ads = instance.ads.filter(ad => ad.place === 'square'); @@ -130,6 +130,16 @@ export default defineComponent({ } } + &.horizontal-big { + padding: 8px; + + > a , + > a > img { + max-width: min(600px, 100%); + max-height: 250px; + } + } + &.vertical { > a , > a > img { diff --git a/src/client/pages/gallery/post.vue b/src/client/pages/gallery/post.vue index 50f81376ec..dbac003e38 100644 --- a/src/client/pages/gallery/post.vue +++ b/src/client/pages/gallery/post.vue @@ -33,7 +33,7 @@ - + diff --git a/src/client/pages/instance/ads.vue b/src/client/pages/instance/ads.vue index ee7114f91c..20747d6f9c 100644 --- a/src/client/pages/instance/ads.vue +++ b/src/client/pages/instance/ads.vue @@ -13,6 +13,7 @@
square horizontal + horizontal-big
{{ $ts.priority }} diff --git a/src/client/pages/page.vue b/src/client/pages/page.vue index 4e237c2186..47a458df9c 100644 --- a/src/client/pages/page.vue +++ b/src/client/pages/page.vue @@ -45,7 +45,7 @@
{{ $ts.createdAt }}:
{{ $ts.updatedAt }}:
- + diff --git a/src/client/ui/default.widgets.vue b/src/client/ui/default.widgets.vue index c475e4272c..cf5d1e07ce 100644 --- a/src/client/ui/default.widgets.vue +++ b/src/client/ui/default.widgets.vue @@ -1,7 +1,7 @@