Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Fix app layout issues #1257

Merged
merged 47 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c2fe971
Fix app layout issues
zackkrida Apr 11, 2022
3be1239
Fix sidebar height class
zackkrida Apr 11, 2022
40b83b9
Fix app layout issues
zackkrida Apr 11, 2022
0c10b27
Fix sidebar height class
zackkrida Apr 11, 2022
23b992f
Merge branch 'main' into really_fix_load_more
obulat Apr 14, 2022
b32edcf
Merge branch 'layout-fixes' of github.com:WordPress/openverse-fronten…
zackkrida Apr 14, 2022
03251a4
merge main
zackkrida Apr 14, 2022
0cb7d57
Cleanup for rtl and remove horizontal scrollbar
zackkrida Apr 14, 2022
087bea5
Window scroll detection and proper input width
zackkrida Apr 14, 2022
e34a05b
Fix search count alignment
zackkrida Apr 14, 2022
172d552
Complement to app layout issues (#1312)
krysal Apr 24, 2022
f85cf1e
Standardize sidebar with in CSS var; make filter sidebar border condi…
zackkrida Apr 24, 2022
cac0c0d
Make banner styles more consistient on mobile
zackkrida Apr 24, 2022
aa58a33
Reduce height of desktop translation bar
zackkrida Apr 24, 2022
75a32d6
Merge
zackkrida Apr 24, 2022
7d47472
Delete unused VNoticeBar
zackkrida Apr 24, 2022
843b6f4
Remove hardcoded leading for search result title
zackkrida Apr 24, 2022
0780ea1
Add POT file
obulat Apr 26, 2022
6e205de
Remove z-index from BackToSearchResultsLink
obulat Apr 26, 2022
22f5917
Merge branch 'main' into layout-fixes
obulat May 2, 2022
5c5033b
Add POT file
obulat May 2, 2022
4795035
Use css variable to set header height
obulat May 2, 2022
0510040
Merge branch 'main' into layout-fixes
obulat May 4, 2022
8969bf6
Update visual regression testing snapshots
obulat May 4, 2022
d36dc66
Remove header twitch and size change on scroll
zackkrida May 9, 2022
bb77591
Keep header height consistient
zackkrida May 9, 2022
a14144f
z-index cleanup
zackkrida May 9, 2022
2788ad0
Fix body scroll lock for mobile filters
zackkrida May 9, 2022
3e37bfd
merge main
zackkrida May 9, 2022
65b2300
Add an updated pot file
zackkrida May 9, 2022
64e2ec7
Remove logs
zackkrida May 10, 2022
30bf3da
Stop SearchBar SearchButton from shrinking
obulat May 10, 2022
880f216
Remove unused classes and simplify applying common classes
obulat May 10, 2022
45cdde5
Set main width to `w-screen` to prevent it from overflowing on xs scr…
obulat May 10, 2022
189beef
Update mobile header paddings (make them smaller)
obulat May 10, 2022
40d7614
Extract `dismissTranslationBanner` util function
obulat May 10, 2022
dd28c44
Update snapshots
obulat May 10, 2022
fab148c
Update POT file
obulat May 10, 2022
ca3198a
Update snapshots
obulat May 10, 2022
91094d2
Revert updates to xs media reuse snapshot
obulat May 10, 2022
2cb96db
Remove unnecessary header-height CSS variable
obulat May 10, 2022
c61aa76
Switch the "main" element to w-full instead of w-screen
zackkrida May 10, 2022
3bb8f23
Use viewport width on mobile; switch to full-width above
zackkrida May 10, 2022
c0599cd
Fix related image width
zackkrida May 10, 2022
f0359e3
Merge branch 'main' into layout-fixes
zackkrida May 10, 2022
3221063
Merge main
zackkrida May 10, 2022
cf4044e
.pot file update
zackkrida May 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/VAudioTrack/VWaveform.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<!-- Focus bar -->
<div
v-if="isInteractive"
class="focus-indicator hidden absolute z-30 top-0 flex flex-col items-center justify-between bg-black h-full"
class="focus-indicator hidden absolute z-20 top-0 flex flex-col items-center justify-between bg-black h-full"
:style="{ width: `${barWidth}px`, left: `${progressBarWidth}px` }"
>
<div
Expand Down
13 changes: 1 addition & 12 deletions src/components/VFilters/VSearchGridFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<section
id="filters"
aria-labelledby="filters-heading"
class="filters py-8 px-10 min-h-full md:bg-dark-charcoal-06"
class="filters py-8 px-10"
>
<div class="flex items-center justify-between mt-2 mb-6">
<h4 id="filters-heading" class="text-sr font-semibold py-2 uppercase">
Expand Down Expand Up @@ -109,14 +109,3 @@ export default {
},
}
</script>
<style scoped>
.filters {
border-inline-start: 1px solid transparent;
}
@screen md {
.filters {
/* dark-charcoal-20*/
border-inline-start: 1px solid #d6d4d5;
}
}
</style>
15 changes: 5 additions & 10 deletions src/components/VHeader/VHeader.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<template>
<header
class="main-header flex px-4 md:px-7 items-center md:items-stretch z-40 w-screen bg-white gap-x-2 gap-y-4"
class="main-header flex px-4 py-3 md:py-4 md:px-7 items-center md:items-stretch z-30 w-full bg-white justify-between gap-x-2 gap-y-4"
:class="{
'py-3 ': isHeaderScrolled,
'py-4 flex-wrap md:flex-nowrap': !isHeaderScrolled,
'flex-wrap md:flex-nowrap': !isHeaderScrolled,
'border-b border-white': !isHeaderScrolled && !isMenuOpen,
'border-b border-dark-charcoal-20':
isSearchRoute && (isHeaderScrolled || isMenuOpen),
'justify-between': isSearchRoute,
'justify-between md:justify-start': !isSearchRoute,
'md:justify-start': !isSearchRoute,
'flex-nowrap': !isSearchRoute && isHeaderScrolled,
}"
>
Expand All @@ -24,13 +22,12 @@
:size="isMinScreenMd ? 'medium' : isHeaderScrolled ? 'small' : 'large'"
:class="{
'order-4 md:order-none w-full md:w-auto': !isHeaderScrolled,
'search-bar-mobile-scrolled': isSearchRoute && isHeaderScrolled,
}"
@submit="handleSearch"
>
<span
v-show="searchStatus"
class="hidden lg:block info font-semibold text-xs text-dark-charcoal-70 group-hover:text-dark-charcoal group-focus:text-dark-charcoal mx-4"
class="hidden lg:block info font-semibold text-xs text-dark-charcoal-70 group-hover:text-dark-charcoal group-focus:text-dark-charcoal mx-4 whitespace-nowrap"
>
{{ searchStatus }}
</span>
Expand Down Expand Up @@ -81,7 +78,7 @@ const menus = {
CONTENT_SWITCHER: 'content-switcher',
}

