Skip to content
Open
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
44 changes: 40 additions & 4 deletions cornucopia.owasp.org/src/lib/components/renderers/code.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,47 @@
let { lang = "javascript", text }: Props = $props();
</script>

<p><strong>{lang}:</strong></p>
<p>{text}</p>
<div class="code-container">
<p><strong>{lang}:</strong></p>
<pre><code>{text}</code></pre>
</div>

<style>
p {
.code-container {
margin: 1rem 0;
border-radius: 0.5rem;
background-color: #f8f9fa;
border: 1px solid #e9ecef;
overflow-x: auto;
max-width: 100%;
width: 100%;
}
.code-container p {
margin: 0.5rem 1rem;
font-family: ui-sans-serif, system-ui, sans-serif;
font-size: 0.875rem;
color: #6c757d;
}
pre {
margin: 0;
padding: 1rem;
overflow-x: auto;
font-family: 'Courier New', Courier, monospace;
font-size: 0.875rem;
line-height: 1.5;
white-space: pre;
word-wrap: normal;
overflow-wrap: normal;
max-width: 100%;
width: 100%;
box-sizing: border-box;
}
code {
white-space: pre;
word-wrap: normal;
overflow-wrap: normal;
}
</style>
</style>
199 changes: 103 additions & 96 deletions cornucopia.owasp.org/static/css/base.css
Original file line number Diff line number Diff line change
@@ -1,136 +1,143 @@
/* This file contains all base styling and CSS variables */
:root
{
--accent: #61b6e6;
--background: #1f2937;
--background-color: rgb(246, 249, 252);
--white : #ededed;
--green: rgb(0, 209, 0);
--font-body : ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--transition: all ease .2s;
--box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

body
{
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
color:#1f2937;
margin:0;
padding: 0;
:root {
--accent: #61b6e6;
--background: #1f2937;
--background-color: rgb(246, 249, 252);
--white: #ededed;
--green: rgb(0, 209, 0);
--font-body:
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
--transition: all ease 0.2s;
--box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

body {
font-family:
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
color: #1f2937;
margin: 0;
padding: 0;
}

html
{
scroll-behavior:smooth;
html {
scroll-behavior: smooth;
}

a
{
text-decoration: underline;
padding: .10rem;
border-radius: .25rem;
color: var(--background);
transition: var(--transition);
a {
text-decoration: underline;
padding: 0.1rem;
border-radius: 0.25rem;
color: var(--background);
transition: var(--transition);
word-wrap: break-word;
overflow-wrap: break-word;
word-break: break-word;
max-width: 100%;
}

h1,h2,h3,h4,h5,h6
{
font-weight: bold;
color: #1f2937
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: bold;
color: #1f2937;
}

h1
{
padding: .5rem;
h1 {
padding: 0.5rem;
}

a:visited
{
color:#800080;
a:visited {
color: #800080;
}

/* Add a 'external link' svg to all links that are external */
.link-with-external-indicator[href^="http"]:not([href*="cornucopia-mvp.vercel.app"]):not([href*="localhost"]):after {
content: '';
display: inline-block;
margin-left: 0.2em;
width: 1rem;
height: 1rem;
-webkit-mask: url('/icons/external-link.svg') no-repeat 50% 50%;
mask: url('/icons/external-link.svg') no-repeat 50% 50%;
-webkit-mask-size: cover;
mask-size: cover;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
background-color: currentColor;
.link-with-external-indicator[href^="http"]:not(
[href*="cornucopia-mvp.vercel.app"]
):not([href*="localhost"]):after {
content: "";
display: inline-block;
margin-left: 0.2em;
width: 1rem;
height: 1rem;
-webkit-mask: url("/icons/external-link.svg") no-repeat 50% 50%;
mask: url("/icons/external-link.svg") no-repeat 50% 50%;
-webkit-mask-size: cover;
mask-size: cover;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
background-color: currentColor;
}

.display-s {
display: contents
display: contents;
}

.how-to-play
{
width:59vw;
height:auto;
aspect-ratio:16/9;
.how-to-play {
width: 59vw;
height: auto;
aspect-ratio: 16/9;
}

.error-container {
width: 90%;
margin: auto;
padding: 0rem;
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
margin-top: 4rem;
width: 90%;
margin: auto;
padding: 0rem;
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
margin-top: 4rem;
}

.error-text {
outline: 1px rgb(231, 231, 231) solid;
height: 100%;
min-height: 22vw;
width: calc(50% - 4rem);
opacity: 80%;
border-radius: 1rem;
background-color: rgb(255, 255, 255);
padding: 1rem 2rem 1rem 1rem;
box-shadow: var(--box-shadow);
outline: 1px rgb(231, 231, 231) solid;
height: 100%;
min-height: 22vw;
width: calc(50% - 4rem);
opacity: 80%;
border-radius: 1rem;
background-color: rgb(255, 255, 255);
padding: 1rem 2rem 1rem 1rem;
box-shadow: var(--box-shadow);
}

.error-text.desktop-left {
padding: 1rem 1rem 1rem 2rem;
padding: 1rem 1rem 1rem 2rem;
}

.error-image {
width: 50%;
text-align: center;
width: 50%;
text-align: center;
}

.error.desktop-left {
flex-direction: row;
flex-direction: row;
}

.hide {
display: none;
display: none;
}

@media (max-aspect-ratio: 1/1) {
.error-container {
flex-direction: column;
}

.error-image {
width: 90%;
padding: 0;
margin: auto;
}

.error-text {
padding: 1rem;
height: 100%;
width: calc(100% - 2rem);
}
}
.error-container {
flex-direction: column;
}

.error-image {
width: 90%;
padding: 0;
margin: auto;
}

.error-text {
padding: 1rem;
height: 100%;
width: calc(100% - 2rem);
}
}
Loading