fixes and changes

This commit is contained in:
2024-06-25 13:39:02 +02:00
parent 83f760bd8b
commit ea9a321e82
5 changed files with 30 additions and 224 deletions
-114
View File
@@ -1,114 +0,0 @@
export function WystWhite() {
return <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="50px" height="50px" viewBox="0 0 1280.000000 1280.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,1260.000000) scale(0.100000,-0.100000)"
fill="#fff" stroke="none">
<path d="M6324 12781 c-22 -10 -50 -31 -62 -46 -12 -15 -97 -149 -188 -296
-162 -262 -167 -269 -199 -269 -18 0 -52 -3 -76 -6 l-44 -6 -228 245 c-239
256 -264 277 -343 277 -19 0 -49 -6 -67 -14 -66 -27 -87 -67 -208 -389 l-114
-306 -67 -21 c-36 -11 -73 -20 -80 -20 -8 0 -131 84 -274 187 -142 103 -277
193 -299 201 -48 16 -95 9 -151 -23 -68 -40 -78 -73 -134 -420 -28 -171 -50
-313 -50 -317 0 -8 -127 -78 -143 -78 -7 0 -146 61 -310 136 -287 131 -301
136 -352 132 -67 -6 -125 -42 -151 -95 -22 -44 -22 -62 -11 -453 l9 -275 -60
-48 -60 -47 -323 76 c-347 82 -373 84 -435 42 -17 -12 -40 -35 -52 -53 -42
-61 -39 -95 42 -435 l74 -315 -41 -52 -42 -52 -81 -1 c-45 0 -195 5 -333 11
-188 7 -261 7 -287 -1 -80 -27 -133 -104 -134 -194 0 -43 19 -92 136 -347
l135 -297 -31 -62 c-17 -33 -36 -63 -43 -65 -7 -3 -156 -27 -332 -55 -312 -49
-365 -63 -365 -95 0 -8 -4 -15 -10 -15 -14 0 -58 -80 -65 -120 -4 -21 -1 -52
7 -75 8 -22 98 -156 201 -299 103 -142 187 -265 187 -273 0 -8 -9 -45 -20 -81
l-21 -67 -306 -114 c-322 -121 -362 -142 -389 -208 -8 -18 -14 -48 -14 -67 0
-79 21 -105 272 -338 l240 -223 -7 -70 c-4 -38 -7 -70 -8 -70 -14 -4 -77 -59
-77 -68 0 -7 -106 -77 -235 -156 -129 -80 -244 -154 -254 -165 -27 -29 -51
-89 -51 -126 0 -38 24 -98 51 -126 11 -12 144 -97 295 -190 185 -114 275 -175
278 -189 3 -11 7 -47 11 -81 l6 -61 -245 -228 c-255 -237 -276 -262 -276 -340
0 -64 40 -129 101 -161 15 -7 154 -61 310 -119 155 -57 287 -109 293 -115 11
-11 46 -117 46 -141 0 -9 -87 -137 -194 -286 -205 -287 -216 -308 -196 -384
32 -116 54 -126 447 -189 l323 -53 35 -64 c19 -35 35 -69 35 -77 0 -7 -61
-145 -135 -307 -148 -323 -154 -344 -114 -427 13 -26 38 -54 62 -70 47 -32 49
-32 472 -19 l270 9 48 -60 47 -60 -76 -318 c-53 -226 -74 -331 -71 -362 8 -79
80 -151 159 -159 31 -3 136 18 362 71 l318 76 60 -47 60 -48 -9 -280 c-11
-391 -11 -404 11 -448 26 -53 84 -89 151 -95 51 -4 66 2 352 132 165 75 305
136 311 136 15 0 142 -70 142 -78 0 -3 23 -148 51 -322 41 -256 56 -323 75
-358 40 -69 135 -105 209 -80 22 8 156 98 299 201 142 103 265 187 273 187 8
0 45 -9 81 -20 l67 -21 114 -306 c121 -322 142 -362 208 -389 18 -8 48 -14 67
-14 79 0 104 20 342 276 l227 245 61 -6 c34 -4 70 -8 81 -10 14 -3 74 -93 189
-280 93 -151 179 -284 190 -294 54 -51 141 -64 205 -31 53 27 65 43 246 338
108 177 167 263 180 266 11 3 47 7 81 11 l61 6 227 -245 c238 -255 264 -276
341 -276 65 0 129 40 161 102 8 15 61 154 119 310 58 155 110 287 115 292 11
11 117 46 141 46 9 0 117 -73 240 -161 328 -237 322 -233 383 -233 69 0 122
28 156 80 23 37 33 83 80 368 l52 326 65 35 c35 19 69 35 77 35 7 0 145 -61
307 -135 246 -113 302 -135 342 -135 63 0 120 30 154 82 33 49 32 44 20 468
l-8 275 60 47 60 48 317 -75 c175 -41 331 -75 348 -75 46 0 111 37 141 80 46
67 44 93 -39 443 l-76 318 48 60 47 60 270 -8 c423 -13 425 -13 472 19 24 16
49 44 62 70 40 83 34 104 -114 427 -74 162 -135 300 -135 307 0 8 16 42 35 77
l35 64 323 53 c393 63 415 73 447 189 20 76 9 97 -196 384 -107 149 -194 277
-194 286 0 24 35 130 46 141 5 5 136 56 292 114 156 58 295 112 310 120 62 32
102 96 102 161 0 77 -21 103 -276 341 l-245 227 6 61 c4 34 8 70 11 81 3 14
93 75 278 188 151 93 283 179 295 191 27 28 51 88 51 126 0 38 -24 98 -51 126
-11 11 -143 97 -294 190 -187 115 -277 175 -280 189 -2 11 -6 47 -10 81 l-6
60 245 228 c255 237 276 263 276 341 0 68 -42 130 -110 164 -19 10 -162 64
-317 122 l-282 104 -21 67 c-11 36 -20 73 -20 80 0 8 84 131 187 274 103 142
193 277 201 299 25 74 -11 169 -80 209 -35 20 -102 34 -360 75 -174 28 -319
51 -321 51 -7 0 -77 129 -77 142 0 6 61 146 136 311 130 286 136 301 132 352
-6 67 -42 125 -95 151 -44 22 -57 22 -448 11 l-280 -9 -48 60 -47 60 76 318
c53 227 74 331 71 362 -5 49 -37 100 -81 130 -62 42 -88 40 -435 -42 l-323
-77 -60 48 -59 48 8 270 c13 423 13 425 -19 472 -16 24 -44 49 -70 62 -81 39
-101 34 -426 -114 -163 -74 -302 -135 -309 -135 -7 0 -41 16 -76 35 l-64 35
-53 323 c-63 393 -73 415 -189 447 -76 20 -97 9 -384 -196 -149 -107 -277
-194 -286 -194 -24 0 -130 35 -141 46 -5 5 -56 136 -114 292 -58 156 -112 295
-120 310 -32 62 -96 102 -161 102 -77 0 -103 -21 -341 -276 l-227 -245 -61 6
c-34 4 -70 8 -81 11 -13 3 -72 89 -180 266 -88 143 -171 274 -184 290 -53 64
-140 84 -217 49z m186 -1136 c154 -54 261 -221 247 -387 -11 -134 -95 -256
-216 -316 -50 -24 -67 -27 -161 -27 -94 0 -111 3 -161 27 -121 60 -205 182
-216 316 -19 226 173 423 397 408 36 -3 85 -12 110 -21z m-662 -935 c266 -280
318 -330 368 -354 108 -53 245 -44 341 21 22 15 190 171 373 346 l332 319 37
-7 c20 -3 117 -26 216 -50 701 -172 1335 -493 1895 -961 133 -110 383 -356
510 -500 101 -116 260 -316 260 -328 0 -3 -438 -7 -972 -8 l-973 -3 -3 -592
-2 -593 275 0 c151 0 275 -3 275 -8 0 -13 -559 -2206 -567 -2224 -6 -12 -134
343 -398 1093 -214 611 -391 1117 -393 1125 -3 12 40 14 277 14 l281 0 0 595
0 595 -1390 0 -1390 0 0 -595 0 -595 280 0 c154 0 280 -2 280 -5 0 -10 -630
-2240 -639 -2260 -8 -19 -130 343 -662 1960 -50 154 -94 286 -96 293 -4 9 56
12 281 12 l286 0 -2 593 -3 592 -1158 5 -1159 5 82 107 c95 125 282 329 466
508 559 544 1271 948 2029 1150 141 38 325 79 341 77 6 -1 151 -148 322 -327z
m-3877 -2494 c75 -17 134 -53 192 -115 74 -79 91 -126 92 -251 0 -99 -2 -109
-32 -171 -39 -79 -102 -140 -181 -177 -50 -24 -70 -27 -157 -27 -87 0 -107 3
-157 27 -235 110 -296 421 -119 605 98 102 228 141 362 109z m9030 -20 c107
-25 202 -102 256 -206 25 -50 28 -65 28 -160 0 -93 -3 -112 -27 -162 -34 -74
-112 -152 -186 -186 -50 -24 -69 -27 -157 -27 -87 0 -107 3 -157 27 -114 53
-195 160 -218 286 -39 220 139 436 365 441 22 0 65 -5 96 -13z m-394 -1090
c241 -107 443 -203 450 -213 8 -12 16 -101 23 -243 30 -618 -67 -1250 -282
-1835 -153 -417 -394 -855 -657 -1195 -76 -98 -323 -381 -377 -432 l-29 -27
-415 90 c-357 78 -425 90 -486 86 -121 -7 -236 -85 -286 -195 -11 -24 -64
-250 -118 -504 -55 -253 -100 -461 -102 -462 -10 -7 -138 -60 -223 -94 -1014
-399 -2176 -425 -3211 -71 -257 88 -463 177 -469 203 -3 12 -48 221 -100 466
-56 261 -104 463 -117 489 -30 62 -98 128 -164 158 -103 47 -127 45 -580 -52
l-409 -88 -84 89 c-385 409 -706 911 -923 1449 -207 511 -328 1143 -328 1713
0 182 20 475 33 489 7 6 187 89 402 183 324 142 391 168 400 156 5 -8 300
-833 655 -1835 l645 -1821 1037 0 1037 0 15 53 c8 28 118 455 246 947 127 492
234 903 238 913 4 11 107 -327 286 -948 l279 -965 1046 2 1045 3 537 1840
c296 1012 538 1841 538 1843 2 6 33 -8 448 -192z m-6884 -4274 c80 -37 145
-101 184 -180 25 -51 28 -67 28 -162 0 -95 -3 -111 -28 -162 -84 -170 -275
-255 -454 -199 -164 51 -266 189 -266 361 0 279 284 460 536 342z m5629 -14
c295 -136 295 -552 0 -691 -60 -28 -77 -32 -157 -32 -80 0 -97 4 -155 31 -80
38 -149 105 -187 182 -25 51 -28 67 -28 162 0 87 4 113 22 153 46 99 126 173
228 210 74 26 201 19 277 -15z"/>
</g>
</svg>;
}
export const wyst_white_svg = "wyst_white.svg";
export const wyst_black_svg = "wyst_black.svg";
const Logo = () => {
return (
<picture>
<source srcSet={wyst_black_svg} media="(prefers-color-scheme: dark)" />
<source srcSet={wyst_black_svg} media="(prefers-color-scheme: light)" />
<img src={wyst_black_svg} alt="Logo" width="50" height="auto" />
</picture>
);
};
export default Logo;
-6
View File
@@ -10,11 +10,5 @@
"packages": { "packages": {
"title": "Packages", "title": "Packages",
"type": "page" "type": "page"
},
"contact": {
"title": "Contact ↗",
"type": "page",
"href": "https://twitter.com/shuding_",
"newWindow": true
} }
} }
-90
View File
@@ -1,90 +0,0 @@
.grid {
display: grid;
gap: 10px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
margin-top: 20px;
}
.gridItem {
color: #d1d1d1;
background-color: #141414;
border: 1px solid #202020;
padding: 20px; /* Padding inside grid items */
text-align: center; /* Centering text inside grid items */
}
.gridItem:hover {
color: #0366d6;
background-color: #1976d21c;
cursor: pointer;
/* border: 1px solid #0366d6; */
padding: 20px;
text-align: center;
}
.gridItemLight {
background-color: #fff;
border: 1px solid #eee;
padding: 20px;
text-align: center;
}
.gridItemLight:hover {
color: #005cc5;
background-color: #1976d220;
/* border: 1px solid rgba(59,130,246,.5); */
/* border: 1px solid #eee; */
padding: 20px;
text-align: center;
}
.pkgTitle {
font-weight: bold;
}
.pkgVersion {
font-size: 12px;
font-weight:700;
}
.searchBox {
padding: 8px;
font-size: 16px;
outline: none;
transition: border-color 0.3s ease;
height: 40px;
border-radius: 10px;
border: 1px solid #005cc523;
}
.pageBtn {
/* border-width: 1px; */
/* border-color: #005cc53f; */
background-color: #202020;
width: 30px;
height: 30px;
}
.pageBtn:hover {
background-color: #1976d234;
}
.pageBtnLight {
/* border-width: 1px; */
/* border-color: #005cc53f; */
/* background-color: #202020; */
background-color: #fff;
border: 1px solid #eee;
width: 30px;
height: 30px;
}
.pageBtnLight:hover {
background-color: #1976d234;
}
+22 -12
View File
@@ -1,11 +1,9 @@
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { useTheme } from 'nextra-theme-docs'; import { useTheme } from 'nextra-theme-docs';
import styles from './Grid.module.css'; import styles from './Packages.module.css';
const Packages = () => { const Packages = () => {
const theme = useTheme().theme; const [CurrentSearchQuery, setCurrentSearchQuery] = useState('*');
const isDark = theme!== "light";
const [CurrentSearchQuery, setCurrentSearchQuery] = useState('');
const [currentSearch, setCurrentSearch] = useState([]); const [currentSearch, setCurrentSearch] = useState([]);
const [currentPage, setCurrentPage] = useState(1); const [currentPage, setCurrentPage] = useState(1);
@@ -21,10 +19,10 @@ const Packages = () => {
} }
const items = data.items.map((item, i) => { const items = data.items.map((item, i) => {
return ( return (
<div className={isDark ? styles.gridItem : styles.gridItemLight} key={i}> <a className={styles.gridItem} key={i} href={item.repo} target="_blank">
<h1 className={styles.pkgTitle}>{item.name}</h1> <h1 className={styles.pkgTitle}>{item.name}</h1>
<h4 className={styles.pkgVersion}>{item.latest}</h4> <h4 className={styles.pkgVersion}>{item.version}</h4>
</div> </a>
) )
}); });
setCurrentSearch(items); setCurrentSearch(items);
@@ -41,20 +39,21 @@ const Packages = () => {
}; };
useEffect(() => { useEffect(() => {
const ac = setTimeout(() => {handleSearchChange(CurrentSearchQuery)}, 600); const ac = setTimeout(() => {handleSearchChange(CurrentSearchQuery!=='' ? CurrentSearchQuery : '*')}, 600);
return () => { return () => {
clearTimeout(ac); clearTimeout(ac);
} }
}, [CurrentSearchQuery]); }, [CurrentSearchQuery]);
useEffect(() => { useEffect(() => {
const ac = setTimeout(() => {handleSearchChange(CurrentSearchQuery)}, 100); const ac = setTimeout(() => {
handleSearchChange(CurrentSearchQuery);
}, 300);
return () => { return () => {
clearTimeout(ac); clearTimeout(ac);
} }
}, [currentPage]); }, [currentPage]);
return ( return (
<> <>
{filters} {filters}
@@ -64,8 +63,19 @@ const Packages = () => {
</div> </div>
</div> </div>
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: "20px" }}> <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: "20px" }}>
<button className={isDark ? styles.pageBtn : styles.pageBtnLight} onClick={handlePrevClick} style={{marginRight: "20px"}}>{"<"}</button> <button
<button className={isDark ? styles.pageBtn : styles.pageBtnLight} onClick={handleNextClick}>{">"}</button> className={styles.pageBtn}
onClick={handlePrevClick}
style={{marginRight: "20px"}}
>
{"<"}
</button>
<button
className={styles.pageBtn}
onClick={handleNextClick}
>
{">"}
</button>
</div> </div>
</> </>
); );
+8 -2
View File
@@ -1,8 +1,9 @@
import React from 'react' import React from 'react'
import { DocsThemeConfig } from 'nextra-theme-docs' import { DocsThemeConfig, useTheme } from 'nextra-theme-docs'
import Logo from './components/images'
const config: DocsThemeConfig = { const config: DocsThemeConfig = {
logo: <span>Wyst Lang</span>, logo: <span><Logo/></span>,
project: { project: {
link: 'https://github.com/wyst-lang/wyst', link: 'https://github.com/wyst-lang/wyst',
}, },
@@ -10,6 +11,11 @@ const config: DocsThemeConfig = {
link: 'https://discord.gg/nCePwckd4q', link: 'https://discord.gg/nCePwckd4q',
}, },
docsRepositoryBase: 'https://github.com/wyst-lang/wyst', docsRepositoryBase: 'https://github.com/wyst-lang/wyst',
useNextSeoProps() {
return {
titleTemplate: '%s - Wyst'
}
}
} }
export default config export default config