Skip to content

Commit

Permalink
style(webpage): improved split handling for editor and configure view
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisDommer committed Dec 5, 2023
1 parent 8026b7b commit 62ca60b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 35 deletions.
27 changes: 2 additions & 25 deletions WebSocketClient/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="style.css">
<title>UVL Playground</title>
<style>
#iframeContainer {
height: 1000px;
width: '100%';
display: none;
}

iframe {
height: 100%;
width: 100%;
border: none; /* Remove iframe border */
}

#embeddedContentContainer {
height: 1000px;
width: 10000px;
}
</style>
</head>
<body>
<div class="header">
<h1>UVL Playground</h1>
<h2 id="connection" style="color: red;"></h2>
</div>
<div class="flex-container">
<div class="container">
<div id="container" class="editor"></div>
</div>
<div id="iframeContainer" class="config-view">
<iframe id="myIframe" title="Config"></iframe>
</div>
<div id="flex-container" class="flex-container">
<div id="container" class="editor"></div>
</div>

<div class="graph"></div>
Expand Down
11 changes: 8 additions & 3 deletions WebSocketClient/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ function displayConfigureView(configUri: string) {
protocol = 'https';
}
const newUrl: string = `${protocol}://${config.languageServerHostName}:${url.port}${url.pathname}`;
const iframeContainer: any = document.getElementById('iframeContainer');
const myIframe: any = document.getElementById('myIframe');
iframeContainer.style.display = 'block';

let myIframe: HTMLIFrameElement | null = document.getElementById('config-view') as HTMLIFrameElement;
if(!myIframe){
myIframe = document.createElement('iframe') as HTMLIFrameElement;
myIframe.id = "config-view";
const iframeContainer: any = document.getElementById('flex-container');
iframeContainer.appendChild(myIframe);
}
myIframe.src = newUrl;
}

Expand Down
19 changes: 12 additions & 7 deletions WebSocketClient/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ body {
}

.container {
width: 40%;
padding: 0 40px 0 0;
margin: 0 auto;
display: flex;
width: 50%;
height: 100%
}

Expand All @@ -25,8 +24,8 @@ body {
text-align: center;
}

#iframeContainer {
min-width: 30%;
iframe {
border: none;
}

.graph {
Expand All @@ -37,8 +36,13 @@ body {

.flex-container {
display: flex;
width: 100%;
height: 75%;
justify-content: space-around;
}

iframe {
flex-grow: 1;
max-width: 50%;
}

h1 {
Expand All @@ -52,7 +56,8 @@ h1 {
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
width:100%;
min-width: 50%;
max-width: 100%;
height:80ch;
border:1px solid grey;
margin-left: 10px;
Expand Down

0 comments on commit 62ca60b

Please sign in to comment.