Skip to content
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

finish ccs layout #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"@babel/polyfill": "^7.10.4"
"@babel/polyfill": "^7.10.4",
"normalize.css": "^8.0.1"
}
}
54 changes: 54 additions & 0 deletions src/assets/dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="favicon.ico" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<title>Pure JavaScript Excel</title>
</head>
<body>
<div id="app">
<div class="db">
<div class="db__header">
<h1>Excel Dashboard</h1>
</div>

<div class="db__new">
<div class="db__view">
<a href="#" class="db__create">
Новая <br />
Таблица
</a>
</div>
</div>

<div class="db__table db__view">
<div class="db__list-header">
<span>Название</span>
<span>Дата открытия</span>
</div>

<ul class="db__list">
<li class="db__record">
<a href="#">Таблица номер 1</a>
<strong>12.06.2020</strong>
</li>

<li class="db__record">
<a href="#">Таблица номер 2</a>
<strong>12.06.2020</strong>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
126 changes: 126 additions & 0 deletions src/assets/excel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="favicon.ico" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<title>Pure JavaScript Excel</title>
</head>
<body>
<div id="app" class="container">
<div class="excel">
<div class="excel__header">
<input type="text" class="input" value="Новая таблица" />

<div>
<div class="button">
<i class="material-icons">delete</i>
</div>

<div class="button">
<i class="material-icons">exit_to_app</i>
</div>
</div>
</div>

<div class="excel__toolbar">
<div class="button">
<i class="material-icons">format_align_left</i>
</div>

<div class="button">
<i class="material-icons">format_align_center</i>
</div>

<div class="button">
<i class="material-icons">format_align_right</i>
</div>

<div class="button">
<i class="material-icons">format_bold</i>
</div>

<div class="button">
<i class="material-icons">format_italic</i>
</div>

<div class="button">
<i class="material-icons">format_underlined</i>
</div>
</div>

<div class="excel__formula">
<div class="info">fx</div>
<div class="input" contenteditable spellcheck="false"></div>
</div>

<div class="excel__table">
<div class="row">
<div class="row-info"></div>

<div class="row-data">
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
<div class="column">A</div>
<div class="column">B</div>
<div class="column">C</div>
</div>
</div>

<div class="row">
<div class="row-info">1</div>

<div class="row-data">
<div class="cell selected" contenteditable="">A1</div>
<div class="cell" contenteditable="">B2</div>
<div class="cell" contenteditable="">C3</div>
</div>
</div>

<div class="row">
<div class="row-info">2</div>

<div class="row-data">
<div class="cell">A1</div>
<div class="cell">B2</div>
<div class="cell">C3</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
14 changes: 12 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" href="favicon.ico" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<title>Pure JavaScript Excel</title>
</head>
<body>
<div id="app" class="container"></div>
<div id="app">

</div>
</body>
</html>
30 changes: 30 additions & 0 deletions src/scss/_mexins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@mixin button($color: green) {
height: 24px;
min-width: 24px;
padding: 3px;
text-align: center;
position: relative;
display: inline-block;
color: rgba(0, 0, 0, .7);

& i {
font-size: 18px;
}

&:active, &.active {
color: $color;
}

&:hover {
background: #eee;
cursor: pointer;
}
}


@mixin clear-list() {
list-style: none;
margin: 0;
padding: 0;
}

8 changes: 8 additions & 0 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$header-height: 34px;
$toolbar-height: 40px;
$formula-height: 24px;
$info-cell-width: 40px;
$cell-width: 120px;
$row-height: 24px;
$db-header-height: 64px;
$border-color: #c0c0c0;
94 changes: 94 additions & 0 deletions src/scss/dashboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
@import "variables";
@import "mixins";

.db {

&__header {
position: fixed;
left: 0;
right: 0;
top: 0;
height: $db-header-height;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
box-shadow: 0 2px 5px 2px rgba(60, 64, 67, 0.15);
z-index: 1000;
}

&__new {
margin-top: $db-header-height;
padding: 1.5rem;
background: #dadce0;
}

&__create {
width: 160px;
height: 160px;
background: #fff;
border-radius: 4px;
border: 1px solid #dadce0;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.5rem;
text-decoration: none;
color: #000;
text-align: center;

&:hover {
cursor: pointer;
color: green;
border-color: green;
}
}

&__view {
max-width: 1000px;
margin: 0 auto;
}

&__table {
padding: 1rem;
}

&__list-header {
display: flex;
justify-content: space-between;
color: #202124;
font-weight: 500;
font-size: 16px;
margin-bottom: 10px;
padding: 0 12px;
}

&__list {
@include clear-list;
}

&__record {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 14px 12px 16px;
margin-bottom: 10px;

&:hover {
background: #e6f4ea;
border-radius: 25px;
}

a {
text-decoration: none;
cursor: pointer;
color: #202124;
font-size: 14px;

&:hover {
text-decoration: underline;
}
}
}

}
31 changes: 31 additions & 0 deletions src/scss/formula.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@import "variables";
@import "mixins";


.excel__formula {
position: absolute;
left: 0;
right: 0;
top: $header-height + $toolbar-height;
height: $formula-height;
display: flex;
align-items: center;
border-bottom: 1px solid $border-color;

.info {
font-size: 18px;
font-style: italic;
text-align: center;
border-right: 1px solid $border-color;
min-width: $info-cell-width;
}

.input {
padding: 4px;
font-size: 12px;
outline: none;
width: 100%;
height: 100%;
color: #000;
}
}
Loading