Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

dark mode, sticky header

Christian Feic7bcd756bce6
diff --git a/client/index.html b/client/index.html
index 1114fb8..e26ccfd 100644
--- a/client/index.html
+++ b/client/index.html
@@ -11,10 +11,9 @@
<header>
<h1 class="">My-YT</h1>
<search-videos></search-videos>
+ <button id="open-settings">🔧 Settings</button>
</header>
- <button id="open-settings">🔧 Settings</button>
-
<main>
<channels-list></channels-list>
<details class="downloaded-videos-container">
diff --git a/client/main.css b/client/main.css
index b62e985..0c8e9ae 100644
--- a/client/main.css
+++ b/client/main.css
@@ -1,4 +1,9 @@
-/* dark mode */
+body {
+ font-family: Arial, sans-serif;
+ margin: 20px;
+ background-color: white;
+ color: black;
+}
@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
@@ -10,11 +15,6 @@
}
}
-
-body {
- font-family: Arial, sans-serif;
- margin: 20px;
-}
form {
margin-bottom: 20px;
}
@@ -142,15 +142,14 @@ form {
#open-settings {
- position: fixed;
- top: 0;
- right: 0;
display: block;
- background: white;
- border: 1px solid lightgrey;
border-radius: 4px;
font-size: 1rem;
padding: 0.5rem;
+ background-color: transparent;
+ color: inherit;
+ border: none;
+ outline: none;
}
#settings {
position: relative;
@@ -187,15 +186,29 @@ dialog {
body > header {
+ position: sticky;
+ top: 0;
+ z-index: 1000;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
padding: 1em 0.5em;
margin-bottom: 3rem;
overflow: hidden;
+ background-color: inherit;
+ /* box-shadow on the bottom border */
+ box-shadow: 0px 5px 10px rgba(119, 118, 118, 0.2);
+}
+
+search-videos {
+ flex: 2;
}
#search {
display: block;
margin: 0 auto;
width: 90%;
+ flex: 2;
padding: 1em;
font-size: 1.1rem;
}
@@ -206,22 +219,6 @@ details {
border-radius: 3px;
}
-details {
- transition: 0.2s background linear;
-}
-
-details:hover {
- /* background: #eaeaea; */
-}
-
-details > summary {
- transition: color 1s;
-}
-
-details[open] > summary {
- color: #171717;
-}
-
#summary pre {
white-space: break-spaces;
}