← back to Model Arena
data/artifacts/104018fe5adc/hf-qwen-coder-32b.html
175 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>This or That Poll</title>
<style>
:root {
--bg: #faf8f4;
--surface: #ffffff;
--text: #1c1a17;
--muted: #9b948a;
--accent: #b0472e;
--line: #dcdcdc;
--shadow: 0 8px 24px rgba(0, 0, 0, .12);
--ease: cubic-bezier(.22, 1, .36, 1);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg);
color: var(--text);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.phone-frame {
width: 400px;
height: 712px;
background-color: var(--surface);
border-radius: 36px;
box-shadow: 0 15px 30px rgba(0, 0, 0, .1), 0 10px 10px rgba(0, 0, 0, .08);
position: relative;
}
header {
width: 100%;
padding: 24px;
background-color: var(--bg);
border-bottom: 1px solid var(--line);
display: flex;
align-items: center;
font-family: 'Playfair Display', Georgia, serif;
letter-spacing: .18em;
}
header h1 {
margin: 0;
font-size: 40px;
color: var(--text);
}
.content {
height: calc(100% - 96px);
display: flex;
justify-content: space-between;
align-items: center;
padding: 32px;
}
.swatch {
width: 150px;
height: 150px;
border-radius: 8px;
position: relative;
cursor: pointer;
transition: transform .15s var(--ease);
}
.swatch:hover {
transform: scale(1.05);
}
.damask {
background-image: repeating-linear-gradient(
45deg,
#e6ddc7, #e6ddc7 2px,
transparent 2px, transparent 4px
);
}
.geometric {
background-color: #f0f8ff;
background-image:
radial-gradient(circle at 30% 30%, #c9a961, transparent),
radial-gradient(circle at 70% 70%, #b0472e, transparent);
}
.vote-bar {
position: absolute;
bottom: -8px;
left: 50%;
transform: translateX(-50%);
width: calc(100% + 16px);
height: 8px;
background-color: var(--line);
border-radius: 4px;
overflow: hidden;
}
.vote-bar-fill {
width: 0%;
height: 100%;
background-color: var(--accent);
transition: width .3s var(--ease);
}
.winner-stamp {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
font-size: 24px;
color: var(--accent);
transition: opacity .3s var(--ease);
}
.winner-stamp.show {
opacity: 1;
}
</style>
</head>
<body>
<div class="phone-frame">
<header>
<h1>DESIGNER WALLCOVERINGS</h1>
</header>
<div class="content">
<div class="swatch damask" onclick="vote('damask')">
<div class="vote-bar"><div class="vote-bar-fill" id="damask-fill"></div></div>
<div class="winner-stamp" id="damask-stamp">WINNER</div>
</div>
<div class="swatch geometric" onclick="vote('geometric')">
<div class="vote-bar"><div class="vote-bar-fill" id="geometric-fill"></div></div>
<div class="winner-stamp" id="geometric-stamp">WINNER</div>
</div>
</div>
</div>
<script>
let damaskVotes = 0;
let geometricVotes = 0;
function vote(style) {
if (style === 'damask') {
damaskVotes++;
updateFill('damask-fill', damaskVotes);
} else {
geometricVotes++;
updateFill('geometric-fill', geometricVotes);
}
checkWinner();
}
function updateFill(id, votes) {
const totalVotes = damaskVotes + geometricVotes;
const percentage = (votes / totalVotes) * 100;
document.getElementById(id).style.width = `${percentage}%`;
}
function checkWinner() {
if (damaskVotes > geometricVotes && damaskVotes + geometricVotes > 0) {
showStamp('damask-stamp');
hideStamp('geometric-stamp');
} else if (geometricVotes > damaskVotes && damaskVotes + geometricVotes > 0) {
showStamp('geometric-stamp');
hideStamp('damask-stamp');
}
}
function showStamp(id) {
document.getElementById(id).classList.add('show');
}
function hideStamp(id) {
document.getElementById(id).classList.remove('show');
}
</script>
</body>
</html>