Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Commit 256c5c3

Browse files
authored
Merge pull request #3 from YGOclearmind/main
first commend
2 parents 7b18931 + 967d3fb commit 256c5c3

File tree

9 files changed

+1230
-0
lines changed

9 files changed

+1230
-0
lines changed

YGOclearmind/image/scripts/main.js

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
2+
let btnnew=document.querySelector("#new");
3+
/*function newdate(){
4+
let myline = prompt("请输入序号");
5+
let myxh = prompt("请输入你的学号");
6+
let myname = prompt("请输入你的姓名");
7+
let myschool = prompt("请输入你的学院");
8+
let mystudy = prompt("请输入你的专业");
9+
let mylevel = prompt("请输入你的年级");
10+
let myclass = prompt("请输入你的班级");
11+
let myage = prompt("请输入你的年龄");
12+
let table = document.querySelector("table");
13+
let newrow = table.insertRow();
14+
let cellcheck = newrow.insertCell();
15+
let checkbox = document.createElement("input"); // 创建一个复选框
16+
checkbox.type = "checkbox"; // 设置复选框类型为复选框
17+
cellcheck.appendChild(checkbox); // 将复选框添加到单元格中
18+
19+
let cellline = newrow.insertCell();
20+
let cellxh = newrow.insertCell();
21+
let cellname = newrow.insertCell();
22+
let cellschool = newrow.insertCell();
23+
let cellstudy = newrow.insertCell();
24+
let celllevel = newrow.insertCell();
25+
let cellclass = newrow.insertCell();
26+
let cellage = newrow.insertCell();
27+
let celllook = newrow.insertCell();
28+
let cellreview = newrow.insertCell();
29+
cellline.innerHTML = myline;
30+
cellxh.innerHTML = myxh;
31+
cellname.innerHTML = myname;
32+
cellschool.innerHTML = myschool;
33+
cellstudy.innerHTML = mystudy;
34+
celllevel.innerHTML = mylevel;
35+
cellclass.innerHTML = myclass;
36+
cellage.innerHTML = myage;
37+
celllook.innerHTML = "查看";
38+
cellreview.innerHTML = "修改";
39+
}*/
40+
function addTmplFile() {
41+
/*let page1 = document.getElementById("page1").style;
42+
page1.display = "none";*/
43+
let page2 = document.getElementById("page2").style;
44+
page2.display = "block";
45+
let totalbg = document.getElementById("totalBackground").style;
46+
totalbg.display = "block";
47+
48+
document.getElementById("submit1").style.display = "block";
49+
document.getElementById("submit2").style.display = "none";
50+
document.getElementById("name").value = null;
51+
document.getElementById("study").value = null;
52+
document.getElementById("class1").value = null;
53+
document.getElementById("number").value = null;
54+
document.getElementById("studynumber").value = null;
55+
document.getElementById("grade").value = null;
56+
document.getElementById("age").value = null;
57+
document.getElementById("school").value = null;
58+
59+
}
60+
function submit1(){
61+
let name = document.getElementById("name").value;
62+
let study = document.getElementById("study").value;
63+
let number = document.getElementById("number").value;
64+
let studynumber = document.getElementById("studynumber").value;
65+
let class1 = document.getElementById("class1").value;
66+
let school = document.getElementById("school").value;
67+
let grade = document.getElementById("grade").value;
68+
let age = document.getElementById("age").value;
69+
name = document.createTextNode(name);
70+
age = document.createTextNode(age);
71+
study = document.createTextNode(study);
72+
class1 = document.createTextNode(class1);
73+
number = document.createTextNode(number);
74+
studynumber = document.createTextNode(studynumber);
75+
school = document.createTextNode(school);
76+
grade = document.createTextNode(grade);
77+
let tr = document.createElement("tr");
78+
let td9 = document.createElement("td");
79+
let checkbox1 = document.createElement("input");
80+
checkbox1.type = "checkbox";
81+
td9.appendChild(checkbox1);
82+
let td1 = document.createElement("td");
83+
td1.appendChild(name);
84+
let td2 = document.createElement("td");
85+
td2.appendChild(studynumber);
86+
let td3 = document.createElement("td");
87+
td3.appendChild(study);
88+
let td4 = document.createElement("td");
89+
td4.appendChild(age);
90+
let td5 = document.createElement("td");
91+
td5.appendChild(grade);
92+
let td6 = document.createElement("td");
93+
td6.appendChild(class1);
94+
let td7 = document.createElement("td");
95+
td7.appendChild(school);
96+
let td8 = document.createElement("td");
97+
td8.appendChild(number);
98+
let td10 = document.createElement("td");
99+
td10.style.textAlign = "center";
100+
let td11 = document.createElement("td");
101+
td11.style.textAlign = "center";
102+
var input1 = document.createElement('input');
103+
var input2 = document.createElement('input');
104+
input1.setAttribute('type','button');
105+
input1.setAttribute('value','查看');
106+
input1.setAttribute('onclick','look(this)');
107+
input1.id = 'btn1';
108+
input2.setAttribute('type','button');
109+
input2.setAttribute('onclick','modify(this)');
110+
input2.setAttribute('value','修改');
111+
//input2.setAttribute('onclick','modify(this)');
112+
input2.id = 'btn2';
113+
td10.appendChild(input1);
114+
td11.appendChild(input2);
115+
let table = document.getElementById("table1");
116+
table.appendChild(tr);
117+
tr.appendChild(td9);
118+
tr.appendChild(td1);
119+
tr.appendChild(td2);
120+
tr.appendChild(td3);
121+
tr.appendChild(td4);
122+
tr.appendChild(td5);
123+
tr.appendChild(td6);
124+
tr.appendChild(td7);
125+
tr.appendChild(td8);
126+
tr.appendChild(td10);
127+
tr.appendChild(td11);
128+
129+
let totalbg = document.getElementById("totalBackground").style;
130+
totalbg.display = "none";
131+
let page2 = document.getElementById("page2").style;
132+
page2.display = "none";
133+
}
134+
135+
let table=document.querySelector("table");
136+
let btndel=document.querySelector("#del");
137+
btndel.onclick = function(){
138+
table.deleteRow(table.rows.length-1);
139+
}
140+
function modify(obj){
141+
let totalbg = document.getElementById("totalBackground").style;
142+
totalbg.display = "block";
143+
let page2 = document.getElementById("page2").style;
144+
page2.display = "block";
145+
document.getElementById("submit1").style.display = "none";
146+
document.getElementById("submit2").style.display = "block";
147+
cortr = obj.parentNode.parentNode;
148+
cortd = cortr.getElementsByTagName('td');
149+
let name = document.getElementById("name").value = cortd[1].innerText;
150+
let study = document.getElementById("study").value = cortd[2].innerText;
151+
let studynumber = document.getElementById("studynumber").value = cortd[3].innerText;
152+
let grade = document.getElementById("grade").value = cortd[4].innerText;
153+
let age = document.getElementById("age").value = cortd[5].innerText;
154+
let class1 = document.getElementById("class1").value = cortd[6].innerText;
155+
let school = document.getElementById("school").value = cortd[7].innerText;
156+
let number = document.getElementById("number").value = cortd[8].innerText;
157+
158+
}
159+
function submit2(){
160+
let totalbg = document.getElementById("totalBackground").style;
161+
totalbg.display = "none";
162+
let page2 = document.getElementById("page2").style;
163+
page2.display = "none";
164+
cortd[1].innerText = document.getElementById("name").value;
165+
cortd[2].innerText = document.getElementById("study").value;
166+
cortd[3].innerText = document.getElementById("studynumber").value;
167+
cortd[4].innerText = document.getElementById("grade").value;
168+
cortd[5].innerText = document.getElementById("age").value;
169+
cortd[6].innerText = document.getElementById("class1").value;
170+
cortd[7].innerText = document.getElementById("school").value;
171+
cortd[8].innerText = document.getElementById("number").value;
172+
173+
}
174+
function look(obj){
175+
let totalbg = document.getElementById("totalBackground").style;
176+
totalbg.display = "block";
177+
let page2 = document.getElementById("page2").style;
178+
page2.display = "block";
179+
document.getElementById("submit1").style.display = "none";
180+
document.getElementById("submit2").style.display = "none";
181+
document.getElementById("submit3").style.display = "block";
182+
cortr = obj.parentNode.parentNode;
183+
cortd = cortr.getElementsByTagName('td');
184+
let name = document.getElementById("name").value = cortd[1].innerText;
185+
let study = document.getElementById("study").value = cortd[2].innerText;
186+
let studynumber = document.getElementById("studynumber").value = cortd[3].innerText;
187+
let grade = document.getElementById("grade").value = cortd[4].innerText;
188+
let age = document.getElementById("age").value = cortd[5].innerText;
189+
let class1 = document.getElementById("class1").value = cortd[6].innerText;
190+
let school = document.getElementById("school").value = cortd[7].innerText;
191+
let number = document.getElementById("number").value = cortd[8].innerText;
192+
193+
}
194+
function cancel(){
195+
let totalbg = document.getElementById("totalBackground").style;
196+
totalbg.display = "none";
197+
let page2 = document.getElementById("page2").style;
198+
page2.display = "none";
199+
}

