Commit 3f5e2cd7 authored by Sanjit Singh Chouhan's avatar Sanjit Singh Chouhan

UI Fix

parent 2fd50e41
......@@ -14,7 +14,7 @@
"content_scripts": [
{
"matches": ["*://*.swecha.io/*"],
"matches": ["*://*.swecha.io/*","*://code.swecha.org/*"],
"js": ["summerofdata.js"]
}
]
......
......@@ -18,21 +18,25 @@ function timeDifferene(t1, t2) {
var timers = document.createElement('div');
timers.style.cssFloat = 'left';
timers.style.padding = '5px';
timers.style.paddingRight = '5px';
timers.style.cssFloat = 'right';
timers.style.display = 'inline';
banner.appendChild(timers);
var current_time = document.createElement('div');
timers.appendChild(current_time);
banner.appendChild(current_time);
current_time.style.cssFloat = 'left';
current_time.style.paddingLeft = '10px';
setInterval(function () {
while (current_time.firstChild) {
current_time.removeChild(current_time.firstChild);
}
var time_text = new Date().toLocaleString('In');
current_time.appendChild(document.createTextNode('Time: ' + time_text));
var now = new Date();
var date_text = now.toDateString();
var time_text = now.getHours() + ' Hours ' + now.getMinutes() + ' Minutes ' + now.getSeconds() + ' Seconds';
current_time.appendChild(document.createTextNode(date_text + ' ' + time_text));
}, 1000);
......@@ -55,7 +59,7 @@ var time_remaining = document.createElement('span');
timers.appendChild(time_remaining);
time_remaining.style.paddingLeft = '10px';
var endTime = new Date("June 25, 2018 09:00:00").getTime();
var endTime = new Date("June 26, 2018 09:00:00").getTime();
setInterval(function () {
while (time_remaining.firstChild) {
......@@ -66,57 +70,105 @@ setInterval(function () {
}, 1000);
banner.style.background = 'white';
banner.style.height = '50px';
banner.style.color = 'black';
banner.style.fontSize = '25px';
banner.style.padding = '5px';
banner.className = 'summer-of-data';
/**
* logo
* Buttons & Links
* */
// var logo = document.createElement('img');
// logo.style.display = 'inline';
// logo.src = browser.extension.getURL('logo_large.png');
// banner.appendChild(logo);
var btns_div = document.createElement('div');
btns_div.className = 'summer-of-data';
btns_div.style.backgroundColor = 'black';
btns_div.style.color = 'white !important';
btns_div.style.fontSize = '1.5em';
btns_div.style.alignSelf = 'center';
btns_div.style.alignContent = 'center';
btns_div.style.height = '100px';
btns_div.style.width = '100%';
var left_btn_div = document.createElement("div");
left_btn_div.style.cssFloat = "left";
left_btn_div.style.marginLeft = "30px";
btns_div.appendChild(left_btn_div);
var instructions = document.createElement('a');
// instructions.style.margin = '50px';
var instruction_text = document.createElement('h6');
instruction_text.appendChild(document.createTextNode('Instructions'));
instructions.appendChild(instruction_text);
instruction_text.style.color = 'white';
instruction_text.style.display = 'block';
instructions.href = 'https://code.swecha.org/sodata/meta/blob/master/instructions.md';
left_btn_div.appendChild(instructions);
var todo = document.createElement('a');
// todo.style.margin = '50px';
var todo_text = document.createElement('h6');
todo_text.appendChild(document.createTextNode('Todo'));
todo.appendChild(todo_text);
todo_text.style.display = 'block';
todo_text.style.color = 'white';
todo.href = 'https://code.swecha.org/sodata/meta/blob/master/TO-DO.md';
left_btn_div.appendChild(todo);
var contacts = document.createElement('a');
// contacts.style.margin = '50px';
var contacts_text = document.createElement('h6');
contacts_text.appendChild(document.createTextNode('Contacts'));
contacts.appendChild(contacts_text);
contacts_text.style.display = 'block';
contacts_text.style.color = 'white';
contacts.href = 'https://code.swecha.org/sodata/meta/blob/master/contacts.md';
left_btn_div.appendChild(contacts);
var right_btn_div = document.createElement("div");
right_btn_div.style.cssFloat = "right";
right_btn_div.style.marginRight = "30px";
btns_div.appendChild(right_btn_div);
var slides = document.createElement('a');
// slides.style.margin = '50px';
var slides_text = document.createElement('h6');
slides_text.appendChild(document.createTextNode('Slides'));
slides.appendChild(slides_text);
slides_text.style.display = 'block';
slides_text.style.color = 'white';
slides.href = 'https://code.swecha.org/sodata/meta/tree/master/Slides';
right_btn_div.appendChild(slides);
var projects = document.createElement('a');
var projects_text = document.createElement('h6');
projects_text.appendChild(document.createTextNode('Projects'));
projects.appendChild(projects_text);
projects_text.style.display = 'block';
projects_text.style.color = 'white';
projects.href = 'https://code.swecha.org/sodata';
right_btn_div.appendChild(projects);
var schedule_btn = document.createElement("a");
var schedule_text = document.createElement('h6');
schedule_btn.style.cursor = 'pointer';
schedule_text.appendChild(document.createTextNode('View Schedule'));
schedule_btn.appendChild(schedule_text);
schedule_text.style.color = 'white';
schedule_btn.style.display = 'block';
/**
* Schedule Button
* */
var schedule_btn = document.createElement("button");
schedule_btn.id = 'schedule_btn';
schedule_btn.appendChild(document.createTextNode("View Schedule"));
schedule_btn.style.cssFloat = 'right';
// schedule_btn.style.top = '0';
schedule_btn.style.fontSize = '0.5em';
schedule_btn.style.height = '30px';
schedule_btn.style.lineHeight = '0';
schedule_btn.style.backgroundColor = '#e1ecf4';
banner.appendChild(schedule_btn);
right_btn_div.appendChild(schedule_btn);
banner.style.background = 'white';
banner.style.height = '55px';
banner.style.color = 'black';
banner.style.fontSize = '2em';
banner.style.padding = '5px';
banner.className = 'summer-of-data';
var schedule = document.createElement("div");
schedule.className = 'summer-of-data';
schedule.style.display = 'none';
var url = browser.extension.getURL('schedule.html');
document.body.insertBefore(schedule, document.body.firstChild);
var message_div = document.createElement('div');
message_div.className = 'summer-of-data';
message_div.style.backgroundColor = 'black';
message_div.style.color = 'white !important';
message_div.style.fontSize = '1.5em';
message_div.style.height = '25px';
message_div.style.width = '100%';
document.body.insertBefore(message_div, document.body.firstChild);
document.body.insertBefore(banner, document.body.firstChild);
schedule_btn.addEventListener("click", evt => {
var children = document.getElementById('top').children;
......@@ -216,31 +268,30 @@ schedule_btn.addEventListener("click", evt => {
});
// message div
var instructions = document.createElement('a');
instructions.style.margin = '50px';
var instruction_text = document.createElement('h6');
instruction_text.appendChild(document.createTextNode('Instructions'));
instructions.appendChild(instruction_text);
instruction_text.style.display = 'inline';
instructions.href = 'https://code.swecha.org/sodata/meta/blob/master/instructions.md';
message_div.appendChild(instructions);
var logo_center = document.createElement("center");
var logo = document.createElement("h1");
logo.appendChild(document.createTextNode("Summer of Data"));
logo.style.margin = 'auto';
logo.display = 'block';
logo_center.appendChild(logo);
btns_div.appendChild(logo_center);
var todo = document.createElement('a');
todo.style.margin = '50px';
var todo_text = document.createElement('h6');
todo_text.appendChild(document.createTextNode('Todo'));
todo.appendChild(todo_text);
todo_text.style.display = 'inline';
todo.href = 'https://code.swecha.org/sodata/meta/blob/master/TO-DO.md';
message_div.appendChild(todo);
/**
*
* */
var container = document.createElement("div");
container.className = "summer-of-data";
container.appendChild(btns_div);
container.appendChild(banner);
container.style.borderTop = '2px solid white';
container.style.position = 'fixed';
container.style.width = '100%';
container.style.zIndex = '1000';
container.style.bottom = '0';
container.style.fontSize = '25px';
document.body.insertBefore(container, document.body.firstChild);
document.body.insertBefore(schedule, document.body.firstChild);
var contacts = document.createElement('a');
contacts.style.margin = '50px';
var contacts_text = document.createElement('h6');
contacts_text.appendChild(document.createTextNode('Contacts'));
contacts.appendChild(contacts_text);
contacts_text.style.display = 'inline';
contacts.href = 'https://code.swecha.org/sodata/meta/blob/master/contacts.md';
message_div.appendChild(contacts);
document.body.style.marginBottom = '150px';
\ No newline at end of file
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