Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

style: fix header styles mobile

Christian Fei063a9997a4f7
diff --git a/client/components/search-videos.js b/client/components/search-videos.js
index 26a8360..52c9fe1 100644
--- a/client/components/search-videos.js
+++ b/client/components/search-videos.js
@@ -20,7 +20,7 @@ class SearchVideos extends HTMLElement {
this.querySelector('input').removeEventListener('keyup', this.searchHandler.bind(this))
}
render () {
- this.innerHTML = /*html*/`<input type="search" incremental="incremental" id="search" class="p-v" placeholder="πŸ” Search videos or paste video url" autofocus>`
+ this.innerHTML = /*html*/`<input type="search" incremental="incremental" id="search" placeholder="πŸ” Search videos or paste video url" autofocus>`
}
searchHandler (event) {
event.preventDefault()
diff --git a/client/index.html b/client/index.html
index e0e53fd..7dddecb 100644
--- a/client/index.html
+++ b/client/index.html
@@ -11,8 +11,8 @@
<header>
<div class="flex space-between p-1">
<a id="home-link" class="hide p-v" href="/">go back home</a></h1>
- <div class="flex-1 p-v"></div>
- <search-videos></search-videos>
+ <div class="flex-1 p-v header-spacer"></div>
+ <search-videos class="p-v"></search-videos>
<div class="flex-1 tar p-v">
<a href="/settings">Settings</a>
<a tabindex="-1" href="https://github.com/christian-fei/my-yt" target="_blank">πŸ“–</a>
diff --git a/client/lib/router.js b/client/lib/router.js
index 21d62bc..c5c82f6 100644
--- a/client/lib/router.js
+++ b/client/lib/router.js
@@ -15,8 +15,8 @@ const routes = {
document.querySelector('video-filters').style.display = ''
}
- document.getElementById('search').removeAttribute('disabled')
- document.getElementById('search').classList.remove('hide')
+ document.querySelector('search-videos #search').removeAttribute('disabled', 'disabled')
+ document.querySelector('search-videos').classList.remove('hide')
$videosContainer.innerHTML = ''
const ignoredTerms = store.get(store.ignoreTermsKey)
@@ -44,8 +44,8 @@ const routes = {
document.getElementById('home-link').classList.remove('hide')
- document.getElementById('search').setAttribute('disabled', 'disabled')
- document.getElementById('search').classList.add('hide')
+ document.querySelector('search-videos #search').setAttribute('disabled', 'disabled')
+ document.querySelector('search-videos').classList.add('hide')
const $showThumbnails = document.getElementById('show-thumbnails')
store.get(store.showThumbnailsKey) ? $showThumbnails.setAttribute('checked', 'true') : $showThumbnails.removeAttribute('checked')
@@ -71,8 +71,8 @@ const routes = {
})
} },
'/404': { template: document.getElementById('not-found-template'), async initialize () {
- document.getElementById('search').setAttribute('disabled', 'disabled')
- document.getElementById('search').classList.add('hide')
+ document.querySelector('search-videos #search').setAttribute('disabled', 'disabled')
+ document.querySelector('search-videos').classList.add('hide')
} }
}
diff --git a/client/main.css b/client/main.css
index 836b323..521e3b0 100644
--- a/client/main.css
+++ b/client/main.css
@@ -353,6 +353,11 @@ search-videos {
padding: 0 .5rem;
}
+@media all and (max-width: 50em) {
+ .header-spacer {
+ display: none;
+ }
+}
details {