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

Updated the landing page #85

Draft
wants to merge 99 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
5870b04
Latest changes merged with develop
joshring Nov 5, 2024
abdcb4c
removing boxicons
joshring Nov 5, 2024
f3b9e15
added html accessibility
joshring Nov 5, 2024
715ac2f
neatening up
joshring Nov 5, 2024
978adcf
small tweaks, html lang=en, setting default locale, headings ordering
joshring Nov 5, 2024
ed2e1c9
optimised the images, page is now 100KB total
joshring Nov 6, 2024
58105e4
page scales to full width
joshring Nov 6, 2024
ce55610
Revert "page scales to full width"
joshring Nov 6, 2024
30ffaf7
scaling horizontally layout, centered symmetrically
joshring Nov 6, 2024
790ba05
packaged libraries now looks better
joshring Nov 6, 2024
59ca085
spacing to heading gfx libs
joshring Nov 6, 2024
ddf7b01
packaged libraries look better
joshring Nov 6, 2024
35699c9
removing gradients as was over-done
joshring Nov 6, 2024
2dae097
nicer border radius
joshring Nov 6, 2024
9be4cea
rounded corner radius
joshring Nov 6, 2024
4ac91c7
rounded small
joshring Nov 6, 2024
378b6a8
tweaking shadow and radius
joshring Nov 6, 2024
5a59939
toning down the logo
joshring Nov 6, 2024
c0e39b7
header is aligned to content, shifts to smaller style earlier
joshring Nov 6, 2024
8b15b55
header right alignment set correclty
joshring Nov 6, 2024
aa99734
header bottom border colour
joshring Nov 6, 2024
91890cb
logo brightness
joshring Nov 6, 2024
8cbe5d7
small tweaks to footer
joshring Nov 6, 2024
b115954
teaks
joshring Nov 6, 2024
d224c0c
treat quake like other items, rounded and shadow
joshring Nov 6, 2024
68e9c77
link colours
joshring Nov 6, 2024
6f801ca
buttons on top
joshring Nov 6, 2024
328a99e
avoiding fixed height, by putting buttons up top layout shifts become…
joshring Nov 6, 2024
ec931d6
Revert "avoiding fixed height, by putting buttons up top layout shift…
joshring Nov 6, 2024
c81f478
fixed size on desktop, adaptive size on mobile
joshring Nov 6, 2024
ec42dc2
adding C3 features grid
joshring Nov 6, 2024
072c1a8
features and packaged libraries, readability bumped
joshring Nov 6, 2024
aeed7ec
features made more readable
joshring Nov 6, 2024
39cd7d9
tweaking spacing of features
joshring Nov 6, 2024
5a3e49d
improving readability of the packaged libraries and features
joshring Nov 6, 2024
1a49ef0
much cleaned up code
joshring Nov 7, 2024
262ecac
experimenting with the layout
joshring Nov 7, 2024
09b2a38
commented out vendor for now, as it's not ready
joshring Nov 7, 2024
812d282
minor cleanup
joshring Nov 7, 2024
4049848
hover states of cta
joshring Nov 7, 2024
978ab40
tweaks to layout
joshring Nov 7, 2024
63541c0
more small tweaks to layout
joshring Nov 7, 2024
64c213e
layout tweaks
joshring Nov 7, 2024
1921c6c
consistent behaviour with the code demos
joshring Nov 7, 2024
8152795
removing text change on hover in dark on bottom cta
joshring Nov 7, 2024
ff29b66
alignment
joshring Nov 7, 2024
ee7104d
logo brightness
joshring Nov 7, 2024
044b849
improving colours in dark mode
joshring Nov 7, 2024
3d8c495
trailing slash, does this fix mobile?
joshring Nov 7, 2024
8a763ea
better buttons
joshring Nov 7, 2024
3d83e7f
button tweaks
joshring Nov 7, 2024
771db10
button
joshring Nov 7, 2024
b022a4c
fixing breakpoints of header and top bar
joshring Nov 7, 2024
f5e476e
logo
joshring Nov 7, 2024
8f5edda
alignment
joshring Nov 7, 2024
28d9e38
bumping max width
joshring Nov 7, 2024
f26cabd
hover
joshring Nov 7, 2024
879dd6b
logo contrast
joshring Nov 7, 2024
9544262
bottom icons
joshring Nov 7, 2024
6fe8284
removing logo
joshring Nov 7, 2024
59cd67b
Tag line
joshring Nov 7, 2024
7b7c369
,
joshring Nov 7, 2024
b7e3d92
hover colours
joshring Nov 7, 2024
f95d660
align
joshring Nov 7, 2024
dfc5483
icon size
joshring Nov 7, 2024
7292171
removing shadow
joshring Nov 7, 2024
51236fb
borrowed design elements from original
joshring Nov 7, 2024
e65a20c
sizing
joshring Nov 7, 2024
bb506cd
margin on select
joshring Nov 7, 2024
eb76e76
nav tweaks
joshring Nov 7, 2024
df11fcd
tweaks
joshring Nov 7, 2024
c2fe69d
header col
joshring Nov 7, 2024
83bce1e
cleaning up code demo
joshring Nov 7, 2024
4c02d05
tweaking colours
joshring Nov 7, 2024
3fad19f
top nav tweak
joshring Nov 7, 2024
ce4c9e5
colour tweaks
joshring Nov 7, 2024
3f9b942
colour tweaks
joshring Nov 7, 2024
650210b
colour tweaks
joshring Nov 7, 2024
01c2ad7
Merge branch 'c3lang:main' into main
joshring Nov 8, 2024
1a2389c
fixing alignment of code demo button in mobile
joshring Nov 8, 2024
32a8644
improving colours in dark theme
joshring Nov 8, 2024
c99c7ba
adjusting colours and tweaking responsive layout of code demos
joshring Nov 8, 2024
3e12305
more improvements to code demo responsive layout
joshring Nov 8, 2024
8c051ce
mobile tweaks
joshring Nov 8, 2024
a163877
all grids align
joshring Nov 8, 2024
04c0861
responsive layout adjustments
joshring Nov 8, 2024
677d509
more responsive layouts
joshring Nov 8, 2024
dd1d7cb
consistent button widths
joshring Nov 8, 2024
d4f713b
bit more spacing in grids
joshring Nov 8, 2024
1168d27
improving mobile layout
joshring Nov 8, 2024
082f520
fixed code layout and button colour to be less distracting
joshring Nov 8, 2024
7478289
button responsiveness and copy changes
joshring Nov 9, 2024
0d34074
colour improvements and starting some experiments
joshring Nov 9, 2024
0c753f5
Merge remote-tracking branch 'upstream/main'
joshring Nov 9, 2024
bf8efef
improving the design
joshring Nov 11, 2024
be88f01
updating design
joshring Nov 12, 2024
d669181
updated
joshring Nov 12, 2024
cf8c63e
updating code colours
joshring Nov 13, 2024
ff21a56
new colours
joshring Nov 13, 2024
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
2 changes: 1 addition & 1 deletion .astro/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"enabled": false
},
"_variables": {
"lastUpdateCheck": 1731177782673
"lastUpdateCheck": 1730829808749
}
}
249 changes: 0 additions & 249 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
"dependencies": {
"@astrojs/starlight": "^0.28.2",
"@astrojs/tailwind": "^5.1.1",
"@preline/overlay": "^2.0.2",
"astro": "^4.15.9",
"astro-expressive-code": "^0.32.3",
"boxicons": "^2.1.4",
"preline": "^2.0.3",
"tailwindcss": "^3.4.0"
}
}
14 changes: 0 additions & 14 deletions public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,5 @@
@tailwind components;
@tailwind utilities;

