Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Move styles into stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbirrell committed Mar 28, 2017
1 parent c7de7c5 commit a58b1c8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
29 changes: 2 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
<!DOCTYPE html>
<html style="width: 100%; height: 100%;">
<html>
<head>
<meta charset="UTF-8">
<title>Trello</title>

<style>
body {
width: 100%; height: 100%; margin: 0;
background: #0079BF;
display: flex;
align-items: center;
}
.loader {
background-image: url("loader.gif");
background-size: 18px 18px;
display: none;
height: 18px;
width: 18px;
position: absolute;
left: 50%;
}
.loader.is-loading {
display: block;
margin: 0 auto;
}
webview {
width: 100%;
height: 100%;
}
</style>
<link rel="stylesheet" href="style.css">
</head>
<body>
<span class="loader"></span>
Expand Down
5 changes: 3 additions & 2 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ const contextMenu = require('electron-context-menu')

const webview = document.getElementById('trello')
const loader = document.querySelector('.loader')
const isLoadingClass = 'is-loading'

let loadedCurrent = false;

onload = () => {
const loadstart = () => {
loader.classList.add('is-loading')
loader.classList.add(isLoadingClass)

if (!loadedCurrent) {
webview.loadURL(getCurrentUri())
Expand All @@ -24,7 +25,7 @@ onload = () => {
}

const loadstop = () => {
loader.classList.remove('is-loading')
// loader.classList.remove(isLoadingClass)
}

webview.addEventListener('dom-ready', () => {
Expand Down
25 changes: 25 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
html,
body {
width: 100%; height: 100%; margin: 0;
background: #0079BF;
display: flex;
align-items: center;
}
.loader {
background-image: url("loader.gif");
background-size: 18px 18px;
display: none;
height: 18px;
width: 18px;
position: absolute;
left: 50%;
}
.loader.is-loading {
display: block;
margin: 0 auto;
}
webview {
width: 100%;
height: 100%;
z-index: 1;
}

0 comments on commit a58b1c8

Please sign in to comment.