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

chore: add headers #91

Merged
merged 19 commits into from
May 23, 2024
Merged
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
32 changes: 32 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,35 @@
from = "/*"
to = "/index.html"
status = 200

[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = '''
https://app.govgen.io,
https://gh-discuss.devnet.govgen.dev'''
Strict-Transport-Security = "max-age=31536000; includeSubDomains"
Content-Security-Policy = "default-src 'self'; object-src 'none'; connect-src https://graphql.devnet.govgen.dev/v1/graphql https://gh-discuss.devnet.govgen.dev https://plausible.io/api/event"
X-Frame-Options = "SAMEORIGIN"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin"
X-XSS-Protection = "1; mode=block"
Set-Cookie = '''
Secure,
SameSite'''
permissions-policy = '''
interest-cohort=(),
accelerometer=(),
autoplay=(),
camera=(),
autoplay=(),
document-domain=(),
encrypted-media=(),
geolocation=(),
gyroscope=(),
magnetometer=(),
microphone=(),
midi=(),
payment=(),
usb=(),
xr-spatial-tracking=()'''
14 changes: 11 additions & 3 deletions src/components/proposals/ProposalWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,11 @@ onMounted(() => (title.value = `GovGen — #${proposal.value?.proposal[0].id} ${
<div class="grow w-full md:w-1/2 mb-10 md:pl-3 pr-0">
<div class="text-grey-100 text-200 mb-2">{{ $t("proposalpage.labels.changes") }}</div>
<div class="text-light text-100">
<VCodeBlock :code="JSON.stringify(proposal?.proposal[0].content.changes, null, '\t')" prismjs />
<VCodeBlock
:code="JSON.stringify(proposal?.proposal[0].content.changes, null, '\t')"
prismjs
:theme="false"
/>
</div>
</div>
</div>
Expand All @@ -708,7 +712,11 @@ onMounted(() => (title.value = `GovGen — #${proposal.value?.proposal[0].id} ${
<div class="grow w-1/2 mb-10">
<div class="text-grey-100 text-200 mb-2">{{ $t("proposalpage.labels.upgradePlan") }}</div>
<div class="text-light text-100">
<VCodeBlock :code="JSON.stringify(proposal?.proposal[0].content.plan, null, '\t')" prismjs />
<VCodeBlock
:code="JSON.stringify(proposal?.proposal[0].content.plan, null, '\t')"
prismjs
:theme="false"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -791,7 +799,7 @@ onMounted(() => (title.value = `GovGen — #${proposal.value?.proposal[0].id} ${

<PopupBox :visible="showJsonModal" title="JSON" @close="showJsonModal = false">
<div v-if="proposal" class="p-4">
<VCodeBlock :code="JSON.stringify(proposal, null, '\t')" prismjs />
<VCodeBlock :code="JSON.stringify(proposal, null, '\t')" prismjs :theme="false" />
</div>
</PopupBox>

Expand Down
129 changes: 128 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,131 @@ html {
@apply p-2;
@apply text-center;
}
} */
} */
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: 0 0;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"] {
padding: 1em;
margin: 0.5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}
:not(pre) > code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
}
.token.cdata,
.token.comment,
.token.doctype,
.token.prolog {
color: #8292a2;
}
.token.punctuation {
color: #f8f8f2;
}
.token.namespace {
opacity: 0.7;
}
.token.constant,
.token.deleted,
.token.property,
.token.symbol,
.token.tag {
color: #f92672;
}
.token.boolean,
.token.number {
color: #ae81ff;
}
.token.attr-name,
.token.builtin,
.token.char,
.token.inserted,
.token.selector,
.token.string {
color: #a6e22e;
}
.language-css .token.string,
.style .token.string,
.token.entity,
.token.operator,
.token.url,
.token.variable {
color: #f8f8f2;
}
.token.atrule,
.token.attr-value,
.token.class-name,
.token.function {
color: #e6db74;
}
.token.keyword {
color: #66d9ef;
}
.token.important,
.token.regex {
color: #fd971f;
}
.token.bold,
.token.important {
font-weight: 700;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

.v-code-block--code {
position: relative;
z-index: 1;
}
.v-code-block--code-copy-button {
align-items: center;
color: #ccc;
cursor: pointer;
display: flex;
fill: #ccc;
height: 1.5em;
justify-content: center;
opacity: 0;
position: absolute;
right: 0.9rem;
top: 0.7rem;
transition: opacity 0.2s ease-in-out;
width: auto;
z-index: 2;
}

.v-code-block--code:hover .v-code-block--code-copy-button {
opacity: 1;
}
.v-code-block--code-copy-button svg {
height: 1rem;
width: 1rem;
}
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export default defineConfig({
"~": fileURLToPath(new URL("./src", import.meta.url)),
},
},
define: { __INTLIFY_JIT_COMPILATION__: true },
});
Loading