.projects {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: center;
}

.card {
width: 30%
}

@media (max-width: 768px) {
.card {
width: 90%
}
}
1,322 changes: 0 additions & 1,322 deletions public/overlay.min.js

This file was deleted.

1 change: 0 additions & 1 deletion public/preline.min.js

This file was deleted.

Binary file added public/vkquake.webp
Binary file not shown.
127 changes: 127 additions & 0 deletions src/components/code_render.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---

const { name, mobile_code, is_default, highlighter } = Astro.props;


let mobile_code_html = highlighter.codeToHtml(
mobile_code,
{
lang: 'c3',
themes: {
light: 'min-light',
// light: 'github-light-default',
dark: 'andromeeda',
}
}
)



// Post-process the code-formatter output to link it to standard Tailwind classes
// This is so that darkmode works as expected
function processHtml(input) {

// remove the background
input = input.replaceAll(
`class="shiki shiki-themes min-light andromeeda" style="background-color:#ffffff;--shiki-dark-bg:#23262E;color:#24292eff;--shiki-dark:#D5CED9"`,
`class="text-gray-800 dark:text-white"`
)

input = input.replaceAll(
`style="color:#24292EFF;--shiki-dark:#D5CED9"`,
`class="text-gray-800 dark:text-white"`
)

// Question marks
input = input.replaceAll(
`style="color:#D32F2F;--shiki-dark:#EE5D43"`,
`class="text-red-800 dark:text-red-500"`
)

// Language keywords
input = input.replaceAll(
`style="color:#D32F2F;--shiki-dark:#C74DED"`,
`class="text-purple-700 dark:text-purple-400"`
)

// Function names
input = input.replaceAll(
`style="color:#6F42C1;--shiki-dark:#FFE66D"`,
`class="text-orange-700 dark:text-amber-400"`
)

// Strings
input = input.replaceAll(
`style="color:#22863A;--shiki-dark:#96E072"`,
`class="text-green-800 dark:text-lime-500"`
)

// Strings special chars
input = input.replaceAll(
`style="color:#22863A;--shiki-dark:#EE5D43"`,
`class="text-green-800 dark:text-lime-600"`
)


// Numbers
input = input.replaceAll(
`style="color:#1976D2;--shiki-dark:#F39C12"`,
`class="text-rose-700 dark:text-rose-400"`
)

// Comments
input = input.replaceAll(
`style="color:#C2C3C5;--shiki-dark:#A0A1A7CC"`,
`class="text-gray-600 dark:text-gray-300"`
)

// Variables
input = input.replaceAll(
`style="color:#24292eff;--shiki-dark:#D5CED9"`,
`class="text-gray-800 dark:text-green-400"`
)

input = input.replaceAll(
`style="color:#212121;--shiki-dark:#D5CED9"`,
`class="text-[#212121] dark:text-[#D5CED9]"`
)

// Enums
input = input.replaceAll(
`style="color:#24292EFF;--shiki-dark:#00E8C6"`,
`class="text-blue-800 dark:text-cyan-400"`
)

// Library functions or errors
input = input.replaceAll(
`style="color:#1976D2;--shiki-dark:#00E8C6"`,
`class="text-blue-800 dark:text-cyan-400"`
)

// Floating point
input = input.replaceAll(
`style="color:#1976D2;--shiki-dark:#EE5D43"`,
`class="text-blue-800 dark:text-red-500"`
)

return input;
}

