tutorial oldalak kesz
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,11 +1,31 @@
|
|||||||
"use sctrict"
|
"use sctrict"
|
||||||
//adatok
|
//adatok
|
||||||
tutorial_opciok = ["html", "css", "javascript", "c#", "php"];
|
let tutorial_opciok = ["html", "css", "javascript", "c#", "php"];
|
||||||
|
|
||||||
let html = {
|
let html = {
|
||||||
links: ["https://www.w3schools.com/html/default.asp", "https://html.com","https://www.codecademy.com"],
|
links: ["https://www.w3schools.com/html/default.asp", "https://html.com","https://www.codecademy.com"],
|
||||||
names: ["w3schools", "html.com", "codeacademy"]
|
names: ["w3schools", "html.com", "codeacademy"]
|
||||||
};
|
};
|
||||||
|
let css = {
|
||||||
|
links: ["https://www.w3schools.com/css/default.asp", "https://www.sololearn.com/learning/1023","https://www.freecodecamp.org/learn/"],
|
||||||
|
names: ["w3schools", "sololearn", "freecodecamp"]
|
||||||
|
};
|
||||||
|
let javascript = {
|
||||||
|
links: ["https://www.w3schools.com/js/default.asp", "https://javascript.info/","https://www.codecademy.com"],
|
||||||
|
names: ["w3schools", "javascript.info", "codeacademy"]
|
||||||
|
};
|
||||||
|
let csharp = {
|
||||||
|
links: ["https://www.w3schools.com/cs/default.asp", "https://www.tutorialsteacher.com/csharp","https://www.codecademy.com"],
|
||||||
|
names: ["w3schools", "tutorials teacher", "codeacademy"]
|
||||||
|
};
|
||||||
|
let php = {
|
||||||
|
links: ["https://www.w3schools.com/php/default.asp", "https://www.php.net/manual/en/index.php","https://www.codecademy.com"],
|
||||||
|
names: ["w3schools", "php manual", "codeacademy"]
|
||||||
|
};
|
||||||
|
|
||||||
|
let nyelvek = [html, css, javascript, csharp, php];
|
||||||
|
|
||||||
|
let first_call = true;
|
||||||
|
|
||||||
function navOpciokLetrehozas(){
|
function navOpciokLetrehozas(){
|
||||||
let option;
|
let option;
|
||||||
@@ -14,11 +34,8 @@ function navOpciokLetrehozas(){
|
|||||||
option = document.createElement("li");
|
option = document.createElement("li");
|
||||||
option.setAttribute("id", tutorial_opciok[i]+"-item");
|
option.setAttribute("id", tutorial_opciok[i]+"-item");
|
||||||
let button = document.createElement("button");
|
let button = document.createElement("button");
|
||||||
button.setAttribute("onclick", "fuggvenyAmiLetrehozzaAdiveket()");
|
button.setAttribute("onclick", "divForLanguage(this)");
|
||||||
/*ha rakkatintok a gombra meghivja a fuggvenyt ami letrehozza a
|
button.setAttribute("value", i);
|
||||||
megfelelo diveket a linkekhez es torli a mar letrehozott diveket
|
|
||||||
ha nincs meg letrehozva egy sem azt is vegye figyelembe
|
|
||||||
*/
|
|
||||||
option.appendChild(button);
|
option.appendChild(button);
|
||||||
let text = document.createTextNode(tutorial_opciok[i]);
|
let text = document.createTextNode(tutorial_opciok[i]);
|
||||||
button.appendChild(text);
|
button.appendChild(text);
|
||||||
@@ -26,31 +43,33 @@ function navOpciokLetrehozas(){
|
|||||||
optionlist.appendChild(option);
|
optionlist.appendChild(option);
|
||||||
console.log(tutorial_opciok + " list item created");
|
console.log(tutorial_opciok + " list item created");
|
||||||
}
|
}
|
||||||
console.log("Divek letrehozasa");
|
|
||||||
divLetrehozas();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function divLetrehozas(){
|
function divForLanguage(button){
|
||||||
let option;
|
let main_div;
|
||||||
let index = 0;
|
let nyelvek_div = document.getElementById("nyelvek");
|
||||||
|
if(!first_call){
|
||||||
|
document.getElementById("nyelvek").removeChild(nyelvek_div.firstChild);
|
||||||
|
}else{
|
||||||
|
first_call = false;
|
||||||
|
}
|
||||||
|
|
||||||
for(let i = 0; i < 1; i++){ //vissza irni tutorial opciok lengtre ||teszteles miatt atirva
|
main_div = document.createElement("div");
|
||||||
option = document.createElement("div");
|
main_div.setAttribute("id", tutorial_opciok[button.value]);
|
||||||
option.setAttribute("class", tutorial_opciok[i]); //legorgeteshez a listabol
|
|
||||||
for(let j = 0; j < html.links.length; j++){
|
for(let i = 0; i < nyelvek[button.value].names.length; i++){
|
||||||
let div = document.createElement("div");
|
let div = document.createElement("div");
|
||||||
div.setAttribute("id", html.names[index]);
|
div.setAttribute("id", nyelvek[button.value].names[i]);
|
||||||
let link = document.createElement("a");
|
let link = document.createElement("a");
|
||||||
link.setAttribute("href", html.links[index]);
|
link.setAttribute("href", nyelvek[button.value].links[i]);
|
||||||
link.setAttribute("target", "_blank");
|
link.setAttribute("target", "_blank");
|
||||||
div.appendChild(link);
|
div.appendChild(link);
|
||||||
let text = document.createTextNode(html.names[index]);
|
let text = document.createTextNode(nyelvek[button.value].names[i]);
|
||||||
link.appendChild(text);
|
link.appendChild(text);
|
||||||
option.appendChild(div);
|
main_div.appendChild(div);
|
||||||
index++;
|
|
||||||
}
|
|
||||||
let main_div = document.getElementById("nyelvek");
|
|
||||||
main_div.appendChild(option);
|
|
||||||
index = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(main_div);
|
||||||
|
|
||||||
|
nyelvek_div.appendChild(main_div);
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ body{
|
|||||||
|
|
||||||
li{
|
li{
|
||||||
float: left;
|
float: left;
|
||||||
margin: 5%;
|
margin: 6%;
|
||||||
padding: 1.3%;
|
padding: 1.3%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
@@ -39,12 +39,20 @@ a:active {
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.html div a{
|
#nyelvek div div{
|
||||||
|
float: left;
|
||||||
|
margin: 5%;
|
||||||
|
margin-left: 13%;
|
||||||
|
padding: 2%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nyelvek div div a {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button{
|
button{
|
||||||
border: none;
|
border: none;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|||||||
Reference in New Issue
Block a user