Skip to content

Commit f1cd8dc

Browse files
committed
Responsive tweaks
1 parent 65cf46a commit f1cd8dc

File tree

2 files changed

+81
-30
lines changed

2 files changed

+81
-30
lines changed

special-pages/pages/duckplayer/app/components/Player.jsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export function PlayerError({ kind, layout }) {
9696
class={cn(styles.root, {
9797
[styles.desktop]: layout === 'desktop',
9898
[styles.mobile]: layout === 'mobile',
99+
[styles.errorContainer]: true,
99100
})}
100101
>
101102
{kind === 'invalid-id' && <InvalidIdError kind={kind} />}
@@ -132,17 +133,19 @@ export function YouTubeError({ kind }) {
132133
<div className={styles.youtubeErrorContainer}>
133134
<span className={styles.youtubeErrorIcon}></span>
134135

135-
<h1 className={styles.youtubeErrorHeading}>{heading}</h1>
136+
<div className={styles.youtubeErrorText}>
137+
<h1 className={styles.youtubeErrorHeading}>{heading}</h1>
136138

137-
{message && <p className={styles.youtubeErrorMessage}>{message}</p>}
139+
{message && <p className={styles.youtubeErrorMessage}>{message}</p>}
138140

139-
{solutions && (
140-
<ul className={styles.youtubeErrorList}>
141-
{solutions.map((item) => (
142-
<li>{item}</li>
143-
))}
144-
</ul>
145-
)}
141+
{solutions && (
142+
<ul className={styles.youtubeErrorList}>
143+
{solutions.map((item) => (
144+
<li>{item}</li>
145+
))}
146+
</ul>
147+
)}
148+
</div>
146149
</div>
147150
</div>
148151
);

special-pages/pages/duckplayer/app/components/Player.module.css

+69-21
Original file line numberDiff line numberDiff line change
@@ -56,59 +56,101 @@
5656
column-gap: 24px;
5757
row-gap: 4px;
5858
grid-template-areas:
59-
"icon heading"
60-
"icon message"
61-
"icon list";
59+
"icon"
60+
"text";
6261
max-width: 680px;
63-
padding: 0 40px;
62+
padding: 0 24px;
63+
margin: 16px 0;
64+
65+
@media screen and (min-width: 600px) {
66+
grid-template-areas:
67+
"icon text";
68+
padding: 0 40px;
69+
margin: 0;
70+
}
6471
}
6572

66-
.youtubeErrorIcon {
67-
align-self: start;
68-
background: url('../img/warning-96.data.svg') no-repeat;
69-
display: block;
70-
height: 48px;
71-
width: 48px;
73+
.youtubeErrorText {
74+
display: flex;
75+
flex-direction: column;
76+
gap: 4px;
77+
grid-area: text;
78+
margin: 16px 0;
79+
80+
@media screen and (min-width: 600px) {
81+
margin: 24px 0;
82+
}
83+
}
7284

85+
.youtubeErrorIcon {
86+
align-self: center;
87+
display: flex;
7388
grid-area: icon;
89+
justify-content: center;
90+
91+
&::before {
92+
content: ' ';
93+
display: block;
94+
background: url('../img/warning-96.data.svg') no-repeat;
95+
height: 48px;
96+
width: 48px;
97+
}
7498

7599
@media screen and (min-width: 600px) {
76-
align-self: start;
77-
background-image: url('../img/warning-128.data.svg');
78-
height: 96px;
79-
width: 128px;
100+
justify-content: start;
101+
102+
&::before {
103+
background-image: url('../img/warning-128.data.svg');
104+
height: 96px;
105+
width: 128px;
106+
}
80107
}
81108
}
82109

83110
.youtubeErrorHeading {
84-
font-size: 20px;
111+
font-size: 16px;
85112
font-weight: 700;
86-
line-height: calc(24 / 20);
113+
line-height: calc(20 / 16);
87114
margin: 0;
88115

89116
grid-area: heading;
117+
118+
@media screen and (min-width: 600px) {
119+
font-size: 20px;
120+
line-height: calc(24 / 20);
121+
}
90122
}
91123

92124
.youtubeErrorMessage {
93125
color: #ccc;
94-
font-size: 14px;
95-
line-height: calc(20 / 14);
126+
font-size: 13px;
127+
line-height: calc(18 / 13);
96128
margin: 0;
97129

98130
grid-area: message;
131+
132+
@media screen and (min-width: 600px) {
133+
font-size: 14px;
134+
line-height: calc(20 / 14);
135+
}
99136
}
100137

101138
.youtubeErrorList {
102139
color: #ccc;
103-
font-size: 14px;
104-
line-height: calc(20 / 14);
140+
font-size: 13px;
141+
line-height: calc(18 / 13);
142+
143+
grid-area: list;
105144

106145
li {
107146
list-style: disc;
108147
margin-left: 20px;
109148
}
110149

111-
grid-area: list
150+
@media screen and (min-width: 600px) {
151+
font-size: 14px;
152+
line-height: calc(20 / 14);
153+
}
112154
}
113155

114156
@media screen and (min-width: 600px) and (max-height: 450px) {
@@ -128,3 +170,9 @@
128170
border-radius: 0;
129171
}
130172
}
173+
174+
@media screen and (max-width: 600px) {
175+
.errorContainer.errorContainer {
176+
aspect-ratio: unset;
177+
}
178+
}

0 commit comments

Comments
 (0)