feat(projects): 新增Django综合案例示例代码及素材

This commit is contained in:
100gle
2022-08-10 16:15:39 +08:00
parent b4c2257308
commit 3bf65b2755
65 changed files with 1496 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,149 @@
/* base layout */
.container {
margin: 0;
padding: 0;
box-sizing: border-box;
}
h1 {
margin-left: 15px;
}
p {
margin: 10px;
word-spacing: 1.5px;
}
ul {
list-style: none;
}
/* navbar */
.navbar ul {
display: flex;
align-items: center;
justify-content: space-between;
text-align: center;
list-style: none;
padding-left: 0;
}
.navbar a {
display: flex;
justify-content: center;
align-items: center;
text-decoration: none;
border: none;
font-size: 20px;
font-weight: bold;
}
.navbar a:hover {
color: goldenrod !important;
}
.content,
.about {
margin: 0 10px;
}
.content li::before,
.about li::before {
content: "\1F449";
padding-right: 5px;
}
/* data table */
.data-table {
display: table;
table-layout: fixed;
width: 100%;
border-collapse: collapse;
}
.data-table th,
.data-table td {
text-align: center;
word-wrap: break-word;
overflow-wrap: break-word;
}
.data-table th:first-child {
width: 5%;
}
.data-table th:nth-child(2) {
width: 15%;
}
.data-table th:nth-child(4) {
width: 30%;
}
.data-table td[class="ops"] {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.data-table .ops span {
display: block;
color: var(--accent);
cursor: pointer;
}
.btn-add-task {
display: flex;
flex-direction: row-reverse;
}
.btn-add-task > button {
display: block;
width: 50px;
height: 50px;
border-radius: 50%;
font-size: 20px;
box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);
}
.btn-add-task > button:hover {
background-color: rgb(204, 77, 77);
}
.task-form {
display: none;
flex-direction: column;
align-items: center;
}
.form {
display: block;
width: 80%;
}
.form > div {
display: flex;
flex-direction: row;
justify-content: space-between;
vertical-align: middle;
}
.form .btn-submit {
text-align: center;
transition: 0.1ms;
}
.form .btn-submit > input {
display: block;
width: 100%;
font-size: 20px;
transition: 0.1ms;
}
#task-textarea {
width: 60%;
resize: none;
}
/* footer */
#footer {
text-align: center;
}

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="123" height="44" viewBox="0 0 123 44" style="enable-background:new 0 0 123 44;" xml:space="preserve">
<style type="text/css">
.st0{fill:#292525;}
.st1{fill:#DA282A;}
.st2{fill:#FFFFFF;}
</style>
<path class="st0" d="M59.8,31.7C59.8,31.7,59.7,31.7,59.8,31.7c-0.1,0-0.2-0.1-0.2-0.1l-0.9-1.3c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1
c0,0,0-0.1,0.1-0.1c0,0,0.1,0,0.1,0c6.6-0.6,11.8-2.9,17-7.5c0,0,0,0,0.1,0c0,0,0.1,0,0.1,0c0,0,0.1,0,0.1,0c0,0,0,0,0.1,0.1
l0.9,1.1c0,0,0.1,0.1,0,0.2c0,0.1,0,0.1-0.1,0.1C71.6,28.6,66.6,30.8,59.8,31.7L59.8,31.7z" />
<path class="st0" d="M69.2,12.2h-1.5c-0.1,0-0.2,0.1-0.2,0.2v12.4c0,0.1,0.1,0.2,0.2,0.2h1.5c0.1,0,0.2-0.1,0.2-0.2V12.5
C69.4,12.3,69.3,12.2,69.2,12.2z" />
<path class="st0" d="M60.7,23.5H59c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1-0.1c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1l3.6-7.9c0,0,0-0.1,0.1-0.1
c0,0,0.1,0,0.1,0h1.7c0,0,0.1,0,0.1,0c0,0,0.1,0,0.1,0.1c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1l-3.6,7.9c0,0,0,0.1-0.1,0.1
C60.8,23.5,60.7,23.5,60.7,23.5z" />
<path class="st0" d="M75.6,21c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1-0.1l-3.1-5.4c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1c0,0,0-0.1,0.1-0.1
c0,0,0.1,0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.2v1.4c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1h-4c0,0,0,0-0.1,0
c0,0,0,0-0.1,0c0,0,0,0,0,0.1c0,0,0,0,0,0.1v4c0,0.1,0,0.1-0.1,0.2C86.9,22.3,86.9,22.3,86.8,22.3z" />
<path class="st0" d="M83,16.2c0,0-0.1,0-0.1,0c0,0-0.1,0-0.1-0.1l-1.5-2.8c0-0.1,0-0.1,0-0.2c0-0.1,0.1-0.1,0.1-0.1l1.4-0.7
c0.1,0,0.1,0,0.2,0c0.1,0,0.1,0.1,0.1,0.1l1.5,2.8c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1c0,0.1-0.1,0.1-0.1,0.1L83,16.2
C83,16.2,83,16.2,83,16.2z" />
<path class="st0" d="M89,16.2c0,0-0.1,0-0.1,0l-1.2-1c0,0-0.1-0.1-0.1-0.1c0-0.1,0-0.1,0-0.2l2.1-2.5c0,0,0.1-0.1,0.1-0.1
c0.1,0,0.1,0,0.2,0l1.2,1c0,0,0.1,0.1,0.1,0.1c0,0.1,0,0.1,0,0.2l-2.1,2.5C89.1,16.1,89.1,16.2,89,16.2C89.1,16.2,89,16.2,89,16.2z" />
<path class="st0" d="M82.2,22c-0.1,0-0.1,0-0.1-0.1l-1.2-1c0,0,0,0-0.1-0.1c0,0,0-0.1,0-0.1c0-0.1,0-0.1,0.1-0.2l2.2-2.6
c0,0,0,0,0.1-0.1c0,0,0.1,0,0.1,0c0,0,0.1,0,0.1,0c0,0,0.1,0,0.1,0l1.2,1c0,0,0,0,0.1,0.1c0,0,0,0.1,0,0.1c0,0,0,0.1,0,0.1
c0,0,0,0.1,0,0.1l-2.2,2.6C82.4,21.9,82.3,21.9,82.2,22C82.3,22,82.3,22,82.2,22z" />
<path class="st0" d="M89.8,21.9C89.7,21.9,89.7,21.8,89.8,21.9c-0.1,0-0.2-0.1-0.2-0.1l-1.9-2.6c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1
c0,0,0-0.1,0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.2C32.3,11.3,32.1,11.2,32,11.3z" />
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -0,0 +1,16 @@
const addTaskButton = document.querySelector(".btn-add-task");
const formDiv = document.querySelector(".task-form");
const taskStatus = document.querySelector(".task-status");
const updateOp = document.querySelector(".update-op");
// show task form
if (addTaskButton) {
addTaskButton.addEventListener("click", () => {
// use inline style to override css property.
if (formDiv.style.display === "") {
formDiv.style.display = "none";
}
formDiv.style.display =
formDiv.style.display == "none" ? "flex" : "none";
});
}