Commit 1d687721 authored by Marco Kellershoff's avatar Marco Kellershoff 🤸

Major rework and workaround for flickering

parent 3020612f
This diff is collapsed.
((window, document) => {
let bgColor = window.localStorage.getItem("bgColor");
if (bgColor && bgColor.length) {
const style = document.createElement("style");
style.innerHTML = `html,body{background-color: ${bgColor}};`;
document.head.appendChild(style);
}
})(window, document);
......@@ -4,7 +4,7 @@
"name": "Super Evil New Tab",
"short_name": "SENT",
"author":"Marco Kellershoff",
"version": "6.1.0",
"version": "7.0.0",
"description": "Fixes the super evil new tab page.",
"options_page": "options.html",
"permissions": [
......
......@@ -4,7 +4,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>New Tab</title>
<style>html,body{margin:0;padding:0;overflow:hidden;background-color:#000;}</style>
<style>html,body{margin:0;padding:0;overflow:hidden;background-color:#272b30;}</style>
<script src="bgcolor.js"></script>
</head>
<body>
<iframe id="newtabframe" frameborder=0 border=0 src="newtabframe.html" allowtransparency="true"></iframe>
......
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(fonts/source-code-pro/SourceCodePro-Regular.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
font-family: "Source Code Pro";
font-style: normal;
font-weight: 400;
src: local("Source Code Pro"), local("SourceCodePro-Regular"),
url(fonts/source-code-pro/SourceCodePro-Regular.woff) format("woff");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC,
U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
h1 {
color: #fc9867;
border-bottom: 2px solid #ab9dfd;
max-width: 50%;
color: #fc9867;
border-bottom: 2px solid #ab9dfd;
max-width: 50%;
}
h1 span {
color: #a9dc76;
color: #a9dc76;
}
#bgColor {
background-color: #272822;
border: 5px solid #2f3129;
color: #a6e22e;
font-size: 16px;
padding: 5px;
}
#bgColorPreview {
display: inline-block;
margin-left: 76px;
padding-left: 10px;
padding-right: 10px;
border: 5px solid #2f3129;
background-color: #fff;
color: #ccc;
text-shadow: -1px -1px 0 #222, 1px -1px 0 #222, -1px 1px 0 #222,
1px 1px 0 #222;
}
kbd {
-moz-border-radius:3px;
-moz-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
-webkit-border-radius:3px;
-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
background-color:#f7f7f7;
border:1px solid #ccc;
border-radius:3px;
box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
color:#333;
display:inline-block;
font-family:Arial,Helvetica,sans-serif;
font-size:11px;
line-height:1.4;
margin:0 .1em;
padding:.1em .6em;
text-shadow:0 1px 0 #fff;
}
html, body {
background-color: #272b30;
color: #fff;
-moz-border-radius: 3px;
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px #fff inset;
-webkit-border-radius: 3px;
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px #fff inset;
background-color: #f7f7f7;
border: 1px solid #ccc;
border-radius: 3px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px #fff inset;
color: #333;
display: inline-block;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 1.4;
margin: 0 0.1em;
padding: 0.1em 0.6em;
text-shadow: 0 1px 0 #fff;
}
html,
body {
background-color: #272b30;
color: #fff;
}
body {
line-height: 1.8em;
font-size: 110%;
line-height: 1.8em;
font-size: 110%;
}
#contentwrapper {
width: 100%;
padding-bottom: 42px;
width: 100%;
padding-bottom: 42px;
}
a:link,a:active,a:visited {
color: #666;
a:link,
a:active,
a:visited {
color: #666;
}
#htmlEditor, #javascriptEditor, #cssEditor {
max-width: 95%;
width: 900px;
height: 550px;
#htmlEditor,
#javascriptEditor,
#cssEditor {
max-width: 95%;
width: 900px;
height: 550px;
}
#messages {
position: fixed;
display: block;
width: 100%;
bottom: 0;
text-align: center;
font-size: 150%;
font-weight: bold;
position: fixed;
display: block;
width: 100%;
bottom: 0;
text-align: center;
font-size: 150%;
font-weight: bold;
}
#messages div {
display: inline-block;
border-radius: 15px;
padding: 1%;
margin: 1%;
color: #333;
display: inline-block;
border-radius: 15px;
padding: 1%;
margin: 1%;
color: #333;
}
button {
font-family: 'Source Code Pro';
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 10px;
border-radius: 10px;
font-size: 18px;
color: #FFF;
text-decoration: none;
border: 1px solid #333;
font-family: "Source Code Pro";
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 10px;
border-radius: 10px;
font-size: 18px;
color: #fff;
text-decoration: none;
border: 1px solid #333;
}
#exportBtn {
background-color: #3498DB;
border-bottom: 5px solid #2980B9;
text-shadow: 0px -2px #2980B9;
background-color: #3498db;
border-bottom: 5px solid #2980b9;
text-shadow: 0px -2px #2980b9;
}
#importBtn {
background-color: #E74C3C;
border-bottom: 5px solid #BD3E31;
text-shadow: 0px -2px #BD3E31;
background-color: #e74c3c;
border-bottom: 5px solid #bd3e31;
text-shadow: 0px -2px #bd3e31;
}
#file {
display: none;
display: none;
}
button:active {
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 1px solid;
transform: translate(0px, 5px);
-webkit-transform: translate(0px, 5px);
border-bottom: 1px solid;
}
nav {
margin-top: 20px;
margin-top: 20px;
}
footer {
color: #666;
position: fixed;
right: 1%;
bottom: 1%;
text-align: right;
display: block;
color: #666;
position: fixed;
right: 1%;
bottom: 1%;
text-align: right;
display: block;
}
footer a:link,
footer a:visited {
text-decoration: none;
border-bottom: 1px solid;
text-decoration: none;
border-bottom: 1px solid;
}
footer a:hover {
border-bottom: 1px solid red;
border-bottom: 1px solid red;
}
......@@ -22,6 +22,8 @@
<button id="importBtn">Import Configuration</button>
<input id="file" name="file" type="file" accept=".json" />
</nav>
<h3>Background-Color (on initial load)</h3>
<div class="option-holder"><input type="text" id="bgColor" placeholder="#fff" /><span id="bgColorPreview">Background-Color Preview</span></div>
<h3>Custom HTML (inside <code>&lt;body&gt;</code> tag)</h3>
<div id="htmlEditor"></div>
<h3>Custom CSS</h3>
......@@ -31,7 +33,7 @@
</div>
<footer>
Made with <i class="fa fa-heart" aria-hidden="true" style="color:red;"></i> by
<a href="https://about.walialu.com/" target="_blank">Marco</a>.
<a href="https://gorilla.moe/" target="_blank">Marco</a>.
</footer>
<script src="ace/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="options.js"></script>
......
This diff is collapsed.
{
"name": "super-evil-new-tab",
"version": "7.0.0",
"description": "This extension overrides the default `chrome://newtab` and let's you completely customize it.",
"main": "background.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git.superevilmegaco.com:google-chrome/super-evil-new-tab.git"
},
"author": "Marco Kellershoff a.k.a. Gorilla Moe",
"license": "ISC"
}
/*jshint esversion: 6 */
(function(window, document) {
let getOption = function(key, cb) {
var typeOfKey;
......@@ -13,6 +12,13 @@
let boot = function() {
let css = document.createElement("style");
let js = document.createElement("script");
getOption("bgColor", result => {
if (result.bgColor)
window.localStorage.setItem(
"bgColor",
result.bgColor
);
});
getOption("css", result => {
css.innerHTML = result.css;
document.querySelector("head").appendChild(css);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment