<commit_before>// ==UserScript==
// @name        about:newtab clock
// @namespace   http://jordanrobinson.co.uk
// @description A simple, dark themed clock to show on open of a new tab.
// @include     about:blank
// @exclude     http://*
// @version     0.5.0
// @grant       none
// ==/UserScript==

var body = document.getElementsByTagName('body')[0];
var container = document.createElement('div');
var clockHolder = document.createElement('div');
var currentTime = document.createElement('span');
var timeText = document.createTextNode(' ');

body.setAttribute('style', 'background-color:#272822');

container.setAttribute('style', //vertically centre that fool
	'position: absolute;' +
	'top: 50%;' +
	'margin-top: -200px;' +
	'left: 0;' +
	'width: 100%;');

clockHolder.setAttribute('style',
	'font-size: 10rem;' +
	'color: #dfdfdf;' +
	'width: 400px;' +
	'margin: auto;' +
	'height: 400px;' +
	'font-weight: lighter;' +
	'font-family: "Segoe UI","Trebuchet MS",Trebuchet,Verdana,Helvetica,Arial,sans-serif');

// currentTime.setAttribute('style',
// 	'float: left;' +
// 	'width: 600px;' + //fix this
// 	'border-bottom: 1px solid #FF4800;');

currentTime.appendChild(timeText);
clockHolder.appendChild(currentTime);
container.appendChild(clockHolder);
body.appendChild(container);

var update = function() {
	var date = new Date();
	var dateString = date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1');
	var millis = date.getMilliseconds();

	currentTime.removeChild(timeText);
	timeText = document.createTextNode(dateString);
	currentTime.appendChild(timeText);

	window.setTimeout(update, 1000 - millis);
};
<commit_msg>feat(Script): Updates appended styles<commit_after>// ==UserScript==
// @name        about:newtab clock
// @namespace   http://jordanrobinson.co.uk
// @description A simple, dark themed clock to show on open of a new tab.
// @include     about:blank
// @exclude     http://*
// @version     0.5.0
// @grant       none
// ==/UserScript==

var body = document.getElementsByTagName('body')[0];
var container = document.createElement('div');
var clockHolder = document.createElement('div');
var currentTime = document.createElement('span');
var timeText = document.createTextNode(' ');

body.setAttribute('style', 'background-color:#272822');

container.setAttribute('style',
  // Vertically centre that fool!
  'position: absolute;' +
  'top: 50%;' +
  'left: 50%;' +
  'text-align: center;' +
  'transform: translate(-50%,-50%);' +
  'width: 100%;'
  );

clockHolder.setAttribute('style',
  'color: #DFDFDF;' +
  'font-family: "Segoe UI","Trebuchet MS",Trebuchet,Verdana,Helvetica,Arial,sans-serif' +
	'font-size: 10rem;' +
  'font-weight: lighter;'
  );

currentTime.appendChild(timeText);
clockHolder.appendChild(currentTime);
container.appendChild(clockHolder);
body.appendChild(container);

var update = function() {
	var date = new Date();
	var dateString = date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1');
	var millis = date.getMilliseconds();

	currentTime.removeChild(timeText);
	timeText = document.createTextNode(dateString);
	currentTime.appendChild(timeText);

	window.setTimeout(update, 1000 - millis);
};

{'fraction_non_alphanumeric': 0.18365414957399812, 'fraction_numerical': 0.02335121489428842, 'mean_word_length': 4.701438848920863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7019908', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1062, 'n_words': 218}