Skip to content

Commit 5a0aba4

Browse files
committed
Update linux section UI
1 parent 5b06222 commit 5a0aba4

4 files changed

Lines changed: 245 additions & 47 deletions

File tree

bin/data.js

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,35 +114,71 @@ function createReleaseData () {
114114
prev.mac.releaseDate = dt
115115
prev.mac.items.push(nr)
116116
} else if (cname.includes('linux')) {
117+
const isLegacy = cname.includes('-legacy')
118+
117119
if (cname.endsWith('.rpm')) {
118-
nr.desc = 'for Red Hat, Fedora...'
120+
nr.desc = isLegacy ? 'for Red Hat, Fedora... (glibc < 2.34)' : 'for Red Hat, Fedora...'
119121
} else if (cname.endsWith('.deb')) {
120-
nr.desc = 'for Debian, Ubuntu...'
122+
nr.desc = isLegacy ? 'for Debian, Ubuntu... (glibc < 2.34, like UOS/Ubuntu 18)' : 'for Debian, Ubuntu...'
121123
} else if (cname.endsWith('.snap')) {
122124
nr.desc = 'for all linux that support snap'
123125
} else if (cname.endsWith('.gz')) {
124-
nr.desc = 'for all linux, just extract'
126+
nr.desc = isLegacy ? 'for all linux, just extract (glibc < 2.34)' : 'for all linux, just extract'
125127
} else if (cname.endsWith('.AppImage')) {
126-
nr.desc = 'for all linux, just run it'
128+
nr.desc = isLegacy ? 'for all linux, just run it (glibc < 2.34)' : 'for all linux, just run it'
127129
}
128-
nr.tag = 'ARM64 Beta'
129-
nr.index = 2
130+
131+
// Determine architecture and legacy status
132+
let archType = ''
133+
130134
if (cname.includes('x64') || cname.includes('x86') || cname.includes('amd64')) {
131-
nr.index = 1
132-
nr.tag = 'x86/64'
135+
archType = 'x86_64'
136+
} else if (cname.includes('arm64') || cname.includes('aarch64')) {
137+
archType = 'arm64'
133138
} else if (cname.includes('armv7l')) {
134-
nr.tag = 'ARM Beta'
135-
nr.index = 3
139+
archType = 'armv7'
136140
}
137-
prev.linux.releaseDate = dt
138-
prev.linux.releaseNote = releaseNote
139-
prev.linux.items.push(nr)
141+
142+
// Add to appropriate architecture group
143+
const category = isLegacy ? `${archType}_legacy` : archType
144+
if (!prev.linux[category]) {
145+
prev.linux[category] = {
146+
name: '',
147+
items: []
148+
}
149+
}
150+
151+
prev.linux[category].releaseDate = dt
152+
prev.linux[category].releaseNote = releaseNote
153+
prev.linux[category].items.push(nr)
140154
}
141155
return prev
142156
}, {
143157
linux: {
144-
name: 'Linux x86/x64/arm/arm64',
145-
items: []
158+
x86_64: {
159+
name: 'Linux x86_64',
160+
items: []
161+
},
162+
x86_64_legacy: {
163+
name: 'Linux x86_64 Legacy',
164+
items: []
165+
},
166+
arm64: {
167+
name: 'Linux ARM64',
168+
items: []
169+
},
170+
arm64_legacy: {
171+
name: 'Linux ARM64 Legacy',
172+
items: []
173+
},
174+
armv7: {
175+
name: 'Linux ARMv7',
176+
items: []
177+
},
178+
armv7_legacy: {
179+
name: 'Linux ARMv7 Legacy',
180+
items: []
181+
}
146182
},
147183
mac: {
148184
name: 'Mac OS x64',
@@ -153,7 +189,6 @@ function createReleaseData () {
153189
items: []
154190
}
155191
})
156-
arr.linux.items.sort((a, b) => a.index - b.index)
157192
return {
158193
assets: arr,
159194
version

bin/qr-code.cut.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function cropImage () {
5858
// Paper stack settings
5959
const paperPadding = 60 // Extra space for rotated papers
6060
const rotationAngle = 5 * Math.PI / 180 // 5 degrees in radians
61-
61+
6262
// Create canvas with extra space for rotated papers
6363
const canvasWidth = newWidth + paperPadding * 2
6464
const canvasHeight = newHeight + paperPadding * 2
@@ -72,51 +72,51 @@ async function cropImage () {
7272
// Helper function to draw a paper with shadow
7373
function drawPaper (x, y, width, height, rotation, shadowIntensity) {
7474
ctx.save()
75-
75+
7676
// Move to center of where paper should be
7777
ctx.translate(x + width / 2, y + height / 2)
7878
ctx.rotate(rotation)
79-
79+
8080
// Draw shadow
8181
ctx.shadowColor = `rgba(0, 0, 0, ${shadowIntensity})`
8282
ctx.shadowBlur = 8
8383
ctx.shadowOffsetX = 4
8484
ctx.shadowOffsetY = 4
85-
85+
8686
// Draw paper
8787
ctx.fillStyle = '#ffffff'
8888
ctx.fillRect(-width / 2, -height / 2, width, height)
89-
89+
9090
// Add subtle border
9191
ctx.shadowColor = 'transparent'
9292
ctx.strokeStyle = 'rgba(0, 0, 0, 0.1)'
9393
ctx.lineWidth = 1
9494
ctx.strokeRect(-width / 2, -height / 2, width, height)
95-
95+
9696
ctx.restore()
9797
}
9898

9999
// Draw background papers (rotated)
100100
const centerX = canvasWidth / 2 - newWidth / 2
101101
const centerY = canvasHeight / 2 - newHeight / 2
102-
102+
103103
// Bottom paper (rotated left)
104104
drawPaper(centerX - 3, centerY + 6, newWidth, newHeight, -rotationAngle, 0.15)
105-
105+
106106
// Middle paper (rotated right)
107107
drawPaper(centerX + 3, centerY + 3, newWidth, newHeight, rotationAngle, 0.2)
108-
108+
109109
// Top paper (no rotation) - we'll draw the actual image on this one
110110
ctx.save()
111111
ctx.shadowColor = 'rgba(0, 0, 0, 0.25)'
112112
ctx.shadowBlur = 10
113113
ctx.shadowOffsetX = 2
114114
ctx.shadowOffsetY = 2
115-
115+
116116
// Draw white background for top paper
117117
ctx.fillStyle = '#ffffff'
118118
ctx.fillRect(centerX, centerY, newWidth, newHeight)
119-
119+
120120
// Reset shadow for the actual image
121121
ctx.shadowColor = 'transparent'
122122
ctx.shadowBlur = 0
@@ -131,12 +131,12 @@ async function cropImage () {
131131
centerX, centerY, // Destination x, y (centered on top paper)
132132
newWidth, newHeight // Destination width, height
133133
)
134-
134+
135135
// Add subtle border to top paper
136136
ctx.strokeStyle = 'rgba(0, 0, 0, 0.1)'
137137
ctx.lineWidth = 1
138138
ctx.strokeRect(centerX, centerY, newWidth, newHeight)
139-
139+
140140
ctx.restore()
141141

142142
// Save the cropped image

src/css/home.styl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,46 @@ ul
164164
&.active
165165
display block
166166

167+
// Linux architecture sub-tabs styles
168+
.linux-arch-tabs
169+
.arch-tab-buttons
170+
display flex
171+
justify-content center
172+
margin-bottom 20px
173+
padding 10px 0
174+
border-bottom 1px solid #e9ecef
175+
flex-wrap wrap
176+
gap 5px
177+
178+
.arch-tab-btn
179+
background none
180+
border 1px solid #dee2e6
181+
padding 8px 16px
182+
font-size 0.9em
183+
cursor pointer
184+
border-radius 4px
185+
transition all 0.2s ease
186+
color #666
187+
margin 2px
188+
189+
&:hover
190+
background #f8f9fa
191+
border-color #adb5bd
192+
color #333
193+
194+
&.active
195+
background #333
196+
border-color #333
197+
color white
198+
font-weight bold
199+
200+
.arch-tab-content
201+
.arch-tab-panel
202+
display none
203+
204+
&.active
205+
display block
206+
167207
.os-downloads
168208
h3
169209
margin-bottom 20px

0 commit comments

Comments
 (0)