@float.js/core 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +741 -454
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +741 -454
- package/dist/index.js.map +1 -1
- package/dist/server/index.js +741 -454
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1703,493 +1703,765 @@ var FLOAT_ERROR_OVERLAY = `
|
|
|
1703
1703
|
init_esm_shims();
|
|
1704
1704
|
function generateWelcomePage() {
|
|
1705
1705
|
return `<!DOCTYPE html>
|
|
1706
|
-
<html lang="en">
|
|
1706
|
+
<html lang="en" class="light">
|
|
1707
1707
|
<head>
|
|
1708
1708
|
<meta charset="UTF-8">
|
|
1709
1709
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1710
1710
|
<title>Welcome to Float.js</title>
|
|
1711
|
-
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0
|
|
1712
|
-
<
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
--float-cyan: #06b6d4;
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
body {
|
|
1725
|
-
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
1726
|
-
background: #0a0a0b;
|
|
1727
|
-
color: white;
|
|
1728
|
-
min-height: 100vh;
|
|
1729
|
-
overflow-x: hidden;
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
/* Animated background */
|
|
1733
|
-
.bg-gradient {
|
|
1734
|
-
position: fixed;
|
|
1735
|
-
inset: 0;
|
|
1736
|
-
background:
|
|
1737
|
-
radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.3), transparent),
|
|
1738
|
-
radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.15), transparent),
|
|
1739
|
-
radial-gradient(ellipse 40% 30% at 20% 80%, rgba(217, 70, 239, 0.1), transparent);
|
|
1740
|
-
pointer-events: none;
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
.bg-grid {
|
|
1744
|
-
position: fixed;
|
|
1745
|
-
inset: 0;
|
|
1746
|
-
background-image:
|
|
1747
|
-
linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
|
|
1748
|
-
linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
|
|
1749
|
-
background-size: 60px 60px;
|
|
1750
|
-
pointer-events: none;
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
/* Floating orbs */
|
|
1754
|
-
.orb {
|
|
1755
|
-
position: fixed;
|
|
1756
|
-
border-radius: 50%;
|
|
1757
|
-
filter: blur(80px);
|
|
1758
|
-
opacity: 0.5;
|
|
1759
|
-
animation: float 20s ease-in-out infinite;
|
|
1760
|
-
pointer-events: none;
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
.orb-1 {
|
|
1764
|
-
width: 400px;
|
|
1765
|
-
height: 400px;
|
|
1766
|
-
background: var(--float-purple);
|
|
1767
|
-
top: -100px;
|
|
1768
|
-
right: -100px;
|
|
1769
|
-
animation-delay: 0s;
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
.orb-2 {
|
|
1773
|
-
width: 300px;
|
|
1774
|
-
height: 300px;
|
|
1775
|
-
background: var(--float-pink);
|
|
1776
|
-
bottom: -50px;
|
|
1777
|
-
left: -50px;
|
|
1778
|
-
animation-delay: -7s;
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
.orb-3 {
|
|
1782
|
-
width: 200px;
|
|
1783
|
-
height: 200px;
|
|
1784
|
-
background: var(--float-cyan);
|
|
1785
|
-
top: 50%;
|
|
1786
|
-
left: 50%;
|
|
1787
|
-
animation-delay: -14s;
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
@keyframes float {
|
|
1791
|
-
0%, 100% { transform: translate(0, 0) scale(1); }
|
|
1792
|
-
25% { transform: translate(30px, -30px) scale(1.1); }
|
|
1793
|
-
50% { transform: translate(-20px, 20px) scale(0.9); }
|
|
1794
|
-
75% { transform: translate(20px, 10px) scale(1.05); }
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
/* Main content */
|
|
1798
|
-
.container {
|
|
1799
|
-
position: relative;
|
|
1800
|
-
max-width: 1200px;
|
|
1801
|
-
margin: 0 auto;
|
|
1802
|
-
padding: 60px 24px;
|
|
1803
|
-
min-height: 100vh;
|
|
1804
|
-
display: flex;
|
|
1805
|
-
flex-direction: column;
|
|
1806
|
-
align-items: center;
|
|
1807
|
-
justify-content: center;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
/* Logo */
|
|
1811
|
-
.logo {
|
|
1812
|
-
margin-bottom: 48px;
|
|
1813
|
-
animation: fadeInUp 0.8s ease-out;
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
.logo svg {
|
|
1817
|
-
width: 80px;
|
|
1818
|
-
height: 80px;
|
|
1819
|
-
filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.5));
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
/* Hero */
|
|
1823
|
-
.hero {
|
|
1824
|
-
text-align: center;
|
|
1825
|
-
margin-bottom: 64px;
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
.hero h1 {
|
|
1829
|
-
font-size: clamp(48px, 10vw, 80px);
|
|
1830
|
-
font-weight: 800;
|
|
1831
|
-
letter-spacing: -0.03em;
|
|
1832
|
-
line-height: 1.1;
|
|
1833
|
-
margin-bottom: 24px;
|
|
1834
|
-
animation: fadeInUp 0.8s ease-out 0.1s both;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
.hero h1 .gradient {
|
|
1838
|
-
background: linear-gradient(135deg, var(--float-indigo), var(--float-purple), var(--float-pink));
|
|
1839
|
-
-webkit-background-clip: text;
|
|
1840
|
-
-webkit-text-fill-color: transparent;
|
|
1841
|
-
background-clip: text;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
.hero p {
|
|
1845
|
-
font-size: 20px;
|
|
1846
|
-
color: rgba(255,255,255,0.6);
|
|
1847
|
-
max-width: 600px;
|
|
1848
|
-
margin: 0 auto;
|
|
1849
|
-
line-height: 1.7;
|
|
1850
|
-
animation: fadeInUp 0.8s ease-out 0.2s both;
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
/* Features */
|
|
1854
|
-
.features {
|
|
1855
|
-
display: grid;
|
|
1856
|
-
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
1857
|
-
gap: 20px;
|
|
1858
|
-
width: 100%;
|
|
1859
|
-
max-width: 900px;
|
|
1860
|
-
margin-bottom: 64px;
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
|
-
.feature {
|
|
1864
|
-
background: rgba(255,255,255,0.03);
|
|
1865
|
-
border: 1px solid rgba(255,255,255,0.06);
|
|
1866
|
-
border-radius: 20px;
|
|
1867
|
-
padding: 28px;
|
|
1868
|
-
transition: all 0.3s ease;
|
|
1869
|
-
animation: fadeInUp 0.8s ease-out both;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
.feature:nth-child(1) { animation-delay: 0.3s; }
|
|
1873
|
-
.feature:nth-child(2) { animation-delay: 0.4s; }
|
|
1874
|
-
.feature:nth-child(3) { animation-delay: 0.5s; }
|
|
1875
|
-
|
|
1876
|
-
.feature:hover {
|
|
1877
|
-
background: rgba(255,255,255,0.05);
|
|
1878
|
-
border-color: rgba(139, 92, 246, 0.3);
|
|
1879
|
-
transform: translateY(-4px);
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
.feature-icon {
|
|
1883
|
-
width: 48px;
|
|
1884
|
-
height: 48px;
|
|
1885
|
-
background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
|
|
1886
|
-
border-radius: 14px;
|
|
1887
|
-
display: flex;
|
|
1888
|
-
align-items: center;
|
|
1889
|
-
justify-content: center;
|
|
1890
|
-
margin-bottom: 16px;
|
|
1891
|
-
font-size: 24px;
|
|
1892
|
-
}
|
|
1893
|
-
|
|
1894
|
-
.feature h3 {
|
|
1895
|
-
font-size: 18px;
|
|
1896
|
-
font-weight: 600;
|
|
1897
|
-
margin-bottom: 8px;
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
.feature p {
|
|
1901
|
-
font-size: 14px;
|
|
1902
|
-
color: rgba(255,255,255,0.5);
|
|
1903
|
-
line-height: 1.6;
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
/* Code block */
|
|
1907
|
-
.code-section {
|
|
1908
|
-
width: 100%;
|
|
1909
|
-
max-width: 600px;
|
|
1910
|
-
animation: fadeInUp 0.8s ease-out 0.6s both;
|
|
1911
|
-
margin-bottom: 48px;
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
.code-header {
|
|
1915
|
-
background: rgba(255,255,255,0.05);
|
|
1916
|
-
border: 1px solid rgba(255,255,255,0.08);
|
|
1917
|
-
border-bottom: none;
|
|
1918
|
-
border-radius: 16px 16px 0 0;
|
|
1919
|
-
padding: 14px 20px;
|
|
1920
|
-
display: flex;
|
|
1921
|
-
align-items: center;
|
|
1922
|
-
gap: 8px;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
.code-dots {
|
|
1926
|
-
display: flex;
|
|
1927
|
-
gap: 6px;
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
.code-dot {
|
|
1931
|
-
width: 12px;
|
|
1932
|
-
height: 12px;
|
|
1933
|
-
border-radius: 50%;
|
|
1934
|
-
background: rgba(255,255,255,0.1);
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
.code-dot:nth-child(1) { background: #ff5f57; }
|
|
1938
|
-
.code-dot:nth-child(2) { background: #febc2e; }
|
|
1939
|
-
.code-dot:nth-child(3) { background: #28c840; }
|
|
1940
|
-
|
|
1941
|
-
.code-title {
|
|
1942
|
-
margin-left: auto;
|
|
1943
|
-
font-size: 12px;
|
|
1944
|
-
color: rgba(255,255,255,0.4);
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
.code-block {
|
|
1948
|
-
background: rgba(0,0,0,0.4);
|
|
1949
|
-
border: 1px solid rgba(255,255,255,0.08);
|
|
1950
|
-
border-radius: 0 0 16px 16px;
|
|
1951
|
-
padding: 24px;
|
|
1952
|
-
font-family: 'Monaco', 'Menlo', monospace;
|
|
1953
|
-
font-size: 14px;
|
|
1954
|
-
line-height: 1.8;
|
|
1955
|
-
overflow-x: auto;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
.code-line {
|
|
1959
|
-
display: flex;
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
.code-number {
|
|
1963
|
-
color: rgba(255,255,255,0.2);
|
|
1964
|
-
width: 40px;
|
|
1965
|
-
flex-shrink: 0;
|
|
1966
|
-
user-select: none;
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
.code-content {
|
|
1970
|
-
color: rgba(255,255,255,0.8);
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
.code-keyword { color: #c792ea; }
|
|
1974
|
-
.code-string { color: #c3e88d; }
|
|
1975
|
-
.code-function { color: #82aaff; }
|
|
1976
|
-
.code-comment { color: rgba(255,255,255,0.3); }
|
|
1977
|
-
.code-tag { color: #f07178; }
|
|
1978
|
-
.code-attr { color: #ffcb6b; }
|
|
1979
|
-
|
|
1980
|
-
/* Quick start */
|
|
1981
|
-
.quick-start {
|
|
1982
|
-
text-align: center;
|
|
1983
|
-
animation: fadeInUp 0.8s ease-out 0.7s both;
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
.quick-start h2 {
|
|
1987
|
-
font-size: 14px;
|
|
1988
|
-
font-weight: 500;
|
|
1989
|
-
color: rgba(255,255,255,0.4);
|
|
1990
|
-
text-transform: uppercase;
|
|
1991
|
-
letter-spacing: 0.1em;
|
|
1992
|
-
margin-bottom: 20px;
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
|
-
.quick-start-cmd {
|
|
1996
|
-
display: inline-flex;
|
|
1997
|
-
align-items: center;
|
|
1998
|
-
gap: 12px;
|
|
1999
|
-
background: rgba(255,255,255,0.05);
|
|
2000
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
2001
|
-
border-radius: 12px;
|
|
2002
|
-
padding: 16px 24px;
|
|
2003
|
-
font-family: 'Monaco', 'Menlo', monospace;
|
|
2004
|
-
font-size: 15px;
|
|
2005
|
-
cursor: pointer;
|
|
2006
|
-
transition: all 0.2s;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
.quick-start-cmd:hover {
|
|
2010
|
-
background: rgba(255,255,255,0.08);
|
|
2011
|
-
border-color: rgba(139, 92, 246, 0.4);
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
.quick-start-cmd .prompt {
|
|
2015
|
-
color: var(--float-purple);
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
.quick-start-cmd .text {
|
|
2019
|
-
color: rgba(255,255,255,0.8);
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
.quick-start-cmd .copy {
|
|
2023
|
-
opacity: 0.4;
|
|
2024
|
-
transition: opacity 0.2s;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
.quick-start-cmd:hover .copy {
|
|
2028
|
-
opacity: 0.8;
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
/* Links */
|
|
2032
|
-
.links {
|
|
2033
|
-
display: flex;
|
|
2034
|
-
gap: 24px;
|
|
2035
|
-
margin-top: 48px;
|
|
2036
|
-
animation: fadeInUp 0.8s ease-out 0.8s both;
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
.link {
|
|
2040
|
-
color: rgba(255,255,255,0.5);
|
|
2041
|
-
text-decoration: none;
|
|
2042
|
-
font-size: 14px;
|
|
2043
|
-
display: flex;
|
|
2044
|
-
align-items: center;
|
|
2045
|
-
gap: 6px;
|
|
2046
|
-
transition: color 0.2s;
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
|
-
.link:hover {
|
|
2050
|
-
color: var(--float-purple);
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
|
-
/* Footer */
|
|
2054
|
-
.footer {
|
|
2055
|
-
position: absolute;
|
|
2056
|
-
bottom: 24px;
|
|
2057
|
-
font-size: 12px;
|
|
2058
|
-
color: rgba(255,255,255,0.3);
|
|
2059
|
-
animation: fadeInUp 0.8s ease-out 0.9s both;
|
|
1711
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><linearGradient id='g' x1='0%25' y1='100%25' x2='100%25' y2='0%25'><stop offset='0%25' stop-color='%233B82F6'/><stop offset='100%25' stop-color='%238B5CF6'/></linearGradient></defs><path d='M50 145C50 136.716 56.7157 130 65 130H105C113.284 130 120 136.716 120 145C120 153.284 113.284 160 105 160H65C56.7157 160 50 153.284 50 145Z' fill='url(%23g)'/><path d='M50 100C50 91.7157 56.7157 85 65 85H135C143.284 85 150 91.7157 150 100C150 108.284 143.284 115 135 115H65C56.7157 115 50 108.284 50 100Z' fill='url(%23g)'/><path d='M50 55C50 46.7157 56.7157 40 65 40H155C163.284 40 170 46.7157 170 55C170 63.2843 163.284 70 155 70H65C56.7157 70 50 63.2843 50 55Z' fill='url(%23g)'/></svg>">
|
|
1712
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
1713
|
+
<script>
|
|
1714
|
+
tailwind.config = {
|
|
1715
|
+
darkMode: 'class',
|
|
1716
|
+
theme: {
|
|
1717
|
+
extend: {
|
|
1718
|
+
fontFamily: { sans: ['Inter', 'system-ui', 'sans-serif'] }
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
2060
1721
|
}
|
|
1722
|
+
</script>
|
|
1723
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
1724
|
+
<style>
|
|
1725
|
+
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
|
|
1726
|
+
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
|
|
1727
|
+
.fade-up { animation: fade-up 0.6s ease-out forwards; }
|
|
1728
|
+
.fade-up-1 { animation: fade-up 0.6s ease-out 0.1s forwards; opacity: 0; }
|
|
1729
|
+
.fade-up-2 { animation: fade-up 0.6s ease-out 0.2s forwards; opacity: 0; }
|
|
1730
|
+
.fade-up-3 { animation: fade-up 0.6s ease-out 0.3s forwards; opacity: 0; }
|
|
1731
|
+
.fade-up-4 { animation: fade-up 0.6s ease-out 0.4s forwards; opacity: 0; }
|
|
1732
|
+
.logo-float { animation: float 4s ease-in-out infinite; }
|
|
1733
|
+
</style>
|
|
1734
|
+
</head>
|
|
1735
|
+
<body class="bg-white dark:bg-zinc-950 text-zinc-900 dark:text-white min-h-screen font-sans transition-colors duration-300">
|
|
1736
|
+
|
|
1737
|
+
<!-- Header -->
|
|
1738
|
+
<header class="fixed top-0 left-0 right-0 z-50 border-b border-zinc-200 dark:border-zinc-800 bg-white/80 dark:bg-zinc-950/80 backdrop-blur-md">
|
|
1739
|
+
<div class="max-w-6xl mx-auto px-6 h-16 flex items-center justify-between">
|
|
1740
|
+
<!-- Logo -->
|
|
1741
|
+
<div class="flex items-center gap-3">
|
|
1742
|
+
<svg class="w-8 h-8" viewBox="0 0 200 200" fill="none">
|
|
1743
|
+
<defs>
|
|
1744
|
+
<linearGradient id="hdr-grad" x1="50" y1="160" x2="170" y2="40" gradientUnits="userSpaceOnUse">
|
|
1745
|
+
<stop stop-color="#3B82F6"/><stop offset="1" stop-color="#8B5CF6"/>
|
|
1746
|
+
</linearGradient>
|
|
1747
|
+
</defs>
|
|
1748
|
+
<path d="M50 145C50 136.716 56.7157 130 65 130H105C113.284 130 120 136.716 120 145C120 153.284 113.284 160 105 160H65C56.7157 160 50 153.284 50 145Z" fill="url(#hdr-grad)"/>
|
|
1749
|
+
<path d="M50 100C50 91.7157 56.7157 85 65 85H135C143.284 85 150 91.7157 150 100C150 108.284 143.284 115 135 115H65C56.7157 115 50 108.284 50 100Z" fill="url(#hdr-grad)"/>
|
|
1750
|
+
<path d="M50 55C50 46.7157 56.7157 40 65 40H155C163.284 40 170 46.7157 170 55C170 63.2843 163.284 70 155 70H65C56.7157 70 50 63.2843 50 55Z" fill="url(#hdr-grad)"/>
|
|
1751
|
+
</svg>
|
|
1752
|
+
<span class="font-semibold text-lg">Float.js</span>
|
|
1753
|
+
<span class="text-xs px-2 py-0.5 rounded-full bg-gradient-to-r from-blue-500 to-violet-500 text-white font-medium">v2.0.6</span>
|
|
1754
|
+
</div>
|
|
1755
|
+
|
|
1756
|
+
<!-- Nav -->
|
|
1757
|
+
<nav class="hidden sm:flex items-center gap-6">
|
|
1758
|
+
<a href="/__docs" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Docs</a>
|
|
1759
|
+
<a href="/__learn" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Learn</a>
|
|
1760
|
+
<a href="/__examples" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Examples</a>
|
|
1761
|
+
<a href="https://github.com/float-js/float-js" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">GitHub</a>
|
|
1762
|
+
</nav>
|
|
1763
|
+
|
|
1764
|
+
<!-- Dark Mode Toggle -->
|
|
1765
|
+
<button id="theme-toggle" class="p-2 rounded-lg hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors" title="Toggle theme">
|
|
1766
|
+
<svg class="w-5 h-5 hidden dark:block" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1767
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"/>
|
|
1768
|
+
</svg>
|
|
1769
|
+
<svg class="w-5 h-5 block dark:hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1770
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"/>
|
|
1771
|
+
</svg>
|
|
1772
|
+
</button>
|
|
1773
|
+
</div>
|
|
1774
|
+
</header>
|
|
1775
|
+
|
|
1776
|
+
<!-- Hero Section -->
|
|
1777
|
+
<main class="pt-32 pb-20 px-6">
|
|
1778
|
+
<div class="max-w-4xl mx-auto text-center">
|
|
1779
|
+
|
|
1780
|
+
<!-- Logo -->
|
|
1781
|
+
<div class="fade-up logo-float mb-8">
|
|
1782
|
+
<svg class="w-24 h-24 mx-auto" viewBox="0 0 200 200" fill="none">
|
|
1783
|
+
<defs>
|
|
1784
|
+
<linearGradient id="hero-grad" x1="50" y1="160" x2="170" y2="40" gradientUnits="userSpaceOnUse">
|
|
1785
|
+
<stop stop-color="#3B82F6"/><stop offset="1" stop-color="#8B5CF6"/>
|
|
1786
|
+
</linearGradient>
|
|
1787
|
+
</defs>
|
|
1788
|
+
<path d="M50 145C50 136.716 56.7157 130 65 130H105C113.284 130 120 136.716 120 145C120 153.284 113.284 160 105 160H65C56.7157 160 50 153.284 50 145Z" fill="url(#hero-grad)"/>
|
|
1789
|
+
<path d="M50 100C50 91.7157 56.7157 85 65 85H135C143.284 85 150 91.7157 150 100C150 108.284 143.284 115 135 115H65C56.7157 115 50 108.284 50 100Z" fill="url(#hero-grad)"/>
|
|
1790
|
+
<path d="M50 55C50 46.7157 56.7157 40 65 40H155C163.284 40 170 46.7157 170 55C170 63.2843 163.284 70 155 70H65C56.7157 70 50 63.2843 50 55Z" fill="url(#hero-grad)"/>
|
|
1791
|
+
</svg>
|
|
1792
|
+
</div>
|
|
1793
|
+
|
|
1794
|
+
<!-- Title -->
|
|
1795
|
+
<h1 class="fade-up-1 text-4xl sm:text-6xl font-bold tracking-tight mb-6">
|
|
1796
|
+
The React Framework<br/>
|
|
1797
|
+
<span class="bg-gradient-to-r from-blue-500 to-violet-500 bg-clip-text text-transparent">for the Modern Web</span>
|
|
1798
|
+
</h1>
|
|
1799
|
+
|
|
1800
|
+
<!-- Subtitle -->
|
|
1801
|
+
<p class="fade-up-2 text-lg sm:text-xl text-zinc-600 dark:text-zinc-400 max-w-2xl mx-auto mb-10">
|
|
1802
|
+
Build full-stack React applications with file-based routing, SSR, API routes,
|
|
1803
|
+
and lightning-fast HMR. Get started by creating your first page.
|
|
1804
|
+
</p>
|
|
1805
|
+
|
|
1806
|
+
<!-- CTA Buttons -->
|
|
1807
|
+
<div class="fade-up-3 flex flex-col sm:flex-row gap-4 justify-center mb-16">
|
|
1808
|
+
<a href="/__learn"
|
|
1809
|
+
class="inline-flex items-center justify-center gap-2 px-8 py-4 bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 font-semibold rounded-xl hover:bg-zinc-800 dark:hover:bg-zinc-100 transition-all shadow-lg hover:shadow-xl">
|
|
1810
|
+
Get Started
|
|
1811
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1812
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/>
|
|
1813
|
+
</svg>
|
|
1814
|
+
</a>
|
|
1815
|
+
<a href="/__docs"
|
|
1816
|
+
class="inline-flex items-center justify-center gap-2 px-8 py-4 bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-white font-semibold rounded-xl hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-all">
|
|
1817
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1818
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
|
|
1819
|
+
</svg>
|
|
1820
|
+
Documentation
|
|
1821
|
+
</a>
|
|
1822
|
+
</div>
|
|
1823
|
+
|
|
1824
|
+
<!-- Code Block -->
|
|
1825
|
+
<div class="fade-up-4 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl p-6 text-left max-w-xl mx-auto shadow-sm">
|
|
1826
|
+
<div class="flex items-center gap-2 mb-4">
|
|
1827
|
+
<div class="w-3 h-3 rounded-full bg-red-400"></div>
|
|
1828
|
+
<div class="w-3 h-3 rounded-full bg-yellow-400"></div>
|
|
1829
|
+
<div class="w-3 h-3 rounded-full bg-green-400"></div>
|
|
1830
|
+
<span class="ml-3 text-xs text-zinc-500 font-mono">app/page.tsx</span>
|
|
1831
|
+
</div>
|
|
1832
|
+
<pre class="text-sm font-mono overflow-x-auto text-zinc-800 dark:text-zinc-200"><code><span class="text-violet-600 dark:text-violet-400">export default</span> <span class="text-blue-600 dark:text-blue-400">function</span> <span class="text-amber-600 dark:text-yellow-300">Page</span>() {
|
|
1833
|
+
<span class="text-violet-600 dark:text-violet-400">return</span> (
|
|
1834
|
+
<span class="text-zinc-500"><</span><span class="text-emerald-600 dark:text-emerald-400">h1</span><span class="text-zinc-500">></span>Hello, Float.js!<span class="text-zinc-500"></</span><span class="text-emerald-600 dark:text-emerald-400">h1</span><span class="text-zinc-500">></span>
|
|
1835
|
+
);
|
|
1836
|
+
}</code></pre>
|
|
1837
|
+
</div>
|
|
1838
|
+
|
|
1839
|
+
</div>
|
|
1840
|
+
</main>
|
|
1841
|
+
|
|
1842
|
+
<!-- Features Section -->
|
|
1843
|
+
<section class="py-20 px-6 bg-zinc-50 dark:bg-zinc-900/50">
|
|
1844
|
+
<div class="max-w-6xl mx-auto">
|
|
1845
|
+
<h2 class="text-2xl sm:text-3xl font-bold text-center mb-4">Built for Performance</h2>
|
|
1846
|
+
<p class="text-zinc-600 dark:text-zinc-400 text-center mb-12 max-w-xl mx-auto">
|
|
1847
|
+
Everything you need to build fast, modern web applications
|
|
1848
|
+
</p>
|
|
1849
|
+
|
|
1850
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
1851
|
+
|
|
1852
|
+
<!-- Feature 1 -->
|
|
1853
|
+
<div class="p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl hover:border-blue-500 dark:hover:border-blue-500 transition-colors">
|
|
1854
|
+
<div class="w-12 h-12 bg-blue-100 dark:bg-blue-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
1855
|
+
<svg class="w-6 h-6 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1856
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
|
|
1857
|
+
</svg>
|
|
1858
|
+
</div>
|
|
1859
|
+
<h3 class="font-semibold text-lg mb-2">Lightning Fast HMR</h3>
|
|
1860
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400">Instant hot module replacement. See your changes in milliseconds without losing state.</p>
|
|
1861
|
+
</div>
|
|
1862
|
+
|
|
1863
|
+
<!-- Feature 2 -->
|
|
1864
|
+
<div class="p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl hover:border-violet-500 dark:hover:border-violet-500 transition-colors">
|
|
1865
|
+
<div class="w-12 h-12 bg-violet-100 dark:bg-violet-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
1866
|
+
<svg class="w-6 h-6 text-violet-600 dark:text-violet-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1867
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
|
|
1868
|
+
</svg>
|
|
1869
|
+
</div>
|
|
1870
|
+
<h3 class="font-semibold text-lg mb-2">File-Based Routing</h3>
|
|
1871
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400">Create routes by adding files to the app directory. Dynamic routes, layouts, and more.</p>
|
|
1872
|
+
</div>
|
|
1873
|
+
|
|
1874
|
+
<!-- Feature 3 -->
|
|
1875
|
+
<div class="p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl hover:border-emerald-500 dark:hover:border-emerald-500 transition-colors">
|
|
1876
|
+
<div class="w-12 h-12 bg-emerald-100 dark:bg-emerald-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
1877
|
+
<svg class="w-6 h-6 text-emerald-600 dark:text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1878
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2"/>
|
|
1879
|
+
</svg>
|
|
1880
|
+
</div>
|
|
1881
|
+
<h3 class="font-semibold text-lg mb-2">Server-Side Rendering</h3>
|
|
1882
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400">Automatic SSR for optimal SEO and performance. Hybrid rendering strategies.</p>
|
|
1883
|
+
</div>
|
|
1884
|
+
|
|
1885
|
+
<!-- Feature 4 -->
|
|
1886
|
+
<div class="p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl hover:border-amber-500 dark:hover:border-amber-500 transition-colors">
|
|
1887
|
+
<div class="w-12 h-12 bg-amber-100 dark:bg-amber-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
1888
|
+
<svg class="w-6 h-6 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1889
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
|
1890
|
+
</svg>
|
|
1891
|
+
</div>
|
|
1892
|
+
<h3 class="font-semibold text-lg mb-2">API Routes</h3>
|
|
1893
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400">Build your backend API with simple route handlers. Full TypeScript support.</p>
|
|
1894
|
+
</div>
|
|
1895
|
+
|
|
1896
|
+
<!-- Feature 5 -->
|
|
1897
|
+
<div class="p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl hover:border-pink-500 dark:hover:border-pink-500 transition-colors">
|
|
1898
|
+
<div class="w-12 h-12 bg-pink-100 dark:bg-pink-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
1899
|
+
<svg class="w-6 h-6 text-pink-600 dark:text-pink-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1900
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
|
|
1901
|
+
</svg>
|
|
1902
|
+
</div>
|
|
1903
|
+
<h3 class="font-semibold text-lg mb-2">Built-in AI Integration</h3>
|
|
1904
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400">First-class support for AI streaming, OpenAI, Anthropic, and more.</p>
|
|
1905
|
+
</div>
|
|
1906
|
+
|
|
1907
|
+
<!-- Feature 6 -->
|
|
1908
|
+
<div class="p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl hover:border-cyan-500 dark:hover:border-cyan-500 transition-colors">
|
|
1909
|
+
<div class="w-12 h-12 bg-cyan-100 dark:bg-cyan-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
1910
|
+
<svg class="w-6 h-6 text-cyan-600 dark:text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1911
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
|
|
1912
|
+
</svg>
|
|
1913
|
+
</div>
|
|
1914
|
+
<h3 class="font-semibold text-lg mb-2">Developer Experience</h3>
|
|
1915
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400">Error overlay, DevTools, and debugging utilities built-in for a smooth workflow.</p>
|
|
1916
|
+
</div>
|
|
1917
|
+
|
|
1918
|
+
</div>
|
|
1919
|
+
</div>
|
|
1920
|
+
</section>
|
|
1921
|
+
|
|
1922
|
+
<!-- Quick Start Section -->
|
|
1923
|
+
<section class="py-20 px-6">
|
|
1924
|
+
<div class="max-w-4xl mx-auto">
|
|
1925
|
+
<h2 class="text-2xl sm:text-3xl font-bold text-center mb-4">Get Started in Seconds</h2>
|
|
1926
|
+
<p class="text-zinc-600 dark:text-zinc-400 text-center mb-12">Create your first page and see it live</p>
|
|
1927
|
+
|
|
1928
|
+
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
1929
|
+
<div class="p-5 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl">
|
|
1930
|
+
<div class="text-xs text-zinc-500 mb-2 uppercase tracking-wider">1. Create page</div>
|
|
1931
|
+
<code class="text-sm font-mono text-zinc-700 dark:text-zinc-300">touch app/page.tsx</code>
|
|
1932
|
+
</div>
|
|
1933
|
+
<div class="p-5 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl">
|
|
1934
|
+
<div class="text-xs text-zinc-500 mb-2 uppercase tracking-wider">2. Add route</div>
|
|
1935
|
+
<code class="text-sm font-mono text-zinc-700 dark:text-zinc-300">mkdir app/about</code>
|
|
1936
|
+
</div>
|
|
1937
|
+
<div class="p-5 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl">
|
|
1938
|
+
<div class="text-xs text-zinc-500 mb-2 uppercase tracking-wider">3. API route</div>
|
|
1939
|
+
<code class="text-sm font-mono text-zinc-700 dark:text-zinc-300">touch app/api/route.ts</code>
|
|
1940
|
+
</div>
|
|
1941
|
+
</div>
|
|
1942
|
+
</div>
|
|
1943
|
+
</section>
|
|
1944
|
+
|
|
1945
|
+
<!-- Footer -->
|
|
1946
|
+
<footer class="border-t border-zinc-200 dark:border-zinc-800 py-12 px-6 bg-zinc-50 dark:bg-zinc-900/50">
|
|
1947
|
+
<div class="max-w-6xl mx-auto">
|
|
1948
|
+
<div class="grid grid-cols-1 sm:grid-cols-4 gap-8 mb-12">
|
|
1949
|
+
|
|
1950
|
+
<!-- Brand -->
|
|
1951
|
+
<div class="sm:col-span-1">
|
|
1952
|
+
<div class="flex items-center gap-2 mb-4">
|
|
1953
|
+
<svg class="w-8 h-8" viewBox="0 0 200 200" fill="none">
|
|
1954
|
+
<defs>
|
|
1955
|
+
<linearGradient id="ftr-grad" x1="50" y1="160" x2="170" y2="40" gradientUnits="userSpaceOnUse">
|
|
1956
|
+
<stop stop-color="#3B82F6"/><stop offset="1" stop-color="#8B5CF6"/>
|
|
1957
|
+
</linearGradient>
|
|
1958
|
+
</defs>
|
|
1959
|
+
<path d="M50 145C50 136.716 56.7157 130 65 130H105C113.284 130 120 136.716 120 145C120 153.284 113.284 160 105 160H65C56.7157 160 50 153.284 50 145Z" fill="url(#ftr-grad)"/>
|
|
1960
|
+
<path d="M50 100C50 91.7157 56.7157 85 65 85H135C143.284 85 150 91.7157 150 100C150 108.284 143.284 115 135 115H65C56.7157 115 50 108.284 50 100Z" fill="url(#ftr-grad)"/>
|
|
1961
|
+
<path d="M50 55C50 46.7157 56.7157 40 65 40H155C163.284 40 170 46.7157 170 55C170 63.2843 163.284 70 155 70H65C56.7157 70 50 63.2843 50 55Z" fill="url(#ftr-grad)"/>
|
|
1962
|
+
</svg>
|
|
1963
|
+
<span class="font-semibold text-lg">Float.js</span>
|
|
1964
|
+
</div>
|
|
1965
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">
|
|
1966
|
+
The React framework for the modern web.
|
|
1967
|
+
</p>
|
|
1968
|
+
</div>
|
|
1969
|
+
|
|
1970
|
+
<!-- Resources -->
|
|
1971
|
+
<div>
|
|
1972
|
+
<h4 class="font-semibold mb-4 text-sm">Resources</h4>
|
|
1973
|
+
<ul class="space-y-2">
|
|
1974
|
+
<li><a href="/__docs" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Documentation</a></li>
|
|
1975
|
+
<li><a href="/__learn" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Learn Float.js</a></li>
|
|
1976
|
+
<li><a href="/__examples" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Examples</a></li>
|
|
1977
|
+
<li><a href="https://github.com/float-js/float-js" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Blog</a></li>
|
|
1978
|
+
</ul>
|
|
1979
|
+
</div>
|
|
1980
|
+
|
|
1981
|
+
<!-- More -->
|
|
1982
|
+
<div>
|
|
1983
|
+
<h4 class="font-semibold mb-4 text-sm">More</h4>
|
|
1984
|
+
<ul class="space-y-2">
|
|
1985
|
+
<li><a href="https://github.com/float-js/float-js" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">GitHub</a></li>
|
|
1986
|
+
<li><a href="https://github.com/float-js/float-js/releases" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Releases</a></li>
|
|
1987
|
+
<li><a href="https://x.com/floatjs" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Twitter</a></li>
|
|
1988
|
+
</ul>
|
|
1989
|
+
</div>
|
|
1990
|
+
|
|
1991
|
+
<!-- Legal -->
|
|
1992
|
+
<div>
|
|
1993
|
+
<h4 class="font-semibold mb-4 text-sm">Legal</h4>
|
|
1994
|
+
<ul class="space-y-2">
|
|
1995
|
+
<li><a href="https://github.com/float-js/float-js/blob/main/LICENSE" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">MIT License</a></li>
|
|
1996
|
+
<li><a href="https://github.com/float-js/float-js" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Contribute</a></li>
|
|
1997
|
+
</ul>
|
|
1998
|
+
</div>
|
|
1999
|
+
|
|
2000
|
+
</div>
|
|
2001
|
+
|
|
2002
|
+
<!-- Bottom -->
|
|
2003
|
+
<div class="pt-8 border-t border-zinc-200 dark:border-zinc-800 flex flex-col sm:flex-row items-center justify-between gap-4">
|
|
2004
|
+
<p class="text-sm text-zinc-500">
|
|
2005
|
+
\xA9 2024-2026 Float.js. Created by <span class="text-zinc-700 dark:text-zinc-300 font-medium">Peter Fulle</span>
|
|
2006
|
+
</p>
|
|
2007
|
+
<div class="flex items-center gap-4">
|
|
2008
|
+
<a href="mailto:prfulle@gmail.com" class="text-sm text-zinc-500 hover:text-zinc-900 dark:hover:text-white transition-colors">prfulle@gmail.com</a>
|
|
2009
|
+
<a href="https://github.com/float-js/float-js" target="_blank" class="text-zinc-500 hover:text-zinc-900 dark:hover:text-white transition-colors">
|
|
2010
|
+
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/></svg>
|
|
2011
|
+
</a>
|
|
2012
|
+
<a href="https://x.com/floatjs" target="_blank" class="text-zinc-500 hover:text-zinc-900 dark:hover:text-white transition-colors">
|
|
2013
|
+
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
|
2014
|
+
</a>
|
|
2015
|
+
</div>
|
|
2016
|
+
</div>
|
|
2017
|
+
</div>
|
|
2018
|
+
</footer>
|
|
2019
|
+
|
|
2020
|
+
<!-- Theme Toggle Script -->
|
|
2021
|
+
<script>
|
|
2022
|
+
const toggle = document.getElementById('theme-toggle');
|
|
2023
|
+
const html = document.documentElement;
|
|
2061
2024
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
}
|
|
2067
|
-
to {
|
|
2068
|
-
opacity: 1;
|
|
2069
|
-
transform: translateY(0);
|
|
2070
|
-
}
|
|
2025
|
+
// Check for saved theme or system preference
|
|
2026
|
+
if (localStorage.theme === 'dark' || (!localStorage.theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
2027
|
+
html.classList.add('dark');
|
|
2028
|
+
html.classList.remove('light');
|
|
2071
2029
|
}
|
|
2072
2030
|
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
.
|
|
2076
|
-
.
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2031
|
+
toggle.addEventListener('click', () => {
|
|
2032
|
+
html.classList.toggle('dark');
|
|
2033
|
+
html.classList.toggle('light');
|
|
2034
|
+
localStorage.theme = html.classList.contains('dark') ? 'dark' : 'light';
|
|
2035
|
+
});
|
|
2036
|
+
</script>
|
|
2037
|
+
|
|
2038
|
+
</body>
|
|
2039
|
+
</html>`;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
// src/client/docs-pages.ts
|
|
2043
|
+
init_esm_shims();
|
|
2044
|
+
var baseStyles = `
|
|
2045
|
+
<!DOCTYPE html>
|
|
2046
|
+
<html lang="en" class="light">
|
|
2047
|
+
<head>
|
|
2048
|
+
<meta charset="UTF-8">
|
|
2049
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
2050
|
+
<title>%TITLE% - Float.js</title>
|
|
2051
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><linearGradient id='g' x1='0%25' y1='100%25' x2='100%25' y2='0%25'><stop offset='0%25' stop-color='%233B82F6'/><stop offset='100%25' stop-color='%238B5CF6'/></linearGradient></defs><path d='M50 145C50 136.716 56.7157 130 65 130H105C113.284 130 120 136.716 120 145C120 153.284 113.284 160 105 160H65C56.7157 160 50 153.284 50 145Z' fill='url(%23g)'/><path d='M50 100C50 91.7157 56.7157 85 65 85H135C143.284 85 150 91.7157 150 100C150 108.284 143.284 115 135 115H65C56.7157 115 50 108.284 50 100Z' fill='url(%23g)'/><path d='M50 55C50 46.7157 56.7157 40 65 40H155C163.284 40 170 46.7157 170 55C170 63.2843 163.284 70 155 70H65C56.7157 70 50 63.2843 50 55Z' fill='url(%23g)'/></svg>">
|
|
2052
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
2053
|
+
<script>
|
|
2054
|
+
tailwind.config = {
|
|
2055
|
+
darkMode: 'class',
|
|
2056
|
+
theme: { extend: { fontFamily: { sans: ['Inter', 'system-ui', 'sans-serif'] } } }
|
|
2080
2057
|
}
|
|
2058
|
+
</script>
|
|
2059
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
2060
|
+
<style>
|
|
2061
|
+
.prose code { background: #f4f4f5; padding: 2px 6px; border-radius: 4px; font-size: 0.875em; }
|
|
2062
|
+
.dark .prose code { background: #27272a; }
|
|
2063
|
+
.prose pre { background: #18181b; padding: 1rem; border-radius: 0.75rem; overflow-x: auto; }
|
|
2064
|
+
.prose pre code { background: transparent; padding: 0; }
|
|
2081
2065
|
</style>
|
|
2082
2066
|
</head>
|
|
2083
|
-
<body>
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
<
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
</
|
|
2100
|
-
<
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
<
|
|
2104
|
-
|
|
2105
|
-
</
|
|
2106
|
-
<
|
|
2107
|
-
|
|
2067
|
+
<body class="bg-white dark:bg-zinc-950 text-zinc-900 dark:text-white min-h-screen font-sans">
|
|
2068
|
+
`;
|
|
2069
|
+
var header = `
|
|
2070
|
+
<!-- Header -->
|
|
2071
|
+
<header class="sticky top-0 z-50 border-b border-zinc-200 dark:border-zinc-800 bg-white/80 dark:bg-zinc-950/80 backdrop-blur-md">
|
|
2072
|
+
<div class="max-w-6xl mx-auto px-6 h-16 flex items-center justify-between">
|
|
2073
|
+
<a href="/" class="flex items-center gap-3">
|
|
2074
|
+
<svg class="w-8 h-8" viewBox="0 0 200 200" fill="none">
|
|
2075
|
+
<defs>
|
|
2076
|
+
<linearGradient id="hdr-grad" x1="50" y1="160" x2="170" y2="40" gradientUnits="userSpaceOnUse">
|
|
2077
|
+
<stop stop-color="#3B82F6"/><stop offset="1" stop-color="#8B5CF6"/>
|
|
2078
|
+
</linearGradient>
|
|
2079
|
+
</defs>
|
|
2080
|
+
<path d="M50 145C50 136.716 56.7157 130 65 130H105C113.284 130 120 136.716 120 145C120 153.284 113.284 160 105 160H65C56.7157 160 50 153.284 50 145Z" fill="url(#hdr-grad)"/>
|
|
2081
|
+
<path d="M50 100C50 91.7157 56.7157 85 65 85H135C143.284 85 150 91.7157 150 100C150 108.284 143.284 115 135 115H65C56.7157 115 50 108.284 50 100Z" fill="url(#hdr-grad)"/>
|
|
2082
|
+
<path d="M50 55C50 46.7157 56.7157 40 65 40H155C163.284 40 170 46.7157 170 55C170 63.2843 163.284 70 155 70H65C56.7157 70 50 63.2843 50 55Z" fill="url(#hdr-grad)"/>
|
|
2083
|
+
</svg>
|
|
2084
|
+
<span class="font-semibold text-lg">Float.js</span>
|
|
2085
|
+
</a>
|
|
2086
|
+
<nav class="flex items-center gap-6">
|
|
2087
|
+
<a href="/__docs" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Docs</a>
|
|
2088
|
+
<a href="/__learn" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Learn</a>
|
|
2089
|
+
<a href="/__examples" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">Examples</a>
|
|
2090
|
+
<a href="https://github.com/float-js/float-js" target="_blank" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white transition-colors">GitHub</a>
|
|
2091
|
+
<button id="theme-toggle" class="p-2 rounded-lg hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors">
|
|
2092
|
+
<svg class="w-5 h-5 hidden dark:block" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"/></svg>
|
|
2093
|
+
<svg class="w-5 h-5 block dark:hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"/></svg>
|
|
2094
|
+
</button>
|
|
2095
|
+
</nav>
|
|
2108
2096
|
</div>
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2097
|
+
</header>
|
|
2098
|
+
`;
|
|
2099
|
+
var footer = `
|
|
2100
|
+
<!-- Footer -->
|
|
2101
|
+
<footer class="border-t border-zinc-200 dark:border-zinc-800 py-8 px-6 bg-zinc-50 dark:bg-zinc-900/50">
|
|
2102
|
+
<div class="max-w-6xl mx-auto flex flex-col sm:flex-row items-center justify-between gap-4">
|
|
2103
|
+
<p class="text-sm text-zinc-500">\xA9 2024-2026 Float.js. Created by Peter Fulle</p>
|
|
2104
|
+
<div class="flex items-center gap-4">
|
|
2105
|
+
<a href="mailto:prfulle@gmail.com" class="text-sm text-zinc-500 hover:text-zinc-900 dark:hover:text-white transition-colors">prfulle@gmail.com</a>
|
|
2106
|
+
<a href="https://github.com/float-js/float-js" target="_blank" class="text-zinc-500 hover:text-zinc-900 dark:hover:text-white transition-colors">
|
|
2107
|
+
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/></svg>
|
|
2108
|
+
</a>
|
|
2109
|
+
</div>
|
|
2113
2110
|
</div>
|
|
2111
|
+
</footer>
|
|
2112
|
+
<script>
|
|
2113
|
+
const toggle = document.getElementById('theme-toggle');
|
|
2114
|
+
const html = document.documentElement;
|
|
2115
|
+
if (localStorage.theme === 'dark' || (!localStorage.theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
2116
|
+
html.classList.add('dark'); html.classList.remove('light');
|
|
2117
|
+
}
|
|
2118
|
+
toggle?.addEventListener('click', () => {
|
|
2119
|
+
html.classList.toggle('dark'); html.classList.toggle('light');
|
|
2120
|
+
localStorage.theme = html.classList.contains('dark') ? 'dark' : 'light';
|
|
2121
|
+
});
|
|
2122
|
+
</script>
|
|
2123
|
+
</body>
|
|
2124
|
+
</html>
|
|
2125
|
+
`;
|
|
2126
|
+
function generateDocsPage() {
|
|
2127
|
+
return baseStyles.replace("%TITLE%", "Documentation") + header + `
|
|
2128
|
+
<div class="flex">
|
|
2129
|
+
<!-- Sidebar -->
|
|
2130
|
+
<aside class="hidden lg:block w-64 border-r border-zinc-200 dark:border-zinc-800 min-h-[calc(100vh-4rem)] p-6">
|
|
2131
|
+
<nav class="space-y-6">
|
|
2132
|
+
<div>
|
|
2133
|
+
<h3 class="font-semibold text-sm mb-3">Getting Started</h3>
|
|
2134
|
+
<ul class="space-y-2">
|
|
2135
|
+
<li><a href="#installation" class="text-sm text-blue-600 dark:text-blue-400 font-medium">Installation</a></li>
|
|
2136
|
+
<li><a href="#project-structure" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">Project Structure</a></li>
|
|
2137
|
+
<li><a href="#routing" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">Routing</a></li>
|
|
2138
|
+
</ul>
|
|
2139
|
+
</div>
|
|
2140
|
+
<div>
|
|
2141
|
+
<h3 class="font-semibold text-sm mb-3">Core Concepts</h3>
|
|
2142
|
+
<ul class="space-y-2">
|
|
2143
|
+
<li><a href="#pages" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">Pages</a></li>
|
|
2144
|
+
<li><a href="#layouts" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">Layouts</a></li>
|
|
2145
|
+
<li><a href="#api-routes" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">API Routes</a></li>
|
|
2146
|
+
</ul>
|
|
2147
|
+
</div>
|
|
2148
|
+
<div>
|
|
2149
|
+
<h3 class="font-semibold text-sm mb-3">Features</h3>
|
|
2150
|
+
<ul class="space-y-2">
|
|
2151
|
+
<li><a href="#ssr" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">Server Rendering</a></li>
|
|
2152
|
+
<li><a href="#hmr" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">Hot Module Replacement</a></li>
|
|
2153
|
+
<li><a href="#ai" class="text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white">AI Integration</a></li>
|
|
2154
|
+
</ul>
|
|
2155
|
+
</div>
|
|
2156
|
+
</nav>
|
|
2157
|
+
</aside>
|
|
2114
2158
|
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
</
|
|
2121
|
-
<
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2159
|
+
<!-- Main Content -->
|
|
2160
|
+
<main class="flex-1 max-w-3xl mx-auto px-6 py-12 prose dark:prose-invert">
|
|
2161
|
+
<h1 id="installation" class="text-4xl font-bold mb-4">Documentation</h1>
|
|
2162
|
+
<p class="text-lg text-zinc-600 dark:text-zinc-400 mb-8">Learn how to build modern web applications with Float.js</p>
|
|
2163
|
+
|
|
2164
|
+
<h2 class="text-2xl font-semibold mt-12 mb-4">Installation</h2>
|
|
2165
|
+
<p class="mb-4">Create a new Float.js project with a single command:</p>
|
|
2166
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl mb-6"><code class="font-mono">npx create-float@latest my-app
|
|
2167
|
+
cd my-app
|
|
2168
|
+
npm run dev</code></pre>
|
|
2169
|
+
|
|
2170
|
+
<h2 id="project-structure" class="text-2xl font-semibold mt-12 mb-4">Project Structure</h2>
|
|
2171
|
+
<p class="mb-4">Float.js uses a file-based routing system. Your project structure looks like this:</p>
|
|
2172
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl mb-6"><code class="font-mono">my-app/
|
|
2173
|
+
\u251C\u2500\u2500 app/
|
|
2174
|
+
\u2502 \u251C\u2500\u2500 page.tsx # Home page (/)
|
|
2175
|
+
\u2502 \u251C\u2500\u2500 layout.tsx # Root layout
|
|
2176
|
+
\u2502 \u251C\u2500\u2500 about/
|
|
2177
|
+
\u2502 \u2502 \u2514\u2500\u2500 page.tsx # About page (/about)
|
|
2178
|
+
\u2502 \u2514\u2500\u2500 api/
|
|
2179
|
+
\u2502 \u2514\u2500\u2500 route.ts # API route (/api)
|
|
2180
|
+
\u251C\u2500\u2500 public/ # Static assets
|
|
2181
|
+
\u2514\u2500\u2500 package.json</code></pre>
|
|
2182
|
+
|
|
2183
|
+
<h2 id="routing" class="text-2xl font-semibold mt-12 mb-4">Routing</h2>
|
|
2184
|
+
<p class="mb-4">Routes are automatically generated based on your file structure:</p>
|
|
2185
|
+
<div class="bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-6 mb-6">
|
|
2186
|
+
<table class="w-full text-sm">
|
|
2187
|
+
<thead>
|
|
2188
|
+
<tr class="text-left border-b border-zinc-200 dark:border-zinc-700">
|
|
2189
|
+
<th class="pb-3 font-semibold">File</th>
|
|
2190
|
+
<th class="pb-3 font-semibold">Route</th>
|
|
2191
|
+
</tr>
|
|
2192
|
+
</thead>
|
|
2193
|
+
<tbody class="font-mono">
|
|
2194
|
+
<tr class="border-b border-zinc-100 dark:border-zinc-800"><td class="py-3">app/page.tsx</td><td class="py-3 text-blue-600 dark:text-blue-400">/</td></tr>
|
|
2195
|
+
<tr class="border-b border-zinc-100 dark:border-zinc-800"><td class="py-3">app/about/page.tsx</td><td class="py-3 text-blue-600 dark:text-blue-400">/about</td></tr>
|
|
2196
|
+
<tr class="border-b border-zinc-100 dark:border-zinc-800"><td class="py-3">app/blog/[slug]/page.tsx</td><td class="py-3 text-blue-600 dark:text-blue-400">/blog/:slug</td></tr>
|
|
2197
|
+
<tr><td class="py-3">app/api/users/route.ts</td><td class="py-3 text-blue-600 dark:text-blue-400">/api/users</td></tr>
|
|
2198
|
+
</tbody>
|
|
2199
|
+
</table>
|
|
2125
2200
|
</div>
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2201
|
+
|
|
2202
|
+
<h2 id="pages" class="text-2xl font-semibold mt-12 mb-4">Creating Pages</h2>
|
|
2203
|
+
<p class="mb-4">Each page exports a default React component:</p>
|
|
2204
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl mb-6"><code class="font-mono"><span class="text-violet-400">export default</span> <span class="text-blue-400">function</span> <span class="text-yellow-300">Page</span>() {
|
|
2205
|
+
<span class="text-violet-400">return</span> (
|
|
2206
|
+
<span class="text-zinc-500"><</span><span class="text-emerald-400">div</span><span class="text-zinc-500">></span>
|
|
2207
|
+
<span class="text-zinc-500"><</span><span class="text-emerald-400">h1</span><span class="text-zinc-500">></span>Welcome to my page<span class="text-zinc-500"></</span><span class="text-emerald-400">h1</span><span class="text-zinc-500">></span>
|
|
2208
|
+
<span class="text-zinc-500"></</span><span class="text-emerald-400">div</span><span class="text-zinc-500">></span>
|
|
2209
|
+
);
|
|
2210
|
+
}</code></pre>
|
|
2211
|
+
|
|
2212
|
+
<h2 id="api-routes" class="text-2xl font-semibold mt-12 mb-4">API Routes</h2>
|
|
2213
|
+
<p class="mb-4">Create API endpoints by exporting HTTP method handlers:</p>
|
|
2214
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl mb-6"><code class="font-mono"><span class="text-violet-400">export async function</span> <span class="text-yellow-300">GET</span>(<span class="text-orange-400">request</span>: Request) {
|
|
2215
|
+
<span class="text-violet-400">return</span> Response.json({ message: <span class="text-emerald-400">'Hello from API!'</span> });
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
<span class="text-violet-400">export async function</span> <span class="text-yellow-300">POST</span>(<span class="text-orange-400">request</span>: Request) {
|
|
2219
|
+
<span class="text-violet-400">const</span> body = <span class="text-violet-400">await</span> request.json();
|
|
2220
|
+
<span class="text-violet-400">return</span> Response.json({ received: body });
|
|
2221
|
+
}</code></pre>
|
|
2222
|
+
|
|
2223
|
+
<div class="mt-12 p-6 bg-gradient-to-r from-blue-50 to-violet-50 dark:from-blue-950/30 dark:to-violet-950/30 border border-blue-200 dark:border-blue-800 rounded-xl">
|
|
2224
|
+
<h3 class="font-semibold text-lg mb-2">\u{1F680} Ready to build?</h3>
|
|
2225
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-4">Start creating your first page by running:</p>
|
|
2226
|
+
<code class="bg-white dark:bg-zinc-900 px-4 py-2 rounded-lg border border-zinc-200 dark:border-zinc-700 font-mono text-sm">touch app/page.tsx</code>
|
|
2130
2227
|
</div>
|
|
2228
|
+
</main>
|
|
2229
|
+
</div>
|
|
2230
|
+
` + footer;
|
|
2231
|
+
}
|
|
2232
|
+
function generateLearnPage() {
|
|
2233
|
+
return baseStyles.replace("%TITLE%", "Learn") + header + `
|
|
2234
|
+
<main class="max-w-4xl mx-auto px-6 py-16">
|
|
2235
|
+
<div class="text-center mb-16">
|
|
2236
|
+
<h1 class="text-4xl sm:text-5xl font-bold mb-4">Learn Float.js</h1>
|
|
2237
|
+
<p class="text-lg text-zinc-600 dark:text-zinc-400 max-w-2xl mx-auto">
|
|
2238
|
+
Follow our step-by-step tutorial to master Float.js and build your first application
|
|
2239
|
+
</p>
|
|
2131
2240
|
</div>
|
|
2132
2241
|
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2242
|
+
<!-- Tutorial Steps -->
|
|
2243
|
+
<div class="space-y-6">
|
|
2244
|
+
|
|
2245
|
+
<!-- Step 1 -->
|
|
2246
|
+
<div class="p-6 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl">
|
|
2247
|
+
<div class="flex items-start gap-4">
|
|
2248
|
+
<div class="w-10 h-10 bg-blue-100 dark:bg-blue-500/20 rounded-xl flex items-center justify-center flex-shrink-0">
|
|
2249
|
+
<span class="font-bold text-blue-600 dark:text-blue-400">1</span>
|
|
2250
|
+
</div>
|
|
2251
|
+
<div class="flex-1">
|
|
2252
|
+
<h3 class="font-semibold text-xl mb-2">Create Your Project</h3>
|
|
2253
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-4">Start by creating a new Float.js project using the CLI</p>
|
|
2254
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl text-sm font-mono overflow-x-auto"><code>npx create-float@latest my-first-app</code></pre>
|
|
2255
|
+
</div>
|
|
2139
2256
|
</div>
|
|
2140
|
-
<span class="code-title">app/page.tsx</span>
|
|
2141
2257
|
</div>
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
<
|
|
2258
|
+
|
|
2259
|
+
<!-- Step 2 -->
|
|
2260
|
+
<div class="p-6 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl">
|
|
2261
|
+
<div class="flex items-start gap-4">
|
|
2262
|
+
<div class="w-10 h-10 bg-violet-100 dark:bg-violet-500/20 rounded-xl flex items-center justify-center flex-shrink-0">
|
|
2263
|
+
<span class="font-bold text-violet-600 dark:text-violet-400">2</span>
|
|
2264
|
+
</div>
|
|
2265
|
+
<div class="flex-1">
|
|
2266
|
+
<h3 class="font-semibold text-xl mb-2">Start the Development Server</h3>
|
|
2267
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-4">Navigate to your project and start the dev server</p>
|
|
2268
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl text-sm font-mono overflow-x-auto"><code>cd my-first-app
|
|
2269
|
+
npm run dev</code></pre>
|
|
2270
|
+
</div>
|
|
2150
2271
|
</div>
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2272
|
+
</div>
|
|
2273
|
+
|
|
2274
|
+
<!-- Step 3 -->
|
|
2275
|
+
<div class="p-6 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl">
|
|
2276
|
+
<div class="flex items-start gap-4">
|
|
2277
|
+
<div class="w-10 h-10 bg-emerald-100 dark:bg-emerald-500/20 rounded-xl flex items-center justify-center flex-shrink-0">
|
|
2278
|
+
<span class="font-bold text-emerald-600 dark:text-emerald-400">3</span>
|
|
2279
|
+
</div>
|
|
2280
|
+
<div class="flex-1">
|
|
2281
|
+
<h3 class="font-semibold text-xl mb-2">Create Your First Page</h3>
|
|
2282
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-4">Create a page component in the app directory</p>
|
|
2283
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl text-sm font-mono overflow-x-auto"><code><span class="text-zinc-500">// app/page.tsx</span>
|
|
2284
|
+
<span class="text-violet-400">export default</span> <span class="text-blue-400">function</span> <span class="text-yellow-300">HomePage</span>() {
|
|
2285
|
+
<span class="text-violet-400">return</span> (
|
|
2286
|
+
<span class="text-zinc-500"><</span><span class="text-emerald-400">main</span><span class="text-zinc-500">></span>
|
|
2287
|
+
<span class="text-zinc-500"><</span><span class="text-emerald-400">h1</span><span class="text-zinc-500">></span>Hello, Float.js!<span class="text-zinc-500"></</span><span class="text-emerald-400">h1</span><span class="text-zinc-500">></span>
|
|
2288
|
+
<span class="text-zinc-500"><</span><span class="text-emerald-400">p</span><span class="text-zinc-500">></span>Welcome to my first app<span class="text-zinc-500"></</span><span class="text-emerald-400">p</span><span class="text-zinc-500">></span>
|
|
2289
|
+
<span class="text-zinc-500"></</span><span class="text-emerald-400">main</span><span class="text-zinc-500">></span>
|
|
2290
|
+
);
|
|
2291
|
+
}</code></pre>
|
|
2292
|
+
</div>
|
|
2154
2293
|
</div>
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2294
|
+
</div>
|
|
2295
|
+
|
|
2296
|
+
<!-- Step 4 -->
|
|
2297
|
+
<div class="p-6 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl">
|
|
2298
|
+
<div class="flex items-start gap-4">
|
|
2299
|
+
<div class="w-10 h-10 bg-amber-100 dark:bg-amber-500/20 rounded-xl flex items-center justify-center flex-shrink-0">
|
|
2300
|
+
<span class="font-bold text-amber-600 dark:text-amber-400">4</span>
|
|
2301
|
+
</div>
|
|
2302
|
+
<div class="flex-1">
|
|
2303
|
+
<h3 class="font-semibold text-xl mb-2">Add an API Route</h3>
|
|
2304
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-4">Create your backend API with simple handlers</p>
|
|
2305
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl text-sm font-mono overflow-x-auto"><code><span class="text-zinc-500">// app/api/hello/route.ts</span>
|
|
2306
|
+
<span class="text-violet-400">export async function</span> <span class="text-yellow-300">GET</span>() {
|
|
2307
|
+
<span class="text-violet-400">return</span> Response.json({
|
|
2308
|
+
message: <span class="text-emerald-400">'Hello from the API!'</span>,
|
|
2309
|
+
timestamp: <span class="text-violet-400">new</span> Date().toISOString()
|
|
2310
|
+
});
|
|
2311
|
+
}</code></pre>
|
|
2312
|
+
</div>
|
|
2158
2313
|
</div>
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2314
|
+
</div>
|
|
2315
|
+
|
|
2316
|
+
<!-- Step 5 -->
|
|
2317
|
+
<div class="p-6 bg-zinc-50 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl">
|
|
2318
|
+
<div class="flex items-start gap-4">
|
|
2319
|
+
<div class="w-10 h-10 bg-pink-100 dark:bg-pink-500/20 rounded-xl flex items-center justify-center flex-shrink-0">
|
|
2320
|
+
<span class="font-bold text-pink-600 dark:text-pink-400">5</span>
|
|
2321
|
+
</div>
|
|
2322
|
+
<div class="flex-1">
|
|
2323
|
+
<h3 class="font-semibold text-xl mb-2">Build for Production</h3>
|
|
2324
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-4">Ready to deploy? Build your application</p>
|
|
2325
|
+
<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-xl text-sm font-mono overflow-x-auto"><code>npm run build
|
|
2326
|
+
npm start</code></pre>
|
|
2327
|
+
</div>
|
|
2162
2328
|
</div>
|
|
2163
2329
|
</div>
|
|
2330
|
+
|
|
2164
2331
|
</div>
|
|
2165
2332
|
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
<
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
<
|
|
2333
|
+
<!-- Next Steps -->
|
|
2334
|
+
<div class="mt-16 text-center">
|
|
2335
|
+
<h2 class="text-2xl font-bold mb-4">What's Next?</h2>
|
|
2336
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-8">Explore more features and capabilities</p>
|
|
2337
|
+
<div class="flex flex-wrap justify-center gap-4">
|
|
2338
|
+
<a href="/__docs" class="px-6 py-3 bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 font-semibold rounded-xl hover:bg-zinc-800 dark:hover:bg-zinc-100 transition-colors">
|
|
2339
|
+
Read the Docs
|
|
2340
|
+
</a>
|
|
2341
|
+
<a href="/__examples" class="px-6 py-3 bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-white font-semibold rounded-xl hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors">
|
|
2342
|
+
View Examples
|
|
2343
|
+
</a>
|
|
2172
2344
|
</div>
|
|
2173
2345
|
</div>
|
|
2346
|
+
</main>
|
|
2347
|
+
` + footer;
|
|
2348
|
+
}
|
|
2349
|
+
function generateExamplesPage() {
|
|
2350
|
+
return baseStyles.replace("%TITLE%", "Examples") + header + `
|
|
2351
|
+
<main class="max-w-6xl mx-auto px-6 py-16">
|
|
2352
|
+
<div class="text-center mb-16">
|
|
2353
|
+
<h1 class="text-4xl sm:text-5xl font-bold mb-4">Examples</h1>
|
|
2354
|
+
<p class="text-lg text-zinc-600 dark:text-zinc-400 max-w-2xl mx-auto">
|
|
2355
|
+
Explore example projects to learn common patterns and best practices
|
|
2356
|
+
</p>
|
|
2357
|
+
</div>
|
|
2174
2358
|
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
<
|
|
2180
|
-
<
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2359
|
+
<!-- Examples Grid -->
|
|
2360
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
2361
|
+
|
|
2362
|
+
<!-- Basic App -->
|
|
2363
|
+
<div class="group p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl hover:border-blue-500 transition-all hover:shadow-lg">
|
|
2364
|
+
<div class="w-12 h-12 bg-blue-100 dark:bg-blue-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
2365
|
+
<svg class="w-6 h-6 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2366
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
|
|
2367
|
+
</svg>
|
|
2368
|
+
</div>
|
|
2369
|
+
<h3 class="font-semibold text-lg mb-2">Basic App</h3>
|
|
2370
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">Simple starter with pages, layouts, and routing</p>
|
|
2371
|
+
<div class="flex flex-wrap gap-2">
|
|
2372
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">React</span>
|
|
2373
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">TypeScript</span>
|
|
2374
|
+
</div>
|
|
2375
|
+
</div>
|
|
2376
|
+
|
|
2377
|
+
<!-- Blog -->
|
|
2378
|
+
<div class="group p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl hover:border-violet-500 transition-all hover:shadow-lg">
|
|
2379
|
+
<div class="w-12 h-12 bg-violet-100 dark:bg-violet-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
2380
|
+
<svg class="w-6 h-6 text-violet-600 dark:text-violet-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2381
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"/>
|
|
2382
|
+
</svg>
|
|
2383
|
+
</div>
|
|
2384
|
+
<h3 class="font-semibold text-lg mb-2">Blog</h3>
|
|
2385
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">Full blog with MDX, dynamic routes, and SSG</p>
|
|
2386
|
+
<div class="flex flex-wrap gap-2">
|
|
2387
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">MDX</span>
|
|
2388
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">SSG</span>
|
|
2389
|
+
</div>
|
|
2390
|
+
</div>
|
|
2391
|
+
|
|
2392
|
+
<!-- API Backend -->
|
|
2393
|
+
<div class="group p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl hover:border-emerald-500 transition-all hover:shadow-lg">
|
|
2394
|
+
<div class="w-12 h-12 bg-emerald-100 dark:bg-emerald-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
2395
|
+
<svg class="w-6 h-6 text-emerald-600 dark:text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2396
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
|
2397
|
+
</svg>
|
|
2398
|
+
</div>
|
|
2399
|
+
<h3 class="font-semibold text-lg mb-2">API Backend</h3>
|
|
2400
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">REST API with authentication and database</p>
|
|
2401
|
+
<div class="flex flex-wrap gap-2">
|
|
2402
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">API</span>
|
|
2403
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">Auth</span>
|
|
2404
|
+
</div>
|
|
2405
|
+
</div>
|
|
2406
|
+
|
|
2407
|
+
<!-- AI Chat -->
|
|
2408
|
+
<div class="group p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl hover:border-pink-500 transition-all hover:shadow-lg">
|
|
2409
|
+
<div class="w-12 h-12 bg-pink-100 dark:bg-pink-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
2410
|
+
<svg class="w-6 h-6 text-pink-600 dark:text-pink-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2411
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
|
|
2412
|
+
</svg>
|
|
2413
|
+
</div>
|
|
2414
|
+
<h3 class="font-semibold text-lg mb-2">AI Chat</h3>
|
|
2415
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">Streaming chat with OpenAI integration</p>
|
|
2416
|
+
<div class="flex flex-wrap gap-2">
|
|
2417
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">AI</span>
|
|
2418
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">Streaming</span>
|
|
2419
|
+
</div>
|
|
2420
|
+
</div>
|
|
2421
|
+
|
|
2422
|
+
<!-- E-commerce -->
|
|
2423
|
+
<div class="group p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl hover:border-amber-500 transition-all hover:shadow-lg">
|
|
2424
|
+
<div class="w-12 h-12 bg-amber-100 dark:bg-amber-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
2425
|
+
<svg class="w-6 h-6 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2426
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"/>
|
|
2427
|
+
</svg>
|
|
2428
|
+
</div>
|
|
2429
|
+
<h3 class="font-semibold text-lg mb-2">E-commerce</h3>
|
|
2430
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">Store with cart, checkout, and payments</p>
|
|
2431
|
+
<div class="flex flex-wrap gap-2">
|
|
2432
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">Stripe</span>
|
|
2433
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">Cart</span>
|
|
2434
|
+
</div>
|
|
2435
|
+
</div>
|
|
2436
|
+
|
|
2437
|
+
<!-- Dashboard -->
|
|
2438
|
+
<div class="group p-6 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl hover:border-cyan-500 transition-all hover:shadow-lg">
|
|
2439
|
+
<div class="w-12 h-12 bg-cyan-100 dark:bg-cyan-500/20 rounded-xl flex items-center justify-center mb-4">
|
|
2440
|
+
<svg class="w-6 h-6 text-cyan-600 dark:text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2441
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
|
|
2442
|
+
</svg>
|
|
2443
|
+
</div>
|
|
2444
|
+
<h3 class="font-semibold text-lg mb-2">Dashboard</h3>
|
|
2445
|
+
<p class="text-sm text-zinc-600 dark:text-zinc-400 mb-4">Admin panel with charts and real-time data</p>
|
|
2446
|
+
<div class="flex flex-wrap gap-2">
|
|
2447
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">Charts</span>
|
|
2448
|
+
<span class="text-xs px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-md">Realtime</span>
|
|
2449
|
+
</div>
|
|
2450
|
+
</div>
|
|
2451
|
+
|
|
2185
2452
|
</div>
|
|
2186
2453
|
|
|
2187
|
-
|
|
2188
|
-
|
|
2454
|
+
<!-- CTA -->
|
|
2455
|
+
<div class="mt-16 text-center p-8 bg-gradient-to-r from-blue-50 to-violet-50 dark:from-blue-950/30 dark:to-violet-950/30 border border-blue-200 dark:border-blue-800 rounded-2xl">
|
|
2456
|
+
<h2 class="text-2xl font-bold mb-4">Want to contribute?</h2>
|
|
2457
|
+
<p class="text-zinc-600 dark:text-zinc-400 mb-6">Share your example with the community</p>
|
|
2458
|
+
<a href="https://github.com/float-js/float-js" target="_blank" class="inline-flex items-center gap-2 px-6 py-3 bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 font-semibold rounded-xl hover:bg-zinc-800 dark:hover:bg-zinc-100 transition-colors">
|
|
2459
|
+
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/></svg>
|
|
2460
|
+
View on GitHub
|
|
2461
|
+
</a>
|
|
2189
2462
|
</div>
|
|
2190
|
-
</
|
|
2191
|
-
|
|
2192
|
-
</html>`;
|
|
2463
|
+
</main>
|
|
2464
|
+
` + footer;
|
|
2193
2465
|
}
|
|
2194
2466
|
|
|
2195
2467
|
// src/server/dev-server.ts
|
|
@@ -2307,6 +2579,21 @@ ${FLOAT_ERROR_OVERLAY}
|
|
|
2307
2579
|
res.end(generateWelcomePage());
|
|
2308
2580
|
return;
|
|
2309
2581
|
}
|
|
2582
|
+
if (pathname === "/__docs") {
|
|
2583
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-cache" });
|
|
2584
|
+
res.end(generateDocsPage());
|
|
2585
|
+
return;
|
|
2586
|
+
}
|
|
2587
|
+
if (pathname === "/__learn") {
|
|
2588
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-cache" });
|
|
2589
|
+
res.end(generateLearnPage());
|
|
2590
|
+
return;
|
|
2591
|
+
}
|
|
2592
|
+
if (pathname === "/__examples") {
|
|
2593
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-cache" });
|
|
2594
|
+
res.end(generateExamplesPage());
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2310
2597
|
if (!route) {
|
|
2311
2598
|
res.writeHead(404, { "Content-Type": "text/html" });
|
|
2312
2599
|
res.end(create404Page(pathname));
|