Common.Js
let alt = [
'математика, русский, физика / информатика',
'математика, русский, информатика / иностранный язык',
'математика, русский, физика / информатика',
'математика, русский, физика / информатика',
'математика, русский, информатика',
'математика, русский, информатика',
'математика, русский, физика / информатика',
'русский, обществознание, иностранный язык',
'математика, русский, физика',
'математика, русский, физика / информатика',
]
document.getElementById('profession').addEventListener('change', function(e) {
console.log(e.target.value - 1);
document.getElementById('altProfession').innerHTML = 'Предметы ЕГЭ: ' + alt[e.target.value];
})
function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
function getElem(id) {
return document.getElementById(id);
}
function addData() {
fetch('randomData.php')
.then((response) => {
return response.json();
})
.then((data) => {
getElem('studentSurname').value = data.surname;
getElem('studentName').value = data.name;
getElem('studentSecondName').value = data.secondName;
getElem('phoneInput').value = data.phone;
getElem('profession').selectedIndex = data.profession;
document.getElementById('altProfession').innerHTML = 'Предметы ЕГЭ: ' + alt[data.profession - 1];
getElem('studentBirthday').value = data.birthday;
getElem('studentCountry').value = data.studentCountry;
getElem('studentCity').value = data.studentCity;
getElem('hStudentCountry').value = data.hSstudentCountry;
getElem('hStudentCity').value = data.hStudentCity;
getElem('studentStreet').value = data.studentStreet;
getElem('studentStreetNumber').value = data.studentStreetNumber;
getElem('schoolCountry').value = data.schoolCountry;
getElem('schoolCity').value = data.schoolCity;
getElem('hSchoolCountry').value = data.hSchoolCountry;
getElem('hSchoolCity').value = data.hSchoolCity;
getElem('schoolName').value = data.schoolName;
getElem('schoolNumber').value = data.schoolNumber;
getElem('schoolDate').value = data.schoolDate;
getElem('studentAchievements').selectedIndex = data.achievements;
getElem('docNumber').value = data.docNumber;
getElem('docDate').value = data.docDate;
// getElem('').value = data. ;
});
}
Common.Css
:root {
--background: #FDFBFF;
--textColor: 1B1B1D;
--accent: #005EB3;
--backgroundInput: #EEF0FA;
--backgroundInputHover: #E8EAF4;
--textOnSurface: #FDFBFF;
--contentWidth: 640px;
--inputWidth: 100%;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:visited {
color: var(--accent);
}
html, body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
font-size: 15px;
padding: 0;
margin: 0;
background-color: var(--background);
color: var(--textColor);
-webkit-font-smoothing: subpixel-antialiased;
}
h1 {
font-size: 30px;
font-weight: 800;
padding: 1rem 0 0.25rem;
}
h2 {
font-size: 20px;
font-weight: 600;
padding: 0.75rem 0 0.05rem;
}
input[type="date"] {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
cursor: pointer;
padding-top: 21px !important;
padding-bottom: 7px !important;
}
input[type="submit"],
input[type="button"] {
height: 46px;
box-sizing: border-box;
background: var(--accent);
color: var(--textOnSurface);
padding: 12px 16px;
border: 0;
border-bottom: 2px solid #004789;
font-weight: 600;
font-size: 16px;
line-height: 20px;
letter-spacing: 0.1px;
border-radius: 6px;
transition: all 80ms ease;
}
input[type="submit"]:hover,
input[type="button"]:hover {
background: #004789;
}
input[type="submit"]:active,
input[type="button"]:active {
background: #004789;
color: rgba(255, 255, 255, 0.8);
padding: 13px 16px 11px;
}
table {
font-size: 14px;
margin: 20px;
border-collapse: collapse;
border: none;
white-space: nowrap;
}
th {
font-size: 13px;
text-align: left;
padding: 6px 9px;
font-weight: 400;
color: #8E9199;
border-bottom: 1px solid #E0E2EB;
border-left: 1px solid #E0E2EB;
border-right: 1px solid #E0E2EB;
}
td {
padding: 6px 9px;
font-size: 14px;
border-bottom: 1px solid #E0E2EB;
border-left: 1px solid #E0E2EB;
border-right: 1px solid #E0E2EB;
}
tr:hover {
background: #EEF0FA;
}
table tbody th:first-child,
table tbody td:first-child {
border-left: none;
}
table tbody th:last-child,
table tbody tr td:last-child {
border-right: none;
}
#linkTable {
float: right;
margin-top: -45px;
}
#rowID {
max-width : 100px;
text-overflow: ellipsis;
overflow: hidden;
}
.tertiary {
background: white !important;
color: var(--accent) !important;
border: 0 !important;
font-weight: 400 !important;
}
.tertiary:hover {
background: #EBF1FF !important;
}
.content {
max-width: var(--contentWidth);
margin: 0 auto;
padding-bottom: 100px;
}
.textField {
width: var(--inputWidth);
position: relative;
font-size: 15px;
border-radius: 6px 6px 0 0;
overflow: hidden;
}
.textField:hover {
transition: all 80ms ease-out;
}
.disabled {
opacity: 0.5;
}
.disabled:hover {
background: var(--backgroundInput);
}
.textField > label {
position: absolute;
font-size: 16px;
line-height: 20px;
color: #8E9199;
top: 17px;
left: 15px;
transition: all 80ms ease-out;
pointer-events: none;
}
.textField > .alt {
font-size: 11px;
line-height: 14px;
color: #74777F;
padding: 0 15px;
}
.textField > input,
.textField > select {
appearance: none;
background: none;
color: var(--textColor);
width: calc(100% - 14px * 2 - 2px);
background: var(--backgroundInput);
margin: 0;
outline: none;
font-size: 16px;
line-height: 20px;
padding: 24px 14px 8px;
border-radius: 6px 6px 0 0;
border: 1px solid #E0E2EB;
border-bottom: 1px solid #A8ABB4;
text-transform: capitalize;
}
.textField > input:hover,
.textField > select:hover {
background: var(--backgroundInputHover);
}
.textField > select {
width: 100%;
cursor: pointer;
text-transform: none;
}
.textField > input:focus ~ label {
top: 9px;
color: var(--accent);
font-size: 11px;
line-height: 14px;
}
.textField > input:valid ~ label,
.textField > input[type="date"] ~ label,
.textField > input:disabled ~ label,
.textField > select:valid ~ label {
top: 9px;
font-size: 11px;
line-height: 14px;
}
.textField > input:focus ~ .hightlightBorder {
width: calc(100% + 14px * 2);
left: 0;
border-radius: 0;
}
.textField > .hightlightBorder {
position: absolute;
left: 50%;
bottom: 0;
display: block;
width: 0;
height: 2px;
background: var(--accent);
transition: all 150ms ease-out;
border-radius: 50%;
}
.formSheet {
display: flex;
gap: 1rem;
flex-wrap: nowrap;
padding-bottom: 1rem;
}
#phoneInput {
padding-top: 22px;
padding-bottom: 10px;
}
#phoneLabel {
top: 19px;
}
.textField > input:valid ~ #phoneLabel,
.textField > input:focus ~ #phoneLabel {
top: 9px;
}
.buttonFooter {
background: var(--background);
width: 100%;
max-width: var(--contentWidth);
position: fixed;
bottom: 0;
border-top: 1px solid rgba(0,0,0,0.12);
padding: 12px 0;
}
.tableHeader {
position: fixed;
width: 100%;
top: 0;
left: 0;
padding: 16px 24px;
background: var(--background);
border-bottom: 1px solid rgba(0,0,0,0.12);
box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.tableHeader h1 {
padding: 0;
margin: 8px 0 0;
}
#table {
margin-top: 100px;
}
.sortHeader {
width: 270px;
float: right;
margin-top: -56px;
margin-right: 48px;
}
