Skip to content

Commit 721d58b

Browse files
committed
Move demo files in demo folder
1 parent 6da1f3d commit 721d58b

File tree

7 files changed

+113
-103
lines changed

7 files changed

+113
-103
lines changed

src/app.js renamed to demo/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import './scss/style.scss';
2-
import NoteManager from './NoteManager';
1+
import './style.scss';
2+
import NoteManager from '../src/NoteManager';
33

44
const noteManager = new NoteManager({
55
el: document.getElementById('notesWrapper'),
File renamed without changes.

demo/style.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
5+
body {
6+
padding: 0;
7+
margin: 0;
8+
background-color: #e4e4e4;
9+
}
10+
11+
#notesWrapper {
12+
padding: 50px;
13+
}
14+

src/NoteManager.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
import './NoteManager.scss';
12
import Note from './Note';
23

34
export default class NoteManager {
45
constructor({el, notes}) {
56
this.el = el;
7+
this.el.className = 'tc-notes-wrapper';
68
this.notesEl = null;
79
this.notes = notes.map(note => new Note(note, this));
810

911
this.onNoteChange = () => {
1012
};
13+
this.createNewNoteButton();
1114
this.createNotesWrapper();
1215
this.renderNotes();
1316
}
@@ -27,6 +30,10 @@ export default class NoteManager {
2730
this.renderNotes();
2831
}
2932

33+
createNewNoteButton(){
34+
35+
}
36+
3037
createNotesWrapper() {
3138
this.notesEl = document.createElement('div');
3239
this.notesEl.className = 'tc-notes';

src/NoteManager.scss

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
.tc-notes-wrapper {
2+
.new-note-btn {
3+
width: 200px;
4+
display: block;
5+
margin: 0 auto 20px;
6+
background-color: #FFF;
7+
padding: 10px 32px;
8+
border: 1px solid #e0e0e0;
9+
font-size: 26px;
10+
outline: 0;
11+
transition: all 0.3s;
12+
cursor: pointer;
13+
font-family: 'Caveat', cursive;
14+
15+
&:hover {
16+
box-shadow: 0 5px 7px rgba(0, 0, 0, 0.1);
17+
}
18+
19+
&:active {
20+
position: relative;
21+
top: 1px;
22+
}
23+
}
24+
25+
.tc-notes {
26+
display: flex;
27+
justify-content: center;
28+
flex-wrap: wrap;
29+
margin: 0 auto;
30+
31+
.tc-note {
32+
background-color: #f0c806;
33+
border-radius: 8px;
34+
width: 280px;
35+
margin: 0 10px 20px;
36+
box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2);
37+
transition: all 0.5s;
38+
cursor: pointer;
39+
font-family: 'Caveat', cursive;
40+
41+
.tc-note-header {
42+
padding: 10px 16px 0;
43+
44+
.tc-note-close {
45+
display: inline-block;
46+
width: 24px;
47+
height: 24px;
48+
border-radius: 50%;
49+
line-height: 24px;
50+
text-align: center;
51+
transition: all 0.3s;
52+
53+
&:hover {
54+
background-color: rgba(0, 0, 0, 0.2);
55+
}
56+
57+
&:focus {
58+
box-shadow: inset 2px 3px 0px rgba(0, 0, 0, 0.8);
59+
}
60+
}
61+
62+
.tc-note-close {
63+
float: right;
64+
}
65+
}
66+
67+
.tc-note-title,
68+
.tc-note-body {
69+
outline: 0;
70+
}
71+
72+
.tc-note-title {
73+
font-size: 24px;
74+
padding: 10px 16px;
75+
font-weight: bold;
76+
}
77+
78+
.tc-note-body {
79+
font-size: 20px;
80+
padding: 10px 16px 16px;
81+
}
82+
83+
&:hover {
84+
box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
85+
}
86+
}
87+
}
88+
}

src/scss/style.scss

Lines changed: 0 additions & 99 deletions
This file was deleted.

webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function(){
66
return {
77
mode: 'development',
88
entry: [
9-
'./src/app.js'
9+
'./demo/app.js'
1010
],
1111
watch: true,
1212
watchOptions: {
@@ -27,7 +27,7 @@ module.exports = function(){
2727
},
2828
plugins: [
2929
new HtmlWebpackPlugin({
30-
template: path.resolve('./src/index.html')
30+
template: path.resolve('./demo/index.html')
3131
}),
3232
new webpack.HotModuleReplacementPlugin()
3333
],

0 commit comments

Comments
 (0)