improve css

This commit is contained in:
davy 2019-07-02 09:39:11 -05:00
parent c0bbabf69f
commit 1e680cef7b
2 changed files with 48 additions and 19 deletions

View file

@ -1,4 +1,9 @@
/* Normalize */ :root {
--main-title-color: #ae81ff;
--link-hover-color: #ae81ff;
}
/* normalize */
* { * {
font-weight: inherit; font-weight: inherit;
font-size: inherit; font-size: inherit;
@ -25,7 +30,7 @@ body {
nav { nav {
z-index: 100; z-index: 100;
color: #ae81ff; color: var(--main-title-color);
text-shadow: -2px 2px 3px rgba(0, 0, 0, 0.7); text-shadow: -2px 2px 3px rgba(0, 0, 0, 0.7);
font-weight: 700; font-weight: 700;
font-size: 20px; font-size: 20px;
@ -45,11 +50,12 @@ main {
} }
#player { #player {
width: 856px; width: 854px;
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
/* 480p */
#video { #video {
width: 100%; width: 100%;
height: 480px; height: 480px;
@ -74,7 +80,7 @@ main {
white-space: normal; white-space: normal;
} }
#sidebar { #playlist {
font-size: 13px; font-size: 13px;
display: inline-block; display: inline-block;
margin-left: 10px; margin-left: 10px;
@ -83,29 +89,30 @@ main {
box-shadow: 0 3px 7px 0 rgba(0, 0, 0, 0.2); box-shadow: 0 3px 7px 0 rgba(0, 0, 0, 0.2);
} }
#sidebar > a { #playlist > a {
display: block; display: block;
padding: 10px; padding: 10px;
position: relative; position: relative;
min-height: 54px;
} }
#sidebar > a:hover { #playlist > a:hover {
color: #ae81ff; color: var(--link-hover-color);
} }
#sidebar > a.playing { #playlist > a.playing {
background: #383a3e; background: #383a3e;
} }
#sidebar > a + a { #playlist > a + a {
border-top: 1px solid #1e1e1e; border-top: 1px solid #1e1e1e;
} }
#sidebar > a > img { #playlist > a > img {
width: 70px; width: 70px;
} }
#sidebar > a > div { #playlist > a > div {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
@ -113,17 +120,18 @@ main {
left: 90px; left: 90px;
} }
#sidebar > a > div > h1 { #playlist > a > div > h1 {
white-space: normal; white-space: normal;
} }
#sidebar > a > div > h2 { #playlist > a > div > h2 {
margin-top: 5px; margin-top: 5px;
color: #676867; color: #676867;
font-size: 90%; font-size: 90%;
} }
@media only screen and (max-width: 1156px) { /* 360p */
@media only screen and (max-width: 1180px) {
main { main {
width: 940px; width: 940px;
} }
@ -135,7 +143,8 @@ main {
} }
} }
@media only screen and (max-width: 940px) { /* 240p */
@media only screen and (max-width: 965px) {
main { main {
width: 726px; width: 726px;
} }
@ -147,7 +156,8 @@ main {
} }
} }
@media only screen and (max-width: 726px) { /* 240p with shifted playlist */
@media only screen and (max-width: 750px) {
main { main {
width: 426px; width: 426px;
} }
@ -157,10 +167,29 @@ main {
#video { #video {
height: 240px; height: 240px;
} }
#sidebar { #playlist {
width: 426px; width: 426px;
margin-top: 10px; margin-top: 10px;
margin-left: 0; margin-left: 0;
display: block; display: block;
} }
} }
/* responsive width with shifted playlist */
@media only screen and (max-width: 440px) {
main {
width: 100%;
}
#player {
width: 100%;
}
#video {
height: auto;
}
#playlist {
width: 100%;
margin-top: 10px;
margin-left: 0;
display: block;
}
}

View file

@ -5,7 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" type="text/css" href="/static/css/index.css"> <link rel="stylesheet" type="text/css" href="/static/theme.css">
</head> </head>
<body> <body>
<nav><a href="/">Tube</a></nav> <nav><a href="/">Tube</a></nav>
@ -20,7 +20,7 @@
<video id="video" controls></video> <video id="video" controls></video>
{{ end }} {{ end }}
</div> </div>
<div id="sidebar"> <div id="playlist">
{{ range $m := .Playlist }} {{ range $m := .Playlist }}
{{ if eq $m.ID $playing.ID }} {{ if eq $m.ID $playing.ID }}
<a href="/v/{{ $m.ID }}" class="playing"> <a href="/v/{{ $m.ID }}" class="playing">