Skip to content
This repository was archived by the owner on Feb 10, 2021. It is now read-only.

Commit 25b6fc1

Browse files
committed
Comenzi, compiler si admin
1 parent df3d413 commit 25b6fc1

File tree

377 files changed

+271990
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

377 files changed

+271990
-9
lines changed

app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ app.set('view engine', 'pug');
4040

4141
/* Models */
4242
global.modelIndex = require('./server/models/index');
43+
global.modelSearch = require('./server/models/search');
44+
global.modelCompiler = require('./server/models/compiler');
45+
global.modelAdmin = require('./server/models/admin');
4346

4447
/* Controllers */
4548
global.index = require('./server/controllers/index')(app);
49+
global.search = require('./server/controllers/search')(app);
50+
global.compiler = require('./server/controllers/compiler')(app);
51+
global.admin = require('./server/controllers/admin')(app);
4652

4753
/* Listen */
4854
global.server = app.listen(config.port, function(){
@@ -58,5 +64,8 @@ io.on('connection', function(client){
5864

5965
// Sockets
6066
global.socketIndex = require('./server/sockets/index')(client);
67+
global.socketSearch = require('./server/sockets/search')(client);
68+
global.socketCompiler = require('./server/sockets/compiler')(client);
69+
global.socketAdmin = require('./server/sockets/admin')(client);
6170

6271
});

server/controllers/admin.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = function(app){
2+
app.get('/admin', function(req, res){
3+
db.collection('data').find({}).toArray(function(err, resultsAll){
4+
res.render('admin', {
5+
brand: resultsAll[0].brand,
6+
titleIndex: resultsAll[0].titleIndex,
7+
titleSearch: resultsAll[0].titleSearch,
8+
titleCompiler: resultsAll[0].titleCompiler,
9+
titleAdmin: resultsAll[0].titleAdmin,
10+
description: resultsAll[0].description,
11+
button1: resultsAll[0].button1,
12+
button2: resultsAll[0].button2,
13+
button3: resultsAll[0].button3,
14+
button4: resultsAll[0].button4
15+
});
16+
});
17+
});
18+
};

server/controllers/compiler.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = function(app){
2+
app.get('/compilator', function(req, res){
3+
db.collection('data').find({}, modelCompiler.compilerPageModel).toArray(function(err, results){
4+
if (err) console.log(err)
5+
else{
6+
res.render('compiler', {
7+
brand: results[0].brand,
8+
titleCompiler: results[0].titleCompiler,
9+
button1: results[0].button1,
10+
button2: results[0].button2,
11+
button3: results[0].button3,
12+
button4: results[0].button4,
13+
});
14+
};
15+
});
16+
});
17+
};

server/controllers/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ module.exports = function(app){
44
if (err) console.log(err)
55
else{
66
res.render('index', {
7-
brand: results[0].brand
7+
brand: results[0].brand,
8+
titleIndex: results[0].titleIndex,
9+
description: results[0].description,
10+
button1: results[0].button1,
11+
button2: results[0].button2,
12+
button3: results[0].button3,
13+
button4: results[0].button4,
814
});
915
};
1016
});

server/controllers/search.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = function(app){
2+
app.get('/search', function(req, res){
3+
db.collection('data').find({}, modelSearch.searchPageModel).toArray(function(err, results){
4+
if (err) console.log(err)
5+
else{
6+
res.render('search', {
7+
brand: results[0].brand,
8+
titleSearch: results[0].titleSearch,
9+
button1: results[0].button1,
10+
button2: results[0].button2,
11+
button3: results[0].button3,
12+
button4: results[0].button4,
13+
});
14+
};
15+
});
16+
});
17+
};

server/models/admin.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var adminPageModel = {
2+
"_id": 0,
3+
"brand": 1,
4+
"titleAdmin": 1,
5+
"description": 1,
6+
"button1": 1,
7+
"button2": 1,
8+
"button3": 1,
9+
"button4": 1
10+
};
11+
module.exports = adminPageModel;

server/models/compiler.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var indexPageModel = {
2+
"_id": 0,
3+
"brand": 1,
4+
"titleCompiler": 1,
5+
"description": 1,
6+
"button1": 1,
7+
"button2": 1,
8+
"button3": 1,
9+
"button4": 1
10+
};
11+
module.exports = indexPageModel;

server/models/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
var indexPageModel = {
22
"_id": 0,
3-
"brand": 1
3+
"brand": 1,
4+
"titleIndex": 1,
5+
"description": 1,
6+
"button1": 1,
7+
"button2": 1,
8+
"button3": 1,
9+
"button4": 1
410
};
511
module.exports = indexPageModel;

server/models/search.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var searchPageModel = {
2+
"_id": 0,
3+
"titleSearch": 1,
4+
"brand": 1,
5+
"button1": 1,
6+
"button2": 1,
7+
"button3": 1,
8+
"button4": 1
9+
};
10+
module.exports = searchPageModel;

server/public/css/index.css

Lines changed: 222 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,225 @@
11
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800');
2+
@import url('https://fonts.googleapis.com/css?family=Permanent+Marker');
23
body{
3-
background-color: #e67e22;
4-
color: #fff;
5-
margin: 0;
6-
padding: 0;
7-
font-family: 'Open Sans', sans-serif;
4+
margin: 0;
5+
padding: 0;
6+
font-family: 'Open Sans', sans-serif;
7+
}
8+
a{
9+
text-decoration: none;
10+
color: inherit;
11+
}
12+
#index{
13+
background-color: #16a085;
14+
color: #fff;
15+
}
16+
#index div.vertical{
17+
position: relative;
18+
top: 50%;
19+
transform: translateY(-50%);
20+
-ms-transform: translateY(-50%);
21+
-webkit-transform: translateY(-50%);
22+
-moz-transform: translateY(-50%);
23+
-o-transform: translateY(-50%);
24+
}
25+
#index h1{
26+
font-size: 64px;
27+
width: 100%;
28+
text-align: center;
29+
margin: 0 0 10px 0;
30+
line-height: 64px;
31+
font-family: 'Permanent Marker', cursive;
32+
}
33+
#index div{
34+
text-align: center;
35+
}
36+
#index div p{
37+
font-size: 18px;
38+
width: 80%;
39+
margin: 0 10%;
40+
text-align: center;
41+
font-weight: 300;
42+
}
43+
#index div button{
44+
color: #16a085;
45+
font-size: 14px;
46+
font-weight: 700;
47+
text-transform: uppercase;
48+
cursor: pointer;
49+
height: 36px;
50+
width: 350px;
51+
border: none;
52+
outline: none;
53+
background: #fff;
54+
border-radius: 5px;
55+
margin: 5px;
56+
transition: all 0.7s ease;
57+
}
58+
#index div button:hover{
59+
color: #000;
60+
}
61+
div#menu{
62+
height: 50px;
63+
background-color: #16a085;
64+
color: #fff;
65+
}
66+
div#menu h1{
67+
font-size: 24px;
68+
line-height: 50px;
69+
margin: 0 0 0 20px;
70+
text-transform: uppercase;
71+
float: left;
72+
cursor: pointer;
73+
}
74+
div#menu div{
75+
float: right;
76+
}
77+
div#menu div a{
78+
text-decoration: none;
79+
text-transform: none;
80+
color: inherit;
81+
font-size: 14px;
82+
margin: 0 15px;
83+
line-height: 50px;
84+
transition: all 0.7s ease;
85+
cursor: pointer;
86+
}
87+
div#menu div a:hover{
88+
color: #000;
89+
}
90+
#search #list{
91+
list-style-type: none;
92+
}
93+
#search #list #item{
94+
background-color: #16a085;
95+
width: 80%;
96+
margin: 20px 10%;
97+
height: 300px;
98+
}
99+
#search #list #item #half{
100+
background-color: #16a085;
101+
width: 50%;
102+
float: left;
103+
display: inline-block;
104+
height: 300px;
105+
}
106+
#search #list #item #half:first-child{
107+
background: #1abc9c;
108+
height: 300px;
109+
}
110+
#search #list #item #half h1{
111+
text-transform: uppercase;
112+
font-size: 24px;
113+
font-weight: 700;
114+
color: #fff;
115+
margin: 0;
116+
padding: 10px;
117+
background: #000;
118+
}
119+
#search #list #item #half p{
120+
font-size: 16px;
121+
font-weight: 300;
122+
color: #fff;
123+
margin: 10px;
124+
padding: 0;
125+
}
126+
#search #list #item #half pre{
127+
font-size: 14px;
128+
line-height: 18px;
129+
font-weight: 300;
130+
background: #ecf0f1;
131+
margin: 0 10px;
132+
padding: 0 5px;
133+
border-radius: 3px;
134+
}
135+
#search #list #item #half img{
136+
width: 200px;
137+
margin-top: 50px;
138+
}
139+
#search #list #item #half:nth-child(2){
140+
text-align: center;
141+
}
142+
#search::-webkit-scrollbar-track{
143+
background-color: #ecf0f1;
144+
}
145+
#search::-webkit-scrollbar{
146+
width: 6px;
147+
background-color: white;
148+
}
149+
#search::-webkit-scrollbar-thumb{
150+
background: #1f2123;
151+
}
152+
#compiler{
153+
overflow: hidden;
154+
}
155+
#compiler #editor{
156+
float: left;
157+
display: inline-block;
158+
width: 50%;
159+
height: calc(100% - 100px);
160+
}
161+
#compiler #commands{
162+
float: left;
163+
display: inline-block;
164+
width: 50%;
165+
height: 50px;
166+
background-color: #16a085;
167+
}
168+
#compiler #commands{
169+
color: #fff;
170+
font-size: 18px;
171+
line-height: 50px;
172+
}
173+
#compiler #commands i{
174+
color: #fff;
175+
width: 33.33%;
176+
text-align: center;
177+
transition: all 0.7s ease;
178+
cursor: pointer;
179+
line-height: 50px;
180+
}
181+
#compiler #commands i:hover{
182+
color: #000;
183+
}
184+
.blocklyFlyoutScrollbar{
185+
display: none;
186+
}
187+
#admin::-webkit-scrollbar-track{
188+
background-color: #ecf0f1;
189+
}
190+
#admin::-webkit-scrollbar{
191+
width: 6px;
192+
background-color: white;
193+
}
194+
#admin::-webkit-scrollbar-thumb{
195+
background: #1f2123;
196+
}
197+
#admin #infos{
198+
width: 80%;
199+
margin: 20px 10%;
200+
}
201+
#admin #infos p{
202+
width: calc(100% - 10px);
203+
margin: 0;
204+
padding: 0;
205+
background: #1abc9c;
206+
padding: 5px;
207+
color: #fff;
208+
}
209+
#admin #infos i{
210+
margin: 0 0 0 10px;
211+
transition: all 0.7s ease;
212+
}
213+
#admin #infos i:hover{
214+
color: #000;
215+
cursor: pointer;
216+
}
217+
#admin #infos input{
218+
width: 100%;
219+
margin-bottom: 10px;
220+
padding: 10px;
221+
background: #16a085;
222+
outline: 0;
223+
border: none;
224+
color: #fff;
8225
}

0 commit comments

Comments
 (0)