kamrify commited on
Commit
d86254c
·
1 Parent(s): 5f830d1

Add basic dev setup

Browse files
.gitignore CHANGED
@@ -3,4 +3,5 @@ npm-debug.log
3
  .DS_Store
4
  .idea
5
  .vscode
6
- package-lock.json
 
 
3
  .DS_Store
4
  .idea
5
  .vscode
6
+ package-lock.json
7
+ yarn-error.log
assets/css/demo.css DELETED
@@ -1,78 +0,0 @@
1
- /*
2
- ::: Ignore!
3
- ::: Some quick styles for the demo page
4
- */
5
-
6
- * {
7
- margin: 0;
8
- padding: 0;
9
- }
10
-
11
- body {
12
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
13
- font-size: 1.4em;
14
- line-height: 1.4em;
15
- color: #7d7d7d;
16
- }
17
-
18
- p {
19
- margin-bottom: 0.5em;
20
- }
21
-
22
- h1 {
23
- font-size: 1.5em;
24
- margin-bottom: 0.75em;
25
- }
26
-
27
- a.btn {
28
- padding: 10px;
29
- text-decoration: none;
30
- border-radius: 5px;
31
- font-size: 16px;
32
- }
33
-
34
- .btn-dark {
35
- background: #000000;
36
- color: white;
37
- }
38
-
39
- .btn-light {
40
- background: whitesmoke;
41
- color: #2d2d2d;
42
- }
43
-
44
- h1, h2, h3, h4, h5, h6 {
45
- color: #2d2d2d;
46
- }
47
-
48
- pre {
49
- margin: 1.25em 0;
50
- background: whitesmoke;
51
- padding: 10px 0;
52
- line-height: 1.75em;
53
- }
54
-
55
- .page-wrap {
56
- display: block;
57
- padding: 50px;
58
- max-width: 700px;
59
- margin: auto;
60
- }
61
-
62
- section.header {
63
- margin-top: 150px;
64
- text-align: center;
65
- margin-bottom: 125px;
66
- }
67
-
68
- section.header .btn {
69
- margin-left: 3px;
70
- }
71
-
72
- section.header h1 {
73
- font-size: 3em;
74
- }
75
-
76
- section.header p {
77
- margin-bottom: 1em;
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/scripts/src/sholo.js ADDED
File without changes
assets/styles/scss/base.scss ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $global-guttering: 24px;
2
+ $global-font-size-h1: 32px;
3
+ $global-font-size-h2: 24px;
4
+ $global-font-size-h3: 20px;
5
+ $global-font-size-h4: 18px;
6
+ $global-font-size-h5: 16px;
7
+ $global-font-size-h6: 14px;
8
+
9
+ /*=============================================
10
+ = Generic styling =
11
+ =============================================*/
12
+
13
+ * {
14
+ -webkit-font-smoothing: antialiased;
15
+ -moz-osx-font-smoothing: grayscale
16
+ }
17
+
18
+ *, *:before, *:after {
19
+ box-sizing: border-box
20
+ }
21
+
22
+ html, body {
23
+ position: relative;
24
+ margin: 0;
25
+ width: 100%;
26
+ height: 100%;
27
+ }
28
+
29
+ body {
30
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
31
+ font-size: 16px;
32
+ line-height: 1.4;
33
+ color: #FFFFFF;
34
+ background-color: #333;
35
+ overflow-x: hidden;
36
+ }
37
+
38
+ label {
39
+ display: block;
40
+ margin-bottom: 8px;
41
+ font-size: 14px;
42
+ font-weight: 500;
43
+ cursor: pointer;
44
+ }
45
+
46
+ p {
47
+ margin-top: 0;
48
+ }
49
+
50
+ hr {
51
+ display: block;
52
+ margin: $global-guttering*1.25 0;
53
+ border: 0;
54
+ border-bottom: 1px solid #eaeaea;
55
+ height: 1px;
56
+ }
57
+
58
+ h1, h2, h3, h4, h5, h6 {
59
+ margin-top: 0;
60
+ margin-bottom: $global-guttering/2;
61
+ font-weight: 400;
62
+ line-height: 1.2;
63
+ }
64
+
65
+ a, a:visited, a:focus {
66
+ color: #FFFFFF;
67
+ text-decoration: none;
68
+ font-weight: 600;
69
+ }
70
+
71
+ .form-control {
72
+ display: block;
73
+ width: 100%;
74
+ background-color: #f9f9f9;
75
+ padding: 12px;
76
+ border: 1px solid #ddd;
77
+ border-radius: 2.5px;
78
+ font-size: 14px;
79
+ -webkit-appearance: none;
80
+ appearance: none;
81
+ margin-bottom: $global-guttering;
82
+ }
83
+
84
+ h1, .h1 {
85
+ font-size: $global-font-size-h1;
86
+ }
87
+
88
+ h2, .h2 {
89
+ font-size: $global-font-size-h2;
90
+ }
91
+
92
+ h3, .h3 {
93
+ font-size: $global-font-size-h3;
94
+ }
95
+
96
+ h4, .h4 {
97
+ font-size: $global-font-size-h4;
98
+ }
99
+
100
+ h5, .h5 {
101
+ font-size: $global-font-size-h5;
102
+ }
103
+
104
+ h6, .h6 {
105
+ font-size: $global-font-size-h6;
106
+ }
107
+
108
+ .container {
109
+ display: block;
110
+ margin: auto;
111
+ max-width: 40em;
112
+ padding: $global-guttering*2;
113
+ @media (max-width: 620px) {
114
+ padding: 0;
115
+ }
116
+ }
117
+
118
+ .section {
119
+ background-color: #FFFFFF;
120
+ padding: $global-guttering;
121
+ color: #333;
122
+ a, a:visited, a:focus {
123
+ color: #00bcd4;
124
+ }
125
+ }
126
+
127
+ .logo {
128
+ display: block;
129
+ margin-bottom: $global-guttering/2;
130
+ }
131
+
132
+ .logo__img {
133
+ width: 100%;
134
+ height: auto;
135
+ display: inline-block;
136
+ max-width: 100%;
137
+ vertical-align: top;
138
+ padding: $global-guttering/4 0;
139
+ }
140
+
141
+ .visible-ie {
142
+ display: none;
143
+ }
144
+
145
+ .zero-bottom {
146
+ margin-bottom: 0;
147
+ }
148
+
149
+ .zero-top {
150
+ margin-top: 0;
151
+ }
152
+
153
+ .text-center {
154
+ text-align: center;
155
+ }
156
+
157
+ /*===== End of Section comment block ======*/
assets/styles/scss/sholo.scss ADDED
File without changes
index.html CHANGED
@@ -5,7 +5,7 @@
5
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
  <title>Sholo</title>
8
- <link rel="stylesheet" href="assets/css/demo.css">
9
  </head>
10
  <body>
11
  <div class="page-wrap">
@@ -26,5 +26,7 @@
26
  </pre>
27
  </section>
28
  </div>
 
 
29
  </body>
30
  </html>
 
5
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
  <title>Sholo</title>
8
+ <link rel="stylesheet" href="./assets/styles/css/sholo.min.css">
9
  </head>
10
  <body>
11
  <div class="page-wrap">
 
26
  </pre>
27
  </section>
28
  </div>
29
+
30
+ <script src="./assets/scripts/dist/sholo.min.js"></script>
31
  </body>
32
  </html>
package.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "sholo",
3
+ "version": "1.0.0",
4
+ "description": "A light-weight, vanilla JS library to bring certain parts of page in spotlight",
5
+ "main": "./assets/scripts/dist/sholo.min.js",
6
+ "scripts": {
7
+ "start": "node server.js"
8
+ },
9
+ "repository": "https://github.com/kamranahmedse/sholo",
10
+ "author": "Kamran Ahmed <[email protected]>",
11
+ "license": "MIT",
12
+ "devDependencies": {
13
+ "opn": "^5.2.0",
14
+ "webpack": "^4.0.1",
15
+ "webpack-dev-server": "^3.1.0"
16
+ }
17
+ }
server.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const webpack = require('webpack');
2
+ const WebpackDevServer = require('webpack-dev-server');
3
+ const config = require('./webpack.dev.config');
4
+ const opn = require('opn');
5
+
6
+ const PORT = 3000;
7
+ const HOST = 'localhost';
8
+ const URL = `http://${HOST}:${PORT}`;
9
+
10
+ new WebpackDevServer(webpack(config), {
11
+ publicPath: config.output.publicPath
12
+ }).listen(PORT, HOST, function (error, result) {
13
+ if (error) {
14
+ console.error(error);
15
+ }
16
+
17
+ opn(URL);
18
+ console.log(`Listening at ${URL}`);
19
+ });
webpack.dev.config.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ mode: 'development',
5
+ entry: [
6
+ "./assets/scripts/src/sholo.js"
7
+ ],
8
+ output: {
9
+ publicPath: '/assets/scripts/dist/',
10
+ path: path.join(__dirname, 'dist'),
11
+ filename: 'sholo.min.js',
12
+ libraryTarget: "umd",
13
+ library: "Sholo"
14
+ }
15
+ };
yarn.lock ADDED
The diff for this file is too large to render. See raw diff