28 | ${projeto.detalhesDoProjeto.nomeDoProjeto}
29 |${projeto.detalhesDoProjeto.descricaoDoProjeto}
30 | ${projeto.detalhesDoProjeto.linguagem} 31 |├── .gitignore ├── README.md ├── comunidade.html ├── assets ├── js │ ├── comunidade.js │ └── index.js └── css │ ├── comunidade.css │ ├── index.css │ └── darcula.css └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # projeto-dive-code 2 | -------------------------------------------------------------------------------- /comunidade.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |
28 | ${projeto.detalhesDoProjeto.descricaoDoProjeto}
30 | ${projeto.detalhesDoProjeto.linguagem} 31 |
29 | `
20 | areaDoCodigo.firstChild.innerText = codigo.texto
21 | }
22 |
23 | botaoSalvar.addEventListener('click', () => {
24 | if (typeof(Storage) !== "undefined") {
25 | console.log('Yay, support!')
26 | const projeto = montaProjeto()
27 | salvaLocalStorage(projeto)
28 | } else {
29 | console.log('Nay, no support!')
30 | }
31 | })
32 |
33 | function montaProjeto() {
34 | let projeto = {
35 | 'id': atribuiId(),
36 | 'detalhesDoProjeto': {
37 | 'nomeDoProjeto': tituloProjeto.value,
38 | 'descricaoDoProjeto': descricaoProjeto.value,
39 | 'linguagem': linguagem.value,
40 | 'codigo': areaDoCodigo.querySelector('code').innerText
41 | }
42 | }
43 | return projeto
44 | }
45 |
46 | let numeroId = 1
47 |
48 | if(localStorage.length > 0) {
49 | numeroId = localStorage.length
50 | }
51 |
52 | function atribuiId() {
53 | if(localStorage.length == 0) {
54 | return 0
55 | } else {
56 | if(localStorage.length == numeroId) {
57 | let novoId = numeroId
58 | numeroId++
59 | return novoId
60 | }
61 | }
62 | }
63 |
64 | function salvaLocalStorage(objetoJson) {
65 | localStorage.setItem(objetoJson.id, JSON.stringify(objetoJson))
66 | }
67 |
--------------------------------------------------------------------------------
/assets/css/index.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | }
4 |
5 | a {
6 | text-decoration: none;
7 | color: inherit;
8 | }
9 |
10 | .main {
11 | font-family: 'Space Mono', monospace;
12 |
13 | display: flex;
14 | flex-direction: column;
15 | justify-content: center;
16 | align-items: center;
17 |
18 | width: 100vw;
19 | min-height: 100vh;
20 |
21 | padding: 26px;
22 | box-sizing: border-box;
23 |
24 | background-color: #56cfff;
25 | }
26 |
27 | .link-projetos {
28 | width: 100%;
29 | max-width: 600px;
30 | font-size: 2rem;
31 | margin-bottom: 16px;
32 | background-color: #ffffff;
33 | padding: 10px;
34 | border-radius: 10px;
35 | box-sizing: border-box;
36 | }
37 |
38 | .link-projetos:hover {
39 | background-color: #b0e9ff;
40 | }
41 |
42 | .link-projetos::after {
43 | content: "";
44 | margin-left: 16px;
45 | }
46 |
47 | .label {
48 | font-size: 1.2rem;
49 | margin-bottom: 16px;
50 | }
51 |
52 | .cartao {
53 | display: flex;
54 | flex-direction: column;
55 |
56 |
57 | width: 100%;
58 | max-width: 600px;
59 | min-height: 800px;
60 |
61 | padding: 10px;
62 |
63 | border-radius: 10px;
64 |
65 | box-sizing: border-box;
66 |
67 | background-color: #ffffff;
68 | }
69 |
70 | .input {
71 | box-sizing: border-box;
72 | width: 100%;
73 |
74 | border: 1px solid #56cfff;
75 | border-radius: 7px;
76 |
77 | padding: 10px;
78 |
79 | margin-bottom: 32px;
80 |
81 | font-family: inherit;
82 | color: inherit;
83 | }
84 |
85 | .botao {
86 | align-self: flex-end;
87 |
88 | background-color: #56cfff;
89 |
90 | border: none;
91 | border-radius: 7px;
92 |
93 | min-width: 120px;
94 |
95 | padding: 10px 20px;
96 | margin-left: 16px;
97 |
98 | font-family: inherit;
99 | color: #ffffff;
100 |
101 | box-sizing: border-box;
102 | }
103 |
104 | .codigo-wrapper {
105 | min-height: 400px;
106 | margin-bottom: 32px;
107 | }
108 |
109 | code.preview {
110 | min-height: inherit;
111 | display: block;
112 | padding: 10px;
113 | border-radius: 7px;
114 | height: 100%;
115 | white-space: pre-wrap;
116 | }
117 |
118 | .botoes-wrapper {
119 | display: flex;
120 | justify-content: flex-end;
121 | }
122 |
--------------------------------------------------------------------------------
/assets/css/darcula.css:
--------------------------------------------------------------------------------
1 | /*!
2 | Theme: Dracula
3 | Author: Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula)
4 | License: ~ MIT (or more permissive) [via base16-schemes-source]
5 | Maintainer: @highlightjs/core-team
6 | Version: 2021.05.0
7 | */
8 |
9 | /*
10 | WARNING: DO NOT EDIT THIS FILE DIRECTLY.
11 | This theme file was auto-generated from the Base16 scheme dracula
12 | by the Highlight.js Base16 template builder.
13 | - https://github.com/highlightjs/base16-highlightjs
14 | */
15 |
16 | /*
17 | base00 #282936 Default Background
18 | base01 #3a3c4e Lighter Background (Used for status bars, line number and folding marks)
19 | base02 #4d4f68 Selection Background
20 | base03 #626483 Comments, Invisibles, Line Highlighting
21 | base04 #62d6e8 Dark Foreground (Used for status bars)
22 | base05 #e9e9f4 Default Foreground, Caret, Delimiters, Operators
23 | base06 #f1f2f8 Light Foreground (Not often used)
24 | base07 #f7f7fb Light Background (Not often used)
25 | base08 #ea51b2 Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
26 | base09 #b45bcf Integers, Boolean, Constants, XML Attributes, Markup Link Url
27 | base0A #00f769 Classes, Markup Bold, Search Text Background
28 | base0B #ebff87 Strings, Inherited Class, Markup Code, Diff Inserted
29 | base0C #a1efe4 Support, Regular Expressions, Escape Characters, Markup Quotes
30 | base0D #62d6e8 Functions, Methods, Attribute IDs, Headings
31 | base0E #b45bcf Keywords, Storage, Selector, Markup Italic, Diff Changed
32 | base0F #00f769 Deprecated, Opening/Closing Embedded Language Tags, e.g.
33 | */
34 |
35 | pre code.hljs {
36 | display: block;
37 | overflow-x: auto;
38 | padding: 1em;
39 | }
40 |
41 | code.hljs {
42 | padding: 3px 5px;
43 | }
44 |
45 | .hljs {
46 | color: #e9e9f4;
47 | background: #282936;
48 | }
49 |
50 | .hljs ::selection {
51 | color: #4d4f68;
52 | }
53 |
54 |
55 | /* purposely do not highlight these things */
56 | .hljs-formula,
57 | .hljs-params,
58 | .hljs-property
59 | {}
60 |
61 | /* base03 - #626483 - Comments, Invisibles, Line Highlighting */
62 | .hljs-comment {
63 | color: #626483;
64 | }
65 |
66 | /* base04 - #62d6e8 - Dark Foreground (Used for status bars) */
67 | .hljs-tag {
68 | color: #62d6e8;
69 | }
70 |
71 | /* base05 - #e9e9f4 - Default Foreground, Caret, Delimiters, Operators */
72 | .hljs-subst,
73 | .hljs-punctuation,
74 | .hljs-operator {
75 | color: #e9e9f4;
76 | }
77 |
78 | .hljs-operator {
79 | opacity: 0.7;
80 | }
81 |
82 | /* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */
83 | .hljs-bullet,
84 | .hljs-variable,
85 | .hljs-template-variable,
86 | .hljs-selector-tag,
87 | .hljs-name,
88 | .hljs-deletion {
89 | color: #ea51b2;
90 | }
91 |
92 | /* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */
93 | .hljs-symbol,
94 | .hljs-number,
95 | .hljs-link,
96 | .hljs-attr,
97 | .hljs-variable.constant_,
98 | .hljs-literal {
99 | color: #b45bcf;
100 | }
101 |
102 | /* base0A - Classes, Markup Bold, Search Text Background */
103 | .hljs-title,
104 | .hljs-class .hljs-title,
105 | .hljs-title.class_
106 | {
107 | color: #00f769;
108 | }
109 |
110 | .hljs-strong {
111 | font-weight:bold;
112 | color: #00f769;
113 | }
114 |
115 | /* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */
116 | .hljs-code,
117 | .hljs-addition,
118 | .hljs-title.class_.inherited__,
119 | .hljs-string {
120 | color: #ebff87;
121 | }
122 |
123 | /* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */
124 | .hljs-built_in,
125 | .hljs-doctag, /* guessing */
126 | .hljs-quote,
127 | .hljs-keyword.hljs-atrule,
128 | .hljs-regexp {
129 | color: #a1efe4;
130 | }
131 |
132 | /* base0D - Functions, Methods, Attribute IDs, Headings */
133 | .hljs-function .hljs-title,
134 | .hljs-attribute,
135 | .ruby .hljs-property,
136 | .hljs-title.function_,
137 | .hljs-section {
138 | color: #62d6e8;
139 | }
140 |
141 | /* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */
142 | .hljs-type,
143 | /* .hljs-selector-id, */
144 | /* .hljs-selector-class, */
145 | /* .hljs-selector-attr, */
146 | /* .hljs-selector-pseudo, */
147 | .hljs-template-tag,
148 | .diff .hljs-meta,
149 | .hljs-keyword {
150 | color: #b45bcf;
151 | }
152 | .hljs-emphasis {
153 | color: #b45bcf;
154 | font-style: italic;
155 | }
156 |
157 | /* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. */
158 | .hljs-meta,
159 | /*
160 | prevent top level .keyword and .string scopes
161 | from leaking into meta by accident
162 | */
163 | .hljs-meta .hljs-keyword,
164 | .hljs-meta .hljs-string
165 | {
166 | color: #00f769;
167 | }
168 |
169 | .hljs-meta .hljs-keyword,
170 | /* for v10 compatible themes */
171 | .hljs-meta-keyword {
172 | font-weight: bold;
173 | }
--------------------------------------------------------------------------------