Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions src/components/MCBench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ import Background from './background'
import ScreenshotShare from './ui/ScreenshotShare'
import ShareComparisonModal from './ui/ShareComparisonModal'

// Simple VoteButton component for consistent styling
const VoteButton: React.FC<{
onClick: () => void
disabled: boolean
className: string
children: React.ReactNode
}> = ({ onClick, disabled, className, children }) => (
<button onClick={onClick} disabled={disabled} className={className}>
{children}
</button>
)

// Loading message component with rotating messages
const RotatingLoadingMessage: React.FC = () => {
const messages = [
Expand Down Expand Up @@ -622,28 +610,35 @@ const MCBench = () => {

<div className="space-y-4">
{/* Disabled buttons */}
<div className="grid grid-cols-3 gap-4">
<VoteButton
<div className="grid grid-cols-4 gap-4">
<button
onClick={() => {}}
disabled={true}
className="w-full py-3 font-mono uppercase tracking-wider border bg-gray-400 dark:bg-gray-600 text-gray-200 dark:text-gray-400 border-gray-400 dark:border-gray-500 cursor-not-allowed"
>
Vote A
</VoteButton>
<VoteButton
</button>
<button
onClick={() => {}}
disabled={true}
className="w-full py-3 font-mono uppercase tracking-wider border bg-gray-400 dark:bg-gray-600 text-gray-200 dark:text-gray-400 border-gray-400 dark:border-gray-500 cursor-not-allowed"
>
Tie
</VoteButton>
<VoteButton
</button>
<button
onClick={() => {}}
disabled={true}
className="w-full py-3 font-mono uppercase tracking-wider border bg-gray-400 dark:bg-gray-600 text-gray-200 dark:text-gray-400 border-gray-400 dark:border-gray-500 cursor-not-allowed"
>
Both Bad
</button>
<button
onClick={() => {}}
disabled={true}
className="w-full py-3 font-mono uppercase tracking-wider border bg-gray-400 dark:bg-gray-600 text-gray-200 dark:text-gray-400 border-gray-400 dark:border-gray-500 cursor-not-allowed"
>
Vote B
</VoteButton>
</button>
</div>
<div className="h-2"></div>
</div>
Expand Down Expand Up @@ -907,7 +902,7 @@ const MCBench = () => {

<div className="space-y-4">
{!voted ? (
<div className="grid grid-cols-3 gap-4">
<div className="grid grid-cols-4 gap-4">
<button
onClick={() => handleVote('A')}
disabled={!buttonsEnabled}
Expand All @@ -919,6 +914,17 @@ const MCBench = () => {
>
Vote A
</button>
<button
onClick={() => handleVote('tie')}
disabled={!buttonsEnabled}
className={`w-full py-3 font-mono uppercase tracking-wider border transition-transform ${
buttonsEnabled
? 'bg-gray-900 dark:bg-gray-700 hover:bg-gray-800 dark:hover:bg-gray-600 text-white border-gray-900 dark:border-gray-600 hover:translate-y-[-2px]'
: 'bg-gray-400 dark:bg-gray-600 text-gray-200 dark:text-gray-400 border-gray-400 dark:border-gray-500 cursor-not-allowed'
}`}
>
Both Bad
</button>
<button
onClick={() => handleVote('tie')}
disabled={!buttonsEnabled}
Expand Down
12 changes: 7 additions & 5 deletions src/components/ui/ScreenshotShare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ const ScreenshotShare = ({

// Apply proper font scaling based on canvas dimensions
const fontSize = {
prompt: Math.round(10 * autoScale),
model: Math.round(11 * autoScale),
website: Math.round(12 * autoScale),
prompt: Math.round(7.5 * autoScale),
model: Math.round(8.25 * autoScale),
website: Math.round(9 * autoScale),
}

// Calculate width scaling for prompt text
Expand Down Expand Up @@ -159,7 +159,7 @@ const ScreenshotShare = ({

// Right watermark (website)
const websiteText = new Konva.Text({
x: targetElement.offsetWidth - 70 * autoScale,
x: 0, // temporary, will set below
y: targetElement.offsetHeight - 20 * autoScale,
text: 'mcbench.ai',
fontSize: fontSize.website,
Expand All @@ -170,6 +170,8 @@ const ScreenshotShare = ({
shadowOffset: { x: 1, y: 1 },
shadowOpacity: 0.5,
})
// Set symmetrical right margin
websiteText.x(targetElement.offsetWidth - websiteText.width() - 8)

// Add alert message if provided (e.g. for EXPERIMENTAL samples)
if (alertMessage) {
Expand All @@ -192,7 +194,7 @@ const ScreenshotShare = ({
})

// Calculate alert font size based on scaling
const alertFontSize = Math.round(16 * autoScale)
const alertFontSize = Math.round(12 * autoScale)

// Create text
const alertText = new Konva.Text({
Expand Down