Commit 3ba8ecf3 authored by Athanasios's avatar Athanasios
Browse files

Add base url

parent dd3ba8d4
Pipeline #2195 passed with stages
in 28 seconds
...@@ -20,7 +20,6 @@ test-job: ...@@ -20,7 +20,6 @@ test-job:
only: only:
- master - master
pages: pages:
stage: deploy stage: deploy
script: script:
......
let portal=function(){document.querySelector("title").innerText="M4_LAB";let e=document.createElement("a");e.href="https://hft-stuttgart.de",e.innerHTML="<img src='/assets/images/hft_logo.svg'/>",document.getElementById("logo").appendChild(e);let t=(e,t,l={},a=null)=>{let i=document.createElement(e);for(cls of t)i.classList.add(cls);return Object.keys(l).forEach(e=>{i.setAttribute(e,l[e])}),a&&(i.innerText=a),i},l=e=>{let l=t("div",["participant-social"]);for(i of e){let e=t("a",["social"],{title:i.agent,href:i.profile}),a=t("img",[],{src:i.icon});e.appendChild(a),l.appendChild(e)}return l},a={projectName:()=>{document.querySelector("#projectname").innerHTML=settings.projectName},menu:()=>{let e=document.createElement("ul");for(m of settings.menu){let l=document.createElement("li"),a=t("a",[],{href:m.link},m.menuText);l.appendChild(a),e.appendChild(l)}let l=document.querySelector("nav");l.appendChild(e);let a=document.querySelector(".hamburger");a.style.display="flex";let i=document.querySelector("header");a.addEventListener("click",()=>{a.classList.toggle("slide-hamburger"),l.classList.toggle("slide-nav"),i.classList.toggle("overflow-visible")})},participants:()=>{let e=document.querySelector(".footer"),a=t("ul",["footer-participants-container"]);for(p of settings.participants){let e=t("li",["participant"]),i=t("div",["participant-avatar"]),n=t("img",[],{src:p.avatar}),r=t("div",[],{},p.name),o=t("div",[],{},p.email);i.appendChild(n),e.appendChild(i),e.appendChild(r),e.appendChild(o),e.appendChild(l(p.social)),a.appendChild(e)}e.appendChild(a)},footerLogos:()=>{let e=document.querySelector(".footer"),l=t("ul",["footer-logo-container"]);for(fl of settings.footerLogos){let e=t("li",["footer-logo"]),a=t("a",[],{title:fl.title,href:fl.href}),i=t("img",[],{src:fl.logo});a.appendChild(i),e.appendChild(a),l.appendChild(e)}e.appendChild(l)}};for(swt of settings.switches)swt.state==ON&&a[swt.name]();let n={legal:()=>{let e=document.querySelector(".legal"),l=t("div",["legal-text-container"]),a=t("div",["legal-text"],{},"Hochschule für Technik Stuttgart"),i=t("a",["legal-text"],{href:"https://www.hft-stuttgart.de/impressum"},"Impressum"),n=t("a",["legal-text"],{href:"https://www.hft-stuttgart.de/datenschutz"},"Datenschutz"),r=t("div",["top"],{}),o=t("a",[],{href:"#header",title:"Top"}),d=t("img",[],{src:"/assets/images/top.png"});o.appendChild(d),r.appendChild(o),l.appendChild(a),l.appendChild(i),l.appendChild(n),e.appendChild(l),e.appendChild(r)}};Object.keys(n).forEach(e=>{n[e]()})}(); let portal=function(){document.querySelector("title").innerText="M4_LAB";let e=document.createElement("a");e.href="https://hft-stuttgart.de",e.innerHTML=`<img src='${BASE_URL}/assets/images/hft_logo.svg'/>`,document.getElementById("logo").appendChild(e);let t=(e,t,l={},a=null)=>{let i=document.createElement(e);for(cls of t)i.classList.add(cls);return Object.keys(l).forEach(e=>{i.setAttribute(e,l[e])}),a&&(i.innerText=a),i},l=e=>{let l=t("div",["participant-social"]);for(i of e){let e=t("a",["social"],{title:i.agent,href:i.profile}),a=t("img",[],{src:i.icon});e.appendChild(a),l.appendChild(e)}return l},a={projectName:()=>{document.querySelector("#projectname").innerHTML=settings.projectName},menu:()=>{let e=document.createElement("ul");for(m of settings.menu){let l=document.createElement("li"),a=t("a",[],{href:m.link},m.menuText);l.appendChild(a),e.appendChild(l)}let l=document.querySelector("nav");l.appendChild(e);let a=document.querySelector(".hamburger");a.style.display="flex";let i=document.querySelector("header");a.addEventListener("click",()=>{a.classList.toggle("slide-hamburger"),l.classList.toggle("slide-nav"),i.classList.toggle("overflow-visible")})},participants:()=>{let e=document.querySelector(".footer"),a=t("ul",["footer-participants-container"]);for(p of settings.participants){let e=t("li",["participant"]),i=t("div",["participant-avatar"]),n=t("img",[],{src:p.avatar}),r=t("div",[],{},p.name),o=t("div",[],{},p.email);i.appendChild(n),e.appendChild(i),e.appendChild(r),e.appendChild(o),e.appendChild(l(p.social)),a.appendChild(e)}e.appendChild(a)},footerLogos:()=>{let e=document.querySelector(".footer"),l=t("ul",["footer-logo-container"]);for(fl of settings.footerLogos){let e=t("li",["footer-logo"]),a=t("a",[],{title:fl.title,href:fl.href}),i=t("img",[],{src:fl.logo});a.appendChild(i),e.appendChild(a),l.appendChild(e)}e.appendChild(l)}};for(swt of settings.switches)swt.state==ON&&a[swt.name]();let n={legal:()=>{let e=document.querySelector(".legal"),l=t("div",["legal-text-container"]),a=t("div",["legal-text"],{},"Hochschule für Technik Stuttgart"),i=t("a",["legal-text"],{href:"https://www.hft-stuttgart.de/impressum"},"Impressum"),n=t("a",["legal-text"],{href:"https://www.hft-stuttgart.de/datenschutz"},"Datenschutz"),r=t("div",["top"],{}),o=t("a",[],{href:"#header",title:"Top"}),d=t("img",[],{src:`${BASE_URL}/assets/images/top.png`});o.appendChild(d),r.appendChild(o),l.appendChild(a),l.appendChild(i),l.appendChild(n),e.appendChild(l),e.appendChild(r)}};Object.keys(n).forEach(e=>{n[e]()})}();
\ No newline at end of file \ No newline at end of file
const BASE_URL = `${window.location.origin}/${window.location.pathname.split('/').filter((e, i)=>{return i>0 & i<4}).join('/')}`;
const ON = true; const ON = true;
const OFF = false; const OFF = false;
const EMPTY_LINK = "javascript:undefined"; const EMPTY_LINK = "javascript:undefined";
const DEFAULT = { const DEFAULT = {
social: { social: {
twitter: { twitter: {
icon: "/assets/images/twitter.png", icon: `${BASE_URL}/assets/images/twitter.png`,
profile: "https://twitter.com/InnolabM4" profile: "https://twitter.com/InnolabM4"
}, },
facebook: { facebook: {
icon: "/assets/images/facebook.png", icon: `${BASE_URL}/assets/images/facebook.png`,
profile: "https://www.facebook.com/HfTStuttgart" profile: "https://www.facebook.com/HfTStuttgart"
}, },
linkedin: { linkedin: {
icon: "/assets/images/linkedin.png", icon: `${BASE_URL}/assets/images/linkedin.png`,
profile: "https://www.linkedin.com/school/hochschule-f%C3%BCr-technik-stuttgart-%E2%80%93-university-of-applied-sciences" profile: "https://www.linkedin.com/school/hochschule-f%C3%BCr-technik-stuttgart-%E2%80%93-university-of-applied-sciences"
}, },
webpage: { webpage: {
icon: "/assets/images/webpage.png", icon: `${BASE_URL}/assets/images/webpage.png`,
profile: "https://www.hft-stuttgart.de" profile: "https://www.hft-stuttgart.de"
} }
}, },
avatar: "/assets/images/avatar.png" avatar: `${BASE_URL}/assets/images/avatar.png`
} };
let settings = { let settings = {
...@@ -49,11 +50,11 @@ let settings = { ...@@ -49,11 +50,11 @@ let settings = {
menu: [ menu: [
{ {
menuText: "home", menuText: "home",
link: "/home" link: `${BASE_URL}/home`
}, },
{ {
menuText: "bio", menuText: "bio",
link: "/bio" link: `${BASE_URL}/bio`
}, },
{ {
menuText: "demo", menuText: "demo",
...@@ -64,7 +65,7 @@ let settings = { ...@@ -64,7 +65,7 @@ let settings = {
participants: [ participants: [
{ {
name: "Charlotte Doe", name: "Charlotte Doe",
avatar: "/assets/images/charlotte.jpg", avatar: `${BASE_URL}/assets/images/charlotte.jpg`,
email: "charlotte.doe@lalaland.com", email: "charlotte.doe@lalaland.com",
social: [ social: [
{ {
...@@ -93,22 +94,22 @@ let settings = { ...@@ -93,22 +94,22 @@ let settings = {
footerLogos: [ footerLogos: [
{ {
logo: "/assets/logos/Logo_M4_LAB.jpg", logo: `${BASE_URL}/assets/logos/Logo_M4_LAB.jpg`,
href: EMPTY_LINK, href: EMPTY_LINK,
title: "M4_LAB" title: "M4_LAB"
}, },
{ {
logo: "/assets/logos/logo1.png", logo: `${BASE_URL}/assets/logos/logo1.png`,
href: "http://www.innovative-hochschule.de", href: "http://www.innovative-hochschule.de",
title: "Innovative Hochschule" title: "Innovative Hochschule"
}, },
{ {
logo: "/assets/logos/logo2.png", logo: `${BASE_URL}/assets/logos/logo2.png`,
href: "https://www.bmbf.de", href: "https://www.bmbf.de",
title: "Bundesministerium für Bildung und Forschung" title: "Bundesministerium für Bildung und Forschung"
}, },
{ {
logo: "/assets/logos/logo3.png", logo: `${BASE_URL}/assets/logos/logo3.png`,
href: "https://www.gwk-bonn.de", href: "https://www.gwk-bonn.de",
title: "Die Gemeinsame Wissenschaftskonferenz" title: "Die Gemeinsame Wissenschaftskonferenz"
} }
......
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