const VHeader = defineComponent({
export default defineComponent({
name: 'VHeader',
components: {
VLogoButton,
Expand Down Expand Up @@ -231,6 +228,4 @@ const VHeader = defineComponent({
}
},
})

export default VHeader
</script>
9 changes: 6 additions & 3 deletions src/components/VHeader/VHeaderFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,22 @@ export default {
watch([visibleRef], ([visible]) => {
triggerA11yProps['aria-expanded'] = visible
filterSidebar.setVisibility(visible)
if (!isMinScreenMd) {
visible ? lock() : unlock()
}
})

const open = () => {
visibleRef.value = true
emit('open')
if (!isMinScreenMd.value) {
lock()
}
}

const close = () => {
visibleRef.value = false
emit('close')
if (!isMinScreenMd.value) {
unlock()
}
}

const onTriggerClick = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/VHeader/VSearchBar/VSearchButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:aria-label="$t('search.search')"
size="disabled"
:variant="isIcon ? 'plain' : 'primary'"
class="transition-none inline-block rounded-s-none font-semibold text-2xl hover:text-white group-hover:text-white group-hover:border-pink hover:bg-pink group-hover:bg-pink focus-visible:ring focus-visible:ring-pink"
class="transition-none flex-shrink-0 rounded-s-none font-semibold text-2xl hover:text-white group-hover:text-white group-hover:border-pink hover:bg-pink group-hover:bg-pink focus-visible:ring focus-visible:ring-pink"
:class="[
isIcon
? 'search-button focus-visible:bg-pink focus-visible:text-white p-[0.5px] ps-[1.5px]'
Expand Down
6 changes: 3 additions & 3 deletions src/components/VHeader/VSidebarContent.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<VTeleport v-if="visible" :to="to"
><VSearchGridFilter @close="$emit('close')"
/></VTeleport>
<VTeleport v-if="visible" :to="to">
krysal marked this conversation as resolved.
Show resolved Hide resolved
<VSearchGridFilter @close="$emit('close')" />
</VTeleport>
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/VInputField/VInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:id="fieldId"
v-bind="$attrs"
:type="type"
class="flex-1 leading-none font-semibold bg-tx placeholder-dark-charcoal-70 ms-4 h-full appearance-none rounded-none focus:outline-none text-2xl md:text-base"
class="w-full leading-none font-semibold bg-tx placeholder-dark-charcoal-70 ms-4 h-full appearance-none rounded-none focus:outline-none text-2xl md:text-base"
:value="modelValue"
:aria-label="labelText"
@input="updateModelValue"
Expand Down
3 changes: 2 additions & 1 deletion src/components/VMigrationNotice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
<VLink
class="text-white font-bold underline"
href="https://wordpress.org/news/2021/05/welcome-to-openverse/"
>{{ $t('migration-notice.read') }}</VLink
>
{{ $t('migration-notice.read') }}
</VLink>
</template>
</i18n>
</VNotificationBanner>
Expand Down
2 changes: 1 addition & 1 deletion src/components/VModal/VModalContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Prevent FocusTrap from trying to focus the first element. We already do that in a more flexible, adaptive way in our Dialog composables. -->
<FocusTrap :initial-focus="() => false">
<div
class="flex justify-center z-10 fixed inset-0 bg-dark-charcoal bg-opacity-75 min-h-screen overflow-y-auto"
class="flex justify-center z-40 fixed inset-0 bg-dark-charcoal bg-opacity-75 min-h-screen overflow-y-auto"
>
<div
ref="dialogRef"
Expand Down
18 changes: 0 additions & 18 deletions src/components/VNoticeBar/VNoticeBar.vue

This file was deleted.

36 changes: 0 additions & 36 deletions src/components/VNoticeBar/meta/VNoticeBar.stories.mdx

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/VNotificationBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:class="$style[variant]"
:data-testid="`banner-${id}`"
>
<p class="text-left">
<p class="leading-tight md:leading-normal text-sr md:text-base text-left">
<slot name="default" />
</p>
<div class="flex">
Expand Down Expand Up @@ -87,5 +87,6 @@ export default defineComponent({

.announcement {
@apply bg-trans-blue text-white;
border-left: 0.25rem solid transparent;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this keeps the text aligned when both banners are present.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just occurred to me upon reviewing this change that the banner border should probably be fixed to have RTL support. Opened a small issue for it here: https://github.com/WordPress/openverse-frontend/issues/1319

}
</style>
21 changes: 8 additions & 13 deletions src/components/VScrollButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,24 @@
</template>

<script>
import { computed } from '@nuxtjs/composition-api'
import { computed, defineComponent } from '@nuxtjs/composition-api'

import { useFilterSidebarVisibility } from '~/composables/use-filter-sidebar-visibility'

const positionWithoutSidebar = 'ltr:right-4 rtl:left-4'
const positionWithSidebar = 'ltr:right-[21rem] rtl:left-[21rem]'
export default {

export default defineComponent({
name: 'VScrollButton',
setup() {
const { isVisible: isFilterVisible } = useFilterSidebarVisibility()
const hClass = computed(() =>
isFilterVisible.value ? positionWithSidebar : positionWithoutSidebar
)
return { hClass, isFilterVisible }
},
methods: {
scrollToTop() {
this.$el.parentElement.scrollTo({
top: 0,
left: 0,
behavior: 'smooth',
})
},
const scrollToTop = () => {
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
}
return { hClass, isFilterVisible, scrollToTop }
},
}
})
</script>
7 changes: 2 additions & 5 deletions src/components/VSearchGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
>
<header
v-if="query.q && supported"
class="mt-4"
class="mt-5"
:class="isAllView ? 'mb-10' : 'mb-8'"
>
<VSearchResultsTitle
class="leading-10"
:size="isAllView ? 'large' : 'default'"
>
<VSearchResultsTitle :size="isAllView ? 'large' : 'default'">
{{ query.q }}
</VSearchResultsTitle>
</header>
Expand Down
8 changes: 4 additions & 4 deletions src/composables/use-window-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useEventListener } from '~/composables/use-event-listener'
*
* @type {import('@nuxtjs/composition-api').Ref<boolean>}
*/
const isWindowScrolled = ref(false)
const isScrolled = ref(false)

/**
*
Expand All @@ -30,7 +30,7 @@ export function useWindowScroll({
return {
x: ref(0),
y: ref(0),
isWindowScrolled,
isScrolled,
}
}

Expand All @@ -40,7 +40,7 @@ export function useWindowScroll({
const scrollHandler = () => {
x.value = window.pageXOffset
y.value = window.pageYOffset
isWindowScrolled.value = y.value > 0
isScrolled.value = y.value > 0
}

const handler = throttleMs
Expand All @@ -52,5 +52,5 @@ export function useWindowScroll({
passive: true,
})

return { x, y, isWindowScrolled }
return { x, y, isScrolled }
}
Loading