-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homework№5.OR-Media.Pre-front #11
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" type="text/css" href="./index.css" /> | ||
<title>Request</title> | ||
</head> | ||
|
||
<body> | ||
<script src="./script.js"></script> | ||
</body> | ||
|
||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var Name = prompt('Введите ваше имя'); | ||
var reg = /\d/g; | ||
if (Name.match(reg) === null) { | ||
function reverse(Name) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. нет смысла написание функции в |
||
return Name.split("").reverse().join(""); | ||
} | ||
alert(reverse(Name)); | ||
} | ||
else { | ||
function toUpperCase(Name) { | ||
return Name.split('').map((v, i) => i % 2 == 0 ? v.toLowerCase() : v.toUpperCase()).join(''); | ||
} | ||
alert(toUpperCase(Name)); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.ButtonLink{ | ||
height: 100px; | ||
width: 100px; | ||
background-color: blue; | ||
} | ||
.ButtonStyle{ | ||
height: 100px; | ||
width: 100px; | ||
background-color: green; | ||
} | ||
|
||
|
||
.ButtonMaket{ | ||
height: 100px; | ||
width: 100px; | ||
background-color: yellow; | ||
} | ||
.container{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-flow: wrap; | ||
width: 100%; | ||
height: 1000px; | ||
background-color: wheat; | ||
} | ||
.Top{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; | ||
width: 100%; | ||
background-color: brown; | ||
font-weight: 700; | ||
font-size: 50px; | ||
} | ||
.Bottom{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; | ||
width: 100%; | ||
background-color: violet; | ||
font-weight: 700; | ||
font-size: 50px; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.ButtonLink{ | ||
height: 100px; | ||
width: 100px; | ||
background-color: blue; | ||
} | ||
.ButtonStyle{ | ||
height: 100px; | ||
width: 100px; | ||
background-color: green; | ||
} | ||
.ButtonMaket{ | ||
height: 100px; | ||
width: 100px; | ||
background-color: yellow; | ||
} | ||
.container{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-flow: wrap; | ||
width: 100%; | ||
height: 1000px; | ||
background-color: white; | ||
} | ||
.Top{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; | ||
width: 100%; | ||
background-color: aqua; | ||
font-weight: 700; | ||
font-size: 50px; | ||
} | ||
.Bottom{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; | ||
width: 100%; | ||
background-color: cornflowerblue; | ||
font-weight: 700; | ||
font-size: 50px; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
*{ | ||
margin: 0; | ||
} | ||
.Container{ | ||
width: 100%; | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-ms-flex-flow: wrap; | ||
flex-flow: wrap; | ||
-ms-flex-line-pack: start; | ||
align-content: flex-start; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
} | ||
|
||
.Header{ | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
width: 100%; | ||
height: 10%; | ||
background-color: rgba(0,0,0,0.7); | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
border-bottom-left-radius: 10px; | ||
border-bottom-right-radius: 10px; | ||
margin-bottom: 0.9%; | ||
} | ||
|
||
.Body{ | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 77%; | ||
background-color: rgba(0,0,0,0.3); | ||
border-radius: 10px; | ||
margin-bottom: 10px; | ||
font-size: 50px; | ||
font-weight: bold; | ||
} | ||
|
||
|
||
.Footer{ | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 10%; | ||
background-color: black; | ||
color: white; | ||
border-top-left-radius: 10px; | ||
border-top-right-radius: 10px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<link name="Link" class="Slava" rel="stylesheet" type="text/css" href="./css/FirstStyle.css" /> | ||
<title>Three Buttons</title> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class=Top> | ||
<span class="TopText">Top</span> | ||
</div> | ||
<button class="ButtonLink" type="submit">LINK</button> | ||
<button class="ButtonStyle" type="submit">STYLE</button> | ||
<button class="ButtonMaket" type="submit">MAKET</button> | ||
<script src="./js/index.js"></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. подключение скриптов делается в конце |
||
<div class="Bottom"> | ||
<span class="BottomText">Bottom</span> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
document.getElementsByClassName("ButtonLink")[0].onclick = function () { window.open("https://vk.com/white_power69", "_blank") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. лучше использовать There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. такого рода строки ( |
||
document.getElementsByClassName("ButtonStyle")[0].onclick = function () { | ||
var el = document.querySelector("Link"); | ||
if (el.className == "Slava") { | ||
el.href = "./css/SecondStyle.css"; | ||
el.className = "NotSlava"; | ||
} | ||
else { | ||
el.href = "./css/FirstStyle.css"; | ||
el.className = "Slava"; | ||
} | ||
} | ||
document.getElementsByClassName("ButtonMaket")[0].onclick = function () { | ||
var Cont = document.querySelector(".container") | ||
Cont.remove(); | ||
var el = document.querySelector("Link"); | ||
el.href = "./css/ThirdStyle.css"; | ||
var Body = document.body; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. повторяющийся код можно вынести в функцию. Отличаться будут только параметры. |
||
var Container = document.createElement("div"); | ||
Body.appendChild(Container); | ||
Container.className = "Container"; | ||
var Header = document.createElement("div"); | ||
Body.appendChild(Header); | ||
Header.className = "Header"; | ||
var Telo = document.createElement("div"); | ||
Body.appendChild(Telo); | ||
Telo.className = "Body"; | ||
var pTelo = document.createElement("p"); | ||
pTelo.innerHTML = "Otrisovka maketa flexbox"; | ||
Telo.appendChild(pTelo); | ||
var Footer = document.createElement("div"); | ||
Body.appendChild(Footer); | ||
Footer.className = "Footer"; | ||
|
||
} | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
проверять на
null
не нужно это и такfalse
будет значение. можно переписать как!Name.match(reg)