You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
/** |
|
**- |
|
* JavaScript to go laong with my experimentalr |
|
* grid layout1 |
|
* |
|
* Author - Philip Osztromok |
|
* |
|
* 3 May 2024 |
|
*+ |
|
*/ |
|
|
|
function global_menu() { |
|
const new_menu = ["Android", "Linux", "Programming", "Raspberry Pi", "Web Development", "In Progress", "Hungary", "Japan", "Home"]; |
|
const new_menu_links = ["/android/android.html", "/linux/linux.html", "/programming/programming.html", "/raspberrypi/raspberrypi.html", "/webdevelopment/webdevelopment.html", "/temp/temp.html", "/hungary/hungary.html", "/japan/japan.html", "/index.html"]; |
|
const global = document.createElement("div"); |
|
|
|
for (let index=0; index < new_menu.length; index++) { |
|
var link = document.createElement("a"); |
|
link.innerHTML = new_menu[index]; |
|
link.setAttribute("href", new_menu_links[index]); |
|
// console.log("The link is", link); |
|
global.append(link); |
|
} |
|
|
|
return global; |
|
} |
|
|
|
function local_menu(menu, menu_links, base_link) { |
|
const new_menu = document.createElement("div"); |
|
for (let index=0; index < new_menu.length; index++) { |
|
var link = document.createElement("a"); |
|
link.innerHTML = menu[index]; |
|
link.setAttribute("href", base_link+menu_links[index]+".html"); |
|
new_menu.append(link); |
|
} |
|
|
|
return new_menu; |
|
} |
|
|
|
|
|
export { global_menu, local_menu } |
|
|
|
/* |
|
* |
|
* helper functions |
|
* |
|
*/ |
|
|
|
|