add responsive design

This commit is contained in:
Janis
2023-11-12 17:16:58 +01:00
parent ce7aee8481
commit 9870fdcdb4
4 changed files with 175 additions and 119 deletions

View File

@@ -62,28 +62,30 @@ export default function Generator() {
<div className="configurations"> <div className="configurations">
<h2>Configurations</h2> <h2>Configurations</h2>
<div className="option"> <div className="options">
<input <section>
type="checkbox" <div
checked={showChannelName} className="option"
onChange={(e: ChangeEvent<HTMLInputElement>) => { onClick={() => {
setShowChannelName(e.target.checked); setShowChannelName(!showChannelName);
}} }}
/> >
<input type="checkbox" checked={showChannelName} />
<label>Show channelname</label> <label>Show channelname</label>
</div> </div>
<div className="option"> <div
<input className="option"
type="checkbox" onClick={() => {
checked={hideNonTalking} setHideNonTalking(!hideNonTalking);
onChange={(e: ChangeEvent<HTMLInputElement>) => {
setHideNonTalking(e.target.checked);
}} }}
/> >
<input type="checkbox" checked={hideNonTalking} />
<label>Hide non talking clients</label> <label>Hide non talking clients</label>
</div> </div>
</section>
<section>
<div className="option"> <div className="option">
<input <input
type="number" type="number"
@@ -107,6 +109,8 @@ export default function Generator() {
/> />
<label>RemoteApp-Port</label> <label>RemoteApp-Port</label>
</div> </div>
</section>
</div>
</div> </div>
<div className="preview"> <div className="preview">

View File

@@ -1,6 +1,7 @@
// Breakpoints // Breakpoints
$breakpoint-1: 760px; $breakpoint-1: 1200px;
$breakpoint-2: 565px; $breakpoint-2: 790px;
$breakpoint-3: 600px;
@keyframes tooltipAnimation { @keyframes tooltipAnimation {
0% { 0% {
@@ -22,7 +23,6 @@ $breakpoint-2: 565px;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 50px; gap: 50px;
box-sizing: border-box;
padding: 50px 0; padding: 50px 0;
.headline { .headline {
@@ -48,15 +48,8 @@ $breakpoint-2: 565px;
background-color: #313136; background-color: #313136;
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
@media screen and (max-width: $breakpoint-1) {
width: 300px;
} }
@media screen and (max-width: $breakpoint-2) {
width: 200px;
}
}
.copy { .copy {
padding: 5px 10px; padding: 5px 10px;
border: 2px solid #31f39973; border: 2px solid #31f39973;
@@ -81,6 +74,7 @@ $breakpoint-2: 565px;
font-weight: bold; font-weight: bold;
} }
} }
.generatorContent { .generatorContent {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@@ -89,25 +83,28 @@ $breakpoint-2: 565px;
padding: 0 50px; padding: 0 50px;
gap: 30px; gap: 30px;
width: 100%; width: 100%;
box-sizing: border-box;
.configurations { .configurations {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: left; align-items: center;
gap: 10px;
height: 100%; height: 100%;
flex: 1; flex: 1;
} gap: 50px;
.preview {
flex: 1; .options {
border: 2px solid #31f39973; display: flex;
.viewer { flex-direction: row;
background-image: url("/images/viewer_example_background.png"); align-items: center;
background-repeat: no-repeat; gap: 100px;
background-size: cover; user-select: none;
min-height: 500px;
} section {
display: flex;
flex-direction: column;
align-items: center;
justify-content: left;
gap: 10px;
} }
.option { .option {
@@ -116,7 +113,7 @@ $breakpoint-2: 565px;
align-items: center; align-items: center;
justify-content: left; justify-content: left;
column-gap: 10px; column-gap: 10px;
width: 100%;
input { input {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
@@ -176,4 +173,57 @@ $breakpoint-2: 565px;
} }
} }
} }
}
.preview {
flex: 1;
border: 2px solid #31f39973;
.viewer {
background-image: url("/images/viewer_example_background.png");
background-repeat: no-repeat;
background-size: cover;
min-height: 500px;
}
}
}
@media screen and (max-width: $breakpoint-1) {
.generatorContent {
flex-direction: column;
.preview {
width: 80%;
}
}
}
@media screen and (max-width: $breakpoint-2) {
.output {
.url {
width: 300px;
}
}
.generatorContent {
.preview {
width: 100%;
}
}
}
@media screen and (max-width: $breakpoint-3) {
.output {
.url {
width: 200px;
}
}
.generatorContent {
.configurations {
.options {
flex-direction: column;
gap: 30px;
}
}
}
}
} }

View File

@@ -4,7 +4,6 @@
gap: 0 0; gap: 0 0;
font-size: 3rem; font-size: 3rem;
color: white; color: white;
box-sizing: border-box;
padding: 10px; padding: 10px;
h1, h1,
@@ -17,6 +16,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 20ch; max-width: 20ch;
user-select: none;
} }
.channelNameContainer { .channelNameContainer {
display: flex; display: flex;

View File

@@ -4,18 +4,20 @@
font-size: 1rem; font-size: 1rem;
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box;
} }
body, body,
html { html {
height: 100vh; min-height: 100vh;
width: 100vw; min-width: 100%;
display: flex; display: flex;
overflow-x: hidden;
} }
#root { #root {
min-height: 100%; height: 100%;
width: 100%; min-width: 100%;
} }
h1 { h1 {
@@ -61,7 +63,7 @@ button {
// custom dark themed scrollbar // custom dark themed scrollbar
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 5px; width: 5px;
height: 15px; height: 5px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {