Merge branch 'cssdesign'

This commit is contained in:
Kristóf Tóth
2018-03-09 18:22:53 +01:00
21 changed files with 608 additions and 118 deletions

15
src/app/dashboard/dashboard.component.html Normal file → Executable file
View File

@ -1,12 +1,7 @@
<app-header></app-header>
<div class="container-fluid">
<div class="row tfw-first-row">
<div class="col-sm"><app-login></app-login></div>
<div class="col-sm-6"><app-webide></app-webide></div>
<div class="col-sm"><app-messages></app-messages></div>
</div>
<div class="row tfw-second-row">
<div class="col-sm-3"><app-testmessager></app-testmessager></div>
<div class="col-sm-9"><app-terminal></app-terminal></div>
</div>
<div class="tfw-grid-main-components">
<div class="tfw-messages"><app-messages></app-messages></div>
<div class="tfw-web tao-grid-top-left"><app-login></app-login></div>
<div class="tfw-webide"><app-webide></app-webide></div>
<div class="tfw-terminal"><app-terminal></app-terminal></div>
</div>

80
src/app/dashboard/dashboard.component.scss Normal file → Executable file
View File

@ -1,5 +1,79 @@
.tfw-first-row {
height: 40vh;
$space: 24px;
$tao-plum-900: #272F4C;
$tao-gray-50: #FAFAFA;
$tao-navbar-height: 67px;
$layout-template: "default"; // Change this to switch template
$default-layout: (
'messages': (1, 2, 1, 4),
'webide': (4, -1, 1, -1),
'terminal': (1, 4, 4, -1),
'web': (2, 4, 1, 4)
);
$raw-layout: (
'messages': (1, 2, 1, -1),
'webide': (4, -1, 1, -1),
'terminal': (2, 4, 1, -1),
'web': (),
);
$layout: (
"default": $default-layout,
"raw": $raw-layout
);
@mixin position-grid-items($map, $sel) {
$sel: if($sel == '' and &, &, $sel);
@debug $sel;
#{$sel} {
@each $k, $v in $map {
@at-root #{$sel}#{$k} {
@if (length($v) == 0) {
display: none
}
@else {
grid-column-start: nth($v, 1);
grid-column-end: nth($v, 2);
grid-row-start: nth($v, 3);
grid-row-end: nth($v, 4);
}
}
}
}
}
.tfw-second-row {}
.tfw-grid-main-components {
overflow-y: hidden;
display: grid;
padding-top: $tao-navbar-height;
width: 100vw;
height: 100vh;
justify-content: center;
align-content: center;
grid-template-columns: repeat(5, 1fr);
grid-template-rows: repeat(5, 1fr);
@include position-grid-items(map_get($layout,$layout-template),'.tfw-');
.tfw-web {
padding: $space;
}
.tfw-messages {
padding: $space;
background-color: $tao-gray-50;
}
.tfw-webide {
background-color: $tao-plum-900;
}
.tfw-terminal {
}
}

19
src/app/header/header.component.html Normal file → Executable file
View File

@ -1,8 +1,11 @@
<div class="jumbotron text-center">
<h1>Tutorial framework Demo</h1>
<h3>
Powered by Angular
<img class="logo" width="36" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</h3>
</div>
<nav class="navbar navbar-default navbar-expand-md navbar-light tfw-navbar fixed-top">
<div class="tfw-grid-navbar">
<!-- <ul class="navbar-nav tao-grid-center-right">
<li class="nav-item tao-header-title">an</li>
</ul>-->
<img src="images/avatao_logo.svg" routerLink="/" class="tao-grid-center-left tfw-company-logo" alt="">
<ul class="navbar-nav">
<li class="nav-item tfw-header-title">Tutorials</li>
</ul>
</div>
</nav>

80
src/app/header/header.component.scss Normal file → Executable file
View File