YGOclearmind/image/styles/styles.css

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
html{
2+
background-color: #EFECEA ;
3+
}
4+
.h1{
5+
border-top: 6px solid;
6+
position: relative;
7+
color: #B8A38F;
8+
margin-top: 25px;
9+
margin-bottom: 50px;
10+
11+
}
12+
h1{
13+
color: #9C9A98;
14+
margin: 0;
15+
position:absolute;
16+
background-color:#EFECEA;
17+
top:-25px;
18+
left: 50%;
19+
transform: translateX(-50%);
20+
padding: 0 150px 0 150px;
21+
z-index: 0;
22+
}
23+
.floated{
24+
width: 125px;
25+
height: 50px;
26+
color: white;
27+
margin-right: 20px;
28+
margin-bottom: 20px;
29+
}
30+
#new{
31+
font-size: 20px;
32+
background-color: #78B567;
33+
}
34+
#del{
35+
font-size: 20px;
36+
background-color: #C45D53;
37+
}
38+
tr:nth-child(2n-1){
39+
background: #EFF1F9;
40+
}
41+
tr:nth-child(2n){
42+
background: white;
43+
}
44+
table{
45+
width: 100%;
46+
height: 100%;
47+
border-collapse:collapse;
48+
margin-bottom: 75px;
49+
z-index: 1;
50+
}
51+
td{
52+
text-align: center;
53+
z-index: 1;
54+
}
55+
56+
#next{
57+
float: right;
58+
font-size: 20px;
59+
background-color: #C45D53;
60+
}
61+
#last{
62+
float: right;
63+
left: 100%;
64+
font-size: 20px;
65+
background-color: #78B567;
66+
}
67+
#page2
68+
{
69+
margin: 0 auto;
70+
width: 700px;
71+
border-top: 5px solid #555555;
72+
border-bottom: 50px solid #555555;
73+
border-left: 1px solid #F0F2F5;
74+
border-right: 1px solid #F0F2F5;
75+
display: none;
76+
position: absolute;
77+
z-index: 3;
78+
top: 0;
79+
left: 0;
80+
right: 0;
81+
bottom: 0;
82+
height: 500px;
83+
}
84+
#totalBackground{
85+
width: 100%;
86+
height: 100%;
87+
/*border: 1px solid #dadee1;*/
88+
display: none;
89+
position: fixed;
90+
top: 0;
91+
left: 0;
92+
background-color: #c4c2c1;
93+
z-index:2;
94+
/*-moz-opacity: 0.8;*/
95+
opacity:.8;
96+
/*filter: alpha(opacity=88);*/
97+
}
98+
#addtitle{
99+
background-color: #555555;
100+
margin: 0%;
101+
padding-top: 0%;
102+
}
103+
#addname{
104+
color: white;
105+
}
106+
#page2 td {
107+
background-color: white;
108+
}
109+
#submit input[type="button"] {
110+
background-color: white;
111+
}
112+
#submit1 {
113+
margin-right: 10px; /* 设置右边距,避免重叠 */
114+
}
115+
116+
#submit2 {
117+
margin-left: 10px; /* 设置左边距,避免重叠 */
118+
}

0 commit comments

Comments
 (0)