Skip to content
Open

finish #1807

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm start & sleep 5 && npm test
- name: Upload tests report(cypress mochaawesome merged HTML report)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: reports
29 changes: 29 additions & 0 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,32 @@ const people = [
console.log(people); // you can remove it

// write your code here

const dashboard = document.querySelector('.dashboard');

function makeTr(peoples) {
return peoples.map((person) => {
const tr = document.createElement('tr');
const age = person.died - person.born;
const century = Math.ceil(person.died / 100);
const allInfo = [
person.name,
person.sex === 'f' ? 'Female' : 'Male',
person.born,
person.died,
age,
century,
];

for (let i = 0; i < allInfo.length; i++) {
const td = document.createElement('td');

td.textContent = allInfo[i];
tr.append(td);
}

return tr;
});
}

makeTr(people).forEach((tr) => dashboard.append(tr));
23 changes: 13 additions & 10 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
body {
background-image: linear-gradient(45deg, #e25644, #7e7cf9);
background-attachment: fixed;
display: flex;
justify-content: center;
align-items: center;
justify-content: center;

box-sizing: border-box;
min-height: 100vh;
margin: 0;
padding: 100px;

font-family: Roboto, sans-serif;
margin: 0;
box-sizing: border-box;

background-image: linear-gradient(45deg, #e25644, #7e7cf9);
background-attachment: fixed;
}

table {
Expand All @@ -18,23 +21,23 @@ table {
}

tr {
background: #fff;
color: #808080;
background: #fff;
}

tr:nth-child(2n + 1) {
background: #f5f5f5;
}

table tr:first-child {
background: #e25644;
color: #fff;
background: #e25644;
}

td,
th {
text-align: left;
padding: 18px;
text-align: left;
}

table tr:last-child td:first-child {
Expand All @@ -54,7 +57,7 @@ table tr:first-child th:last-child {
}

tr:not(:first-child):hover {
background: #f5f5f5;
color: #585858;
cursor: pointer;
color: #585858;
background: #f5f5f5;
}
Loading