@ -1,33 +1,57 @@
@keyframes heartbeat
{
0%
{
transform: scale( .75 );
}
20%
{
transform: scale( 1 );
}
40%
{
transform: scale( .75 );
}
60%
{
transform: scale( 1 );
}
80%
{
transform: scale( .75 );
}
100%
{
transform: scale( .75 );
}
$tao-blue-500: #277EEC;
$font-size-base: 14px;
$font-size-h3: floor(($font-size-base * 1.3));
$tao-navbar-height: 67px;
$company-logo-width: 130px;
.tfw-header-title {
color: $tao-blue-500;
font-size: $font-size-h3;
}
.logo {
animation: heartbeat 1s infinite;
.tfw-navbar {
background-color: rgba(255, 255, 255, 0.96);
min-height: $tao-navbar-height;
box-shadow: 0px 1px 6px 0px #888;
margin-bottom: 12px;
border: 1px solid #e7e7e7;
}
.tfw-grid-navbar {
display: grid;
grid-template-columns: $company-logo-width 1fr;
grid-column-gap: 8px;
width: 100%;
}
.tfw-company-logo {
display: block;
width: $company-logo-width;
}
.tfw-company-logo-mobile {
display: none;
width: 130px;
}
@media (max-width: 767px) {
.tfw-grid-navbar {
grid-template-columns: 1fr;
}
.tfw-company-logo {
display: none;
}
.tfw-company-logo-mobile {
display: block;
}
.tfw-navbar-links {
justify-self: left !important;
}
}
.jumbotron {

20
src/app/messages/messages.component.html Normal file → Executable file
View File

@ -1,11 +1,11 @@
<div>
<ul>
<li *ngFor="let message of messages.slice().reverse()">
<p>
<strong>{{message.originator}}</strong>
<span class="timestamp">{{message.timestamp | date:'yyyy-MM-dd HH:mm:ss'}}</span><br>
<span [innerHtml]="message.message"></span>
</p>
</li>
</ul>
<div class="tfw-messages-main">
<h5>Instructions</h5>
<div class="tfw-grid-message" *ngFor="let message of messages.slice().reverse()">
<div class="tfw-grid-message-header">
<img class="tao-grid-center-left" src="images/avataobot.svg"/>
<div class="tao-grid-center-left originator">{{message.originator}}</div>
<div class="timestamp tao-grid-center-right">{{message.timestamp | date:'HH:mm:ss'}}</div>
</div>
<div [innerHtml]="message.message"></div>
</div>
</div>

65
src/app/messages/messages.component.scss Normal file → Executable file
View File

@ -1,14 +1,61 @@
div {
display: block;
overflow: auto;
max-height: 100%;
$space: 24px;
$small: 0.75 * $space;
$tiny: 0.5 * $space;
$hair: 0.25 * $space;
$tao-blue-500: #277EEC;
$tao-gray-100: #F2F2F2;
$tao-panel-border-radius-sm: 8px;
$font-size-tiny: 12px;
$font-size-base: 14px;
.tfw-messages-main {
max-height: 50vmin;
overflow-y: scroll;
h5 {
margin-bottom: $small;
color: $tao-blue-500;
font-weight: 500;
}
}
ul {
max-height: inherit;
list-style-type: none;
.tfw-grid-message {
display: grid;
grid-template-rows: 1fr auto;
grid-row-gap: $hair;
width: 100%;
background-color: $tao-gray-100;
border-radius: $tao-panel-border-radius-sm;
padding: $tiny;
font-size: $font-size-base;
margin-bottom: $hair;
}
.timestamp {
opacity: 0.37;
.tfw-grid-message-header {
display: grid;
grid-template-columns: 1fr 5fr 8fr;
grid-column-gap: 4px;
width: 100%;
img {
width: 12px;
}
.originator {
font-weight: 500;
}
.timestamp {
font-size: $font-size-tiny;
opacity: 0.37;
}
}

View File

@ -1,13 +1,34 @@
<div class="btn-group btn-group-sm flex-wrap">
<button *ngFor="let file of files"
class="btn btn-secondary"
(click)="tabSwitchButtonHandler(file)"
[class.active]="filename === file"
[class.disabled]="filename === file"
[disabled]="filename === file"
[class.btn-success]="filename === file && codeState === 'SAVED'">
{{file}}
</button>
<div class="tfw-grid-container">
<div class="btn-group btn-group-sm flex-wrap tao-grid-center-left">
<button *ngFor="let file of files"
class="btn tfw-tab-btn"
(click)="tabSwitchButtonHandler(file)"
[class.active]="filename === file"
[class.disabled]="filename === file"
[disabled]="filename === file"
[class.tao-tab-btn-saved]="filename === file && codeState === 'SAVED'">
{{file}}
</button>
</div>
<div class="btn-group-sm tfw-deploy-btn-group">
<button type="submit"
class="btn tfw-deploy-btn tao-grid-top-center"
(click)="sendCodeIfDirty(); deployCode()"
[disabled]="deployButtonState === 'DEPLOYING' || deployButtonState === 'DEPLOYED'"
[class.deployed]="deployButtonState === 'DEPLOYED'"
[class.deploy]="deployButtonState === 'DEPLOYING'"
[class.disabled]="deployButtonState === 'DEPLOYING' || deployButtonState === 'DEPLOYED'"
[class.failed]="deployButtonState === 'FAILED'"
>
<span *ngIf="deployButtonState === 'TODEPLOY'">Deploy</span>
<span *ngIf="deployButtonState === 'DEPLOYED'">
<img src="images/greentick_icon.svg"/>
<span>Deployed</span>
</span>
<span *ngIf="deployButtonState === 'DEPLOYING'"><div class="loader"></div>Reloading app...</span>
<span *ngIf="deployButtonState === 'FAILED'">Deployment failed. Retry</span></button>
</div>
</div>
<div (keyup)="setCodeState('DIRTY'); setDeployButtonState('TODEPLOY'); resetAutoSaveCountdown()"
@ -18,18 +39,3 @@
class="tfw-ace-editor"
>
</div>
<div class="btn-group flex-wrap">
<button type="submit"
class="btn btn-secondary"
(click)="sendCodeIfDirty(); deployCode()"
[disabled]="deployButtonState === 'DEPLOYING' || deployButtonState === 'DEPLOYED'"
[class.btn-success]="deployButtonState === 'DEPLOYED'"
[class.btn-info]="deployButtonState === 'DEPLOYING'"
[class.disabled]="deployButtonState === 'DEPLOYING' || deployButtonState === 'DEPLOYED'"
[class.btn-danger]="deployButtonState === 'FAILED'"
><span *ngIf="deployButtonState === 'TODEPLOY'">Deploy</span>
<span *ngIf="deployButtonState === 'DEPLOYED'">Deploy</span>
<span *ngIf="deployButtonState === 'DEPLOYING'"><div class="loader"></div>Reloading app...</span>
<span *ngIf="deployButtonState === 'FAILED'">Deployment failed</span></button>
</div>

View File

@ -1,28 +1,100 @@
$space: 24px;
$small: 0.75 * $space;
$tao-bright-green-100: #c5f2e4;
$tao-bright-green-200: #a0ead3;
$tao-warm-yellow-200: #FFE0A9;
$tao-warm-yellow-600: #E59C3C;
$tao-plum-200: #BEC7F3;
$tao-plum-900: #272F4C;
$tao-red-500: #FF5252;
.tfw-grid-container {
display: grid;
grid-template-columns: 8fr 1fr;
}
.tfw-ace-editor {
min-height: 30vh;
height: 80%;
height: 100%;
width: 100%;
overflow: auto;
}
.btn-secondary {
border-radius: 0;
.btn-group {
padding-left: 34px;
}
.loader {
border: 2px solid #ffffff;
border-radius: 50%;
border-top: 2px solid #212529;
width: 15px;
height: 15px;
animation: spin 2s linear infinite;
display: inline-block;
margin-right: 5px;
position: relative;
top: 2px;
.tfw-tab-btn {
background-color: white;
border: 1px solid $tao-plum-900;
border-left: 0;
border-right: 0;
border-radius: 100px;
padding: 5px 19px;
z-index: 200;
.tfw-tab-btn-saved,
.active,
.disabled,
&:disabled {
background-color: $tao-plum-200;
color: black;
}
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
.tfw-deploy-btn-group {
margin: $small;
.tfw-deploy-btn {
background: $tao-bright-green-200;
border-radius: 100px;
padding: 6px 19px;
img {
position: relative;
bottom: 1px;
height: $small;
}
&.failed {
background-color: $tao-red-500;
color:white;
}
&:disabled,
&.disabled,
&.deployed,
&.deploy
{
background-color: $tao-bright-green-100;
color: black;
}
&.deploy {
background-color: $tao-warm-yellow-200;
}
.loader {
border: 2px solid $tao-warm-yellow-600;
border-radius: 50%;
border-top: 2px solid $tao-warm-yellow-200;
width: 15px;
height: 15px;
animation: spin 2s linear infinite;
display: inline-block;
margin-right: 5px;
position: relative;
top: 2px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
}
}

View File

@ -11,7 +11,7 @@ import 'brace/mode/json';
import 'brace/mode/python';
import 'brace/mode/sql';
import 'brace/theme/monokai';
import 'brace/theme/cobalt';
import { SourceCode } from './source-code';
import { WebSocketService } from '../services/websocket.service';
import { ProcessManagerService } from '../services/processmanager.service';
@ -31,7 +31,7 @@ export class WebideComponent implements OnInit {
filename = 'demo.js';
code: string = defaultSourceCode;
language = 'javascript';
theme = 'monokai';
theme = 'cobalt';
directory = '';
files: string[];
codeState = 'SAVED';