4 lines
20 KiB
JavaScript
4 lines
20 KiB
JavaScript
|
|
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66796,34251,e=>{"use strict";var t=e.i(26863);e.s(["Typography",()=>t.default],66796);var r=e.i(36807);e.s(["Button",()=>r.default],34251)},76552,e=>{"use strict";var t=e.i(19646);e.s(["Box",()=>t.default])},91882,e=>{"use strict";var t=e.i(52057);e.s(["Container",()=>t.default])},61974,54624,e=>{"use strict";e.i(47167);var t=e.i(71645),r=e.i(55777),i=e.i(94231),i=i,o=e.i(86931);let n={...t}.useSyncExternalStore;function a(e={}){let{themeId:s}=e;return function(e,a={}){let l=(0,o.default)();l&&s&&(l=l[s]||l);let d="undefined"!=typeof window&&void 0!==window.matchMedia,{defaultMatches:c=!1,matchMedia:u=d?window.matchMedia:null,ssrMatchMedia:p=null,noSsr:f=!1}=(0,i.default)({name:"MuiUseMediaQuery",props:a,theme:l}),h="function"==typeof e?e(l):e;return(h=h.replace(/^@media( ?)/m,"")).includes("print")&&console.warn("MUI: You have provided a `print` query to the `useMediaQuery` hook.\nUsing the print media query to modify print styles can lead to unexpected results.\nConsider using the `displayPrint` field in the `sx` prop instead.\nMore information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."),(void 0!==n?function(e,r,i,o,a){let s=t.useCallback(()=>r,[r]),l=t.useMemo(()=>{if(a&&i)return()=>i(e).matches;if(null!==o){let{matches:t}=o(e);return()=>t}return s},[s,e,o,a,i]),[d,c]=t.useMemo(()=>{if(null===i)return[s,()=>()=>{}];let t=i(e);return[()=>t.matches,e=>(t.addEventListener("change",e),()=>{t.removeEventListener("change",e)})]},[s,i,e]);return n(c,d,l)}:function(e,i,o,n,a){let[s,l]=t.useState(()=>a&&o?o(e).matches:n?n(e).matches:i);return(0,r.default)(()=>{if(!o)return;let t=o(e),r=()=>{l(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}},[e,o]),s})(h,c,u,p,f)}}a();let s=a({themeId:e.i(2001).default});e.s(["default",0,s],61974);var l=e.i(7670),d=e.i(95669),c=e.i(42196),u=e.i(40799),p=e.i(75149),f=e.i(94425),h=e.i(98051),m=e.i(95761);function x(e){return(0,m.default)("MuiSvgIcon",e)}(0,h.default)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var y=e.i(43476);let g=(0,u.styled)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${(0,c.default)(r.color)}`],t[`fontSize${(0,c.default)(r.fontSize)}`]]}})((0,p.default)(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),v=t.forwardRef(function(e,r){let i=(0,f.useDefaultProps)({props:e,name:"MuiSvgIcon"}),{children:o,className:n,color:a="inherit",component:s="svg",fontSize:u="medium",htmlColor:p,inheritViewBox:h=!1,titleAccess:m,viewBox:v="0 0 24 24",...b}=i,j=t.isValidElement(o)&&"svg"===o.type,S={...i,color:a,component:s,fontSize:u,instanceFontSize:e.fontSize,inheritViewBox:h,viewBox:v,hasSvgAsChild:j},w={};h||(w.viewBox=v);let k=(e=>{let{color:t,fontSize:r,classes:i}=e,o={root:["root","inherit"!==t&&`color${(0,c.default)(t)}`,`fontSize${(0,c.default)(r)}`]};return(0,d.default)(o,x,i)})(S);return(0,y.jsxs)(g,{as:s,className:(0,l.default)(k.root,n),fo
|
|||
|
|
require("basic");
|
|||
|
|
var(input) = basic.input(string:"");
|
|||
|
|
basic.print(string:"请输入一个数字:" + var(input));`;return(0,t.jsxs)(l.Container,{maxWidth:"lg",sx:{py:{xs:4,md:8}},children:[(0,t.jsxs)(s.Box,{sx:{textAlign:"center",mb:{xs:6,md:10},p:{xs:4,md:8},borderRadius:4,background:"linear-gradient(135deg, rgba(103,58,183,0.05) 0%, rgba(103,58,183,0.1) 100%)"},children:[(0,t.jsx)(o.Typography,{variant:"h3",component:"h1",gutterBottom:!0,sx:{fontWeight:700,mb:3},children:"LeonBasic"}),(0,t.jsx)(o.Typography,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"The LeonBasic Programming Language"}),(0,t.jsx)(o.Typography,{variant:"body1",sx:{maxWidth:600,mx:"auto",fontSize:{xs:"1rem",md:"1.1rem"}},children:"一个简单易懂的编程语言,专为初学者设计,基于Rust实现,融合了Python的简洁和Swift的现代语法特性。"}),(0,t.jsxs)(s.Box,{sx:{mt:6,display:"flex",gap:2,justifyContent:"center",flexWrap:"wrap"},children:[(0,t.jsx)(n.Button,{variant:"contained",startIcon:(0,t.jsx)(h.default,{}),href:"https://github.com/LeonMMcoset/LeonLang",target:"_blank",rel:"noopener noreferrer",sx:{px:3,py:1.2},children:"项目仓库"}),(0,t.jsx)(n.Button,{variant:"outlined",startIcon:(0,t.jsx)(m.default,{}),href:"https://lb.jjmm.ink/",target:"_blank",rel:"noopener noreferrer",sx:{px:3,py:1.2},children:"官方网站"})]})]}),(0,t.jsxs)(s.Box,{sx:{mb:{xs:8,md:12}},children:[(0,t.jsx)(o.Typography,{variant:"h4",component:"h2",gutterBottom:!0,sx:{mb:4,fontWeight:600},children:"项目概述"}),(0,t.jsxs)(a.Grid,{container:!0,spacing:4,children:[(0,t.jsxs)(a.Grid,{size:{xs:12,md:6},children:[(0,t.jsx)(o.Typography,{variant:"body1",sx:{mb:3,lineHeight:1.8},children:"LeonBasic是一门专为编程初学者设计的编程语言,旨在降低编程学习的门槛,同时保持良好的性能和现代语言特性。 该语言基于Rust实现,结合了Python的易读性和Swift的语法优雅,让初学者能够快速上手,同时也能接触到现代编程语言的核心概念。"}),(0,t.jsx)(o.Typography,{variant:"body1",sx:{mb:3,lineHeight:1.8},children:"无论是完全没有编程经验的新手,还是想要了解不同编程范式的开发者,都能从LeonBasic中获益。 简单易学的语法设计让学习过程更加轻松愉快,同时Rust的底层实现又保证了程序的性能和安全性。"})]}),(0,t.jsx)(a.Grid,{size:{xs:12,md:6},children:(0,t.jsx)(r.Card,{sx:{height:"100%",boxShadow:3,borderRadius:2},children:(0,t.jsxs)(i.CardContent,{children:[(0,t.jsx)(o.Typography,{variant:"h6",gutterBottom:!0,sx:{mb:2,fontWeight:600},children:"语言特点"}),(0,t.jsx)(s.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:g.map((r,i)=>(0,t.jsxs)(s.Box,{sx:{display:"flex",alignItems:"flex-start",gap:2},children:[(0,t.jsx)(s.Box,{sx:{color:e.palette.primary.main,mt:.5},children:r.icon}),(0,t.jsxs)(s.Box,{children:[(0,t.jsx)(o.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:r.title}),(0,t.jsx)(o.Typography,{variant:"body2",color:"text.secondary",children:r.description})]})]},i))})]})})})]})]}),(0,t.jsxs)(s.Box,{sx:{mb:{xs:8,md:12}},children:[(0,t.jsx)(o.Typography,{variant:"h4",component:"h2",gutterBottom:!0,sx:{mb:4,fontWeight:600},children:"语法示例"}),(0,t.jsx)(r.Card,{sx:{backgroundColor:"#f5f5f5",borderRadius:2,overflow:"hidden"},children:(0,t.jsx)(s.Box,{sx:{p:3,fontSize:{xs:"0.875rem",md:"1rem"},fontFamily:"monospace",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"#333",maxHeight:400,overflowY:"auto","&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"3px"}},children:v})})]}),(0,t.jsxs)(s.Box,{sx:{mb:6},children:[(0,t.jsx)(o.Typography,{variant:"h4",component:"h2",gutterBottom:!0,sx:{mb:4,fontWeight:600},children:"相关资源"}),(0,t.jsxs)(a.Grid,{container:!0,spacing:3,children:[(0,t.jsx)(a.Grid,{size:{xs:12,sm:6,md:4},children:(0,t.jsx)(r.Card,{sx:{height:"100%",transition:"transform 0.2s","&:hover":{transform:"translateY(-5px)"}},children:(0,t.jsxs)(i.CardContent,{children:[(0,t.jsx)(h.default,{
|