Commit e857d332 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

MLAB-205: update images and positioning

parent d45b7fcf
...@@ -59,18 +59,23 @@ function head() { ...@@ -59,18 +59,23 @@ function head() {
alertbutton.setAttribute("data-dismiss", "alert"); alertbutton.setAttribute("data-dismiss", "alert");
alertbutton.innerHTML = "×"; alertbutton.innerHTML = "×";
prependChild(alertdiv, alertbutton); prependChild(alertdiv, alertbutton);
// navigation header // navigation header
let navbar = document.createElement("nav"); let navbar = document.createElement("nav");
navbar.classList.add("navbar", "navbar-expand-md", "navbar-light"); navbar.classList.add("navbar", "navbar-expand-md", "navbar-light");
navbar.style = "background-color: #ffffff;"; navbar.style = "background-color: #ffffff;";
let fluiddiv = document.createElement("div");
fluiddiv.classList.add("container-fluid", "navbar-header"); let navbarcontainer = document.createElement("div");
navbarcontainer.classList.add("container");
let navbarheader = document.createElement("div");
navbarheader.classList.add("navbar-header");
// navigation header - logo // navigation header - logo
let link_m4lab = document.createElement('a'); let link_m4lab = document.createElement('a');
link_m4lab.href = "/"; link_m4lab.href = "/";
link_m4lab.classList.add("navbar-brand"); link_m4lab.classList.add("navbar-brand");
link_m4lab.innerHTML = "<img src='images/demo/m4lab_logo.jpg' alt='Logo Innovationslabor M4_LAB'>"; link_m4lab.innerHTML = "<img src='img/header/Logozeile_Header.png' alt='Logo Innovationslabor M4_LAB'>";
navbarheader.appendChild(link_m4lab);
// navigation header - toggle button menu for mobile devices // navigation header - toggle button menu for mobile devices
let togglebutton = document.createElement('button'); let togglebutton = document.createElement('button');
togglebutton.classList.add("navbar-toggler") togglebutton.classList.add("navbar-toggler")
...@@ -81,13 +86,10 @@ function head() { ...@@ -81,13 +86,10 @@ function head() {
togglebutton.setAttribute("aria-expanded", "false"); togglebutton.setAttribute("aria-expanded", "false");
togglebutton.setAttribute("aria-label", "Toggle navigation"); togglebutton.setAttribute("aria-label", "Toggle navigation");
togglebutton.innerHTML = "<span class='navbar-toggler-icon'></span>"; togglebutton.innerHTML = "<span class='navbar-toggler-icon'></span>";
// navigation header - menu // nav menu
let navbardiv = document.createElement("div");
navbardiv.classList.add("collapse", "navbar-collapse");
navbardiv.id = "navbarCollapse"
let navelements = document.createElement('ul'); let navelements = document.createElement('ul');
navelements.id="navelemente"; navelements.id="navbarCollapse";
navelements.classList.add("navbar-nav", "mr-auto"); navelements.classList.add("collapse", "nav", "navbar-collapse", "navbar-nav", "justify-content-end");
for(let j = 0; j<menu.length; j++){ for(let j = 0; j<menu.length; j++){
let headitem = document.createElement('li'); let headitem = document.createElement('li');
let itemtype = menu[j].type; let itemtype = menu[j].type;
...@@ -122,12 +124,11 @@ function head() { ...@@ -122,12 +124,11 @@ function head() {
prependChild(headitem, headlink) prependChild(headitem, headlink)
navelements.appendChild(headitem); navelements.appendChild(headitem);
} }
navbardiv.appendChild(navelements);
fluiddiv.appendChild(link_m4lab); navbarcontainer.appendChild(navbarheader);
fluiddiv.appendChild(togglebutton); navbarcontainer.appendChild(togglebutton);
fluiddiv.appendChild(navbardiv); navbarcontainer.appendChild(navelements);
navbar.appendChild(fluiddiv); navbar.appendChild(navbarcontainer)
navheader.appendChild(alertdiv); navheader.appendChild(alertdiv);
navheader.appendChild(navbar); navheader.appendChild(navbar);
...@@ -138,26 +139,42 @@ function head() { ...@@ -138,26 +139,42 @@ function head() {
* creates footer and appends it to the documents body * creates footer and appends it to the documents body
*/ */
function foot(){ function foot() {
let footerdiv = document.createElement('div'); let footerdiv = document.createElement('div');
footerdiv.id="homepage"; footerdiv.id="homepage";
footerdiv.classList.add("last", "clear"); footerdiv.classList.add("last", "clear");
footerdiv.innerHTML = "<hr>"; footerdiv.innerHTML = "<hr>";
let containerdiv = document.createElement('div'); let containerdiv = document.createElement('div');
containerdiv.classList.add('container-fluid'); containerdiv.classList.add('container');
let containerdivrow = document.createElement('div'); let containerdivrow = document.createElement('div');
containerdivrow.classList.add('row'); containerdivrow.classList.add('row');
let hftlink = document.createElement('a');
hftlink.classList.add("col-md-3"); //bmbf
hftlink.href="https://www.hft-stuttgart.de"; let bmbf = document.createElement('div');
let hftimage = document.createElement('img'); bmbf.classList.add("col-md-auto");
hftimage.src="images/demo/hft_logo.jpg"; bmbf.innerHTML = "<img src='img/footer/Innovative_Hochschule_Initiative_BMBF_GWK_RGB.png' alt='Innovative Hochschule' style='height:90px'/>"
hftimage.alt="Logo der Hochschule für Technik Stuttgart"; //m4labgrau
hftimage.height= '75'; let m4labgrau = document.createElement('div');
hftlink.appendChild(hftimage); m4labgrau.classList.add("col-md-auto");
containerdivrow.appendChild(hftlink); m4labgrau.innerHTML = "<img src='img/footer/M4_LAB_LOGO_Graustufen.png' alt='M4_LAB' style='height:80px'/>"
// socmed
let socialdiv = document.createElement('div');
socialdiv.classList.add("col-md-auto");
let socialrow = document.createElement('div');
socialrow.id="socialmediabuttons";
for(let j = 0; j< socialmedias.length; j++){
let sociallink = document.createElement('a');
sociallink.href = socialmedias[j].url;
let socialcontent = document.createElement('i');
socialcontent.classList.add("fab", socialmedias[j].name);
sociallink.appendChild(socialcontent);
socialrow.appendChild(sociallink);
socialrow.innerHTML+="&nbsp;";
}
socialdiv.appendChild(socialrow);
// contact
let contactdiv = document.createElement('div'); let contactdiv = document.createElement('div');
contactdiv.classList.add("col-md-3", "footer-unten") contactdiv.classList.add("col-md-auto", "footer-unten")
contactdiv.innerHTML="Hochschule für Technik Stuttgart"; contactdiv.innerHTML="Hochschule für Technik Stuttgart";
let rowdiv = document.createElement('div'); let rowdiv = document.createElement('div');
rowdiv.classList.add("row"); rowdiv.classList.add("row");
...@@ -172,38 +189,16 @@ function foot(){ ...@@ -172,38 +189,16 @@ function foot(){
rowdiv.appendChild(coldiv); rowdiv.appendChild(coldiv);
} }
contactdiv.appendChild(rowdiv); contactdiv.appendChild(rowdiv);
containerdivrow.appendChild(contactdiv);
let socialdiv = document.createElement('div'); containerdivrow.appendChild(bmbf);
socialdiv.classList.add("col-md-3"); containerdivrow.appendChild(m4labgrau);
let socialrow = document.createElement('div');
socialrow.id="socialmediabuttons";
for(let j = 0; j< socialmedias.length; j++){
let sociallink = document.createElement('a');
sociallink.href = socialmedias[j].url;
let socialcontent = document.createElement('i');
socialcontent.classList.add("fab", socialmedias[j].name);
sociallink.appendChild(socialcontent);
socialrow.appendChild(sociallink);
socialrow.innerHTML+="&nbsp;";
}
socialdiv.appendChild(socialrow);
containerdivrow.appendChild(socialdiv); containerdivrow.appendChild(socialdiv);
let imagediv = document.createElement('div'); containerdivrow.appendChild(contactdiv);
imagediv.classList.add("col-md-3");
for (let k = 0; k< footer_images.length; k++){
let image = document.createElement('img');
image.src = footer_images[k].src;
image.width="300";
image.height= "73";
image.alt = footer_images[k].alt;
imagediv.appendChild(image);
}
containerdivrow.appendChild(imagediv);
containerdiv.appendChild(containerdivrow); containerdiv.appendChild(containerdivrow);
footerdiv.appendChild(containerdiv); footerdiv.appendChild(containerdiv);
document.body.appendChild(footerdiv); document.body.appendChild(footerdiv);
}; }
head(); head();
foot(); foot();
Supports Markdown
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