mobile_code_html = processHtml(mobile_code_html)

---


<div class=`
${is_default && "block"}
${!is_default && "hidden"}

`
id={name}
aria-label="C3 example code"
>
<Fragment set:html={mobile_code_html} />
</div>



204 changes: 204 additions & 0 deletions src/components/demo_code.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---

import type {
HighlighterGeneric,
BundledLanguage,
BundledTheme
} from 'shiki'

interface Props {
selectID: string;
buttons: string[];
code: {
name: string;
mobile_code: string;
}[];
highlighter: HighlighterGeneric<BundledLanguage, BundledTheme>
}

const { selectID, buttons, code, highlighter } = Astro.props;

import CodeRender from "./code_render.astro";

---


<script>

// make a click handler specific for one localStorageKey
function generateClickHandler(localStorageKey) {

return function buttonClickHandler(event) {


if (
localStorage[localStorageKey] != null &&
localStorage[localStorageKey] != undefined &&
localStorage[localStorageKey] != ""
) {
// remove any style adjustments from previous tab was selected
if (event.target.value != localStorage[localStorageKey]) {

let previousMobileCode = document.getElementById(localStorage[localStorageKey])

previousMobileCode.classList.remove("flex");
previousMobileCode.classList.add("hidden");

}
}

// storing which button was clicked
localStorage[localStorageKey] = event.target.value;


let newMobileCode = document.getElementById(localStorage[localStorageKey]);

newMobileCode.classList.remove("hidden");
newMobileCode.classList.add("flex");
}
}

//========================================
// Setup for "Ergonomics & Safety"
const safetyLocalStorageKey ="safety_selected_tab_id";
const ergoButtons = [
"Optionals",
"Defer",
"Slices",
"Contracts",
]
const ergoHandler = generateClickHandler(safetyLocalStorageKey);


document.getElementById("safety_code_examples").addEventListener("change", ergoHandler);

// default select the first element
localStorage[safetyLocalStorageKey] = ergoButtons[0];

//========================================
// Performance By Default

const perfLocalStorageKey = "perf_selected_tab_id";

const perfButtons = [
"Temp Allocator",
"SIMD",
"Inline ASM",
"Threads"
];

const perfByDefaultHandler = generateClickHandler(perfLocalStorageKey);


document.getElementById("perf_code_examples").addEventListener("change", perfByDefaultHandler);

// default select the first element
localStorage[perfLocalStorageKey] = perfButtons[0];


</script>


<div class="
bg-white
dark:bg-[hsl(224,32%,12%)]
rounded-2xl
overflow-x-auto

border-[3px]
border-[hsl(224,12%,90%)]
dark:border-gray-800
"
>
<form>
<label
class="
sr-only
"
for={selectID}
>
Choose Code Example
</label>


<select class=`
mx-10
text-center
w-[calc(100%-5rem)]


mt-5
mb-5
md:mx-8
md:text-left
md:w-max
pr-6
pl-4

py-3

text-black
bg-white
dark:text-gray-100
dark:bg-[hsl(224,20%,6%)]
border-2
border-gray-300
dark:border-gray-700

rounded-2xl

ring-2
dark:ring-[hsl(224,12%,12%)]
ring-[hsl(224,12%,95%)]
dark:hover:border-gray-600
hover:border-gray-400
`

name={selectID}
id={selectID}
>

{buttons.map((item, index) => (
<option class="

"

value={item}
id=`${selectID}_${item}`

>
{item}
</option>
))}

</select>
</form>


<!-- Code container -->
<div class=`
overflow-x-auto

px-3
sm:px-4
pb-4
pt-8
sm:p-8
lg:p-8
`
>

{code.map((item, index) => (
<CodeRender
is_default={index==0 ? true : false}
name={item.name}

mobile_code={item.mobile_code}
highlighter={highlighter}
/>
))}

</div>

</div>

Loading