Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Quantum Quarry Quest</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- background: linear-gradient(135deg, #0a0e27 0%, #1a0b2e 50%, #16213e 100%);
- color: #fff;
- font-family: 'Courier New', monospace;
- overflow: hidden;
- position: relative;
- height: 100vh;
- }
- /* Cosmic radiation background */
- body::before {
- content: '';
- position: fixed;
- top: 0;
- left: 0;
- width: 200%;
- height: 200%;
- background-image:
- radial-gradient(2px 2px at 20% 30%, white, transparent),
- radial-gradient(2px 2px at 60% 70%, white, transparent),
- radial-gradient(1px 1px at 50% 50%, white, transparent);
- background-size: 50vw 50vh;
- animation: cosmicDrift 60s linear infinite;
- opacity: 0.03;
- pointer-events: none;
- }
- @keyframes cosmicDrift {
- 0% { transform: translate(0, 0); }
- 100% { transform: translate(-50%, -50%); }
- }
- .game-container {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 20px;
- max-width: 1200px;
- margin: 0 auto;
- height: 100vh;
- }
- .header {
- text-align: center;
- margin-bottom: 20px;
- z-index: 10;
- }
- h1 {
- font-size: 2.5em;
- background: linear-gradient(45deg, #00ffff, #ff00ff, #00ff00);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- animation: quantumShift 3s ease-in-out infinite;
- margin-bottom: 10px;
- }
- @keyframes quantumShift {
- 0%, 100% { filter: hue-rotate(0deg); }
- 50% { filter: hue-rotate(180deg); }
- }
- .stats {
- display: flex;
- gap: 30px;
- margin-bottom: 20px;
- background: rgba(0, 0, 0, 0.5);
- padding: 15px 30px;
- border-radius: 15px;
- border: 1px solid rgba(0, 255, 255, 0.3);
- }
- .stat {
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .stat-label {
- font-size: 0.9em;
- color: #8af;
- margin-bottom: 5px;
- }
- .stat-value {
- font-size: 1.5em;
- font-weight: bold;
- color: #0ff;
- text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
- }
- .observation-meter {
- width: 300px;
- height: 30px;
- background: linear-gradient(90deg, #001122 0%, #003366 100%);
- border: 2px solid #0ff;
- border-radius: 15px;
- position: relative;
- overflow: hidden;
- margin-bottom: 20px;
- }
- .observation-fill {
- height: 100%;
- background: linear-gradient(90deg, #00ff00 0%, #ffff00 50%, #ff0000 100%);
- width: 0%;
- transition: width 0.3s ease;
- box-shadow: 0 0 20px currentColor;
- }
- .observation-label {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- font-size: 0.9em;
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
- }
- .mine-grid {
- display: grid;
- grid-template-columns: repeat(8, 80px);
- grid-template-rows: repeat(6, 80px);
- gap: 10px;
- background: rgba(0, 0, 0, 0.3);
- padding: 20px;
- border-radius: 20px;
- border: 2px solid rgba(0, 255, 255, 0.2);
- position: relative;
- }
- .ore-cell {
- width: 80px;
- height: 80px;
- border: 2px solid rgba(0, 255, 255, 0.2);
- border-radius: 15px; /* Rounded more for smoother edges */
- cursor: pointer;
- position: relative;
- transition: all 0.3s ease;
- background: radial-gradient(circle at center, rgba(0, 50, 100, 0.5), transparent);
- }
- .ore-cell:hover {
- border-color: rgba(0, 255, 255, 0.5);
- transform: scale(1.05) rotate(2deg); /* Added subtle rotation for fun gamified feel */
- }
- .ore-cell.observed {
- animation: quantumObserve 0.5s ease;
- }
- @keyframes quantumObserve {
- 0% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.8); }
- 100% { box-shadow: 0 0 30px 20px rgba(0, 255, 255, 0); }
- }
- .quantum-ore {
- position: absolute;
- width: 60%;
- height: 60%;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- border-radius: 50%;
- opacity: 0;
- transition: opacity 0.5s ease, transform 0.5s ease; /* Smoother transitions */
- }
- .quantum-ore.active {
- opacity: 1;
- }
- .quantum-ore.common {
- background: radial-gradient(circle, #4a9eff, #2060aa);
- animation: quantumPulse 2s infinite;
- box-shadow: 0 0 20px #4a9eff;
- }
- .quantum-ore.rare {
- background: radial-gradient(circle, #ff4aff, #aa20aa);
- animation: quantumPulse 1.5s infinite;
- box-shadow: 0 0 30px #ff4aff;
- }
- .quantum-ore.legendary {
- background: radial-gradient(circle, #ffd700, #ff8c00);
- animation: quantumPulse 1s infinite, quantumRotate 3s linear infinite;
- box-shadow: 0 0 40px #ffd700;
- }
- .quantum-ore.unstable {
- background: radial-gradient(circle, #ff0000, #ff00ff, #00ffff);
- animation: unstablePulse 0.5s infinite, quantumRotate 1s linear infinite;
- box-shadow: 0 0 50px #ff0000;
- }
- @keyframes quantumPulse {
- 0%, 100% {
- transform: translate(-50%, -50%) scale(1);
- filter: brightness(1);
- }
- 50% {
- transform: translate(-50%, -50%) scale(1.2);
- filter: brightness(1.5);
- }
- }
- @keyframes unstablePulse {
- 0%, 100% {
- transform: translate(-50%, -50%) scale(0.8);
- filter: hue-rotate(0deg) brightness(1);
- }
- 50% {
- transform: translate(-50%, -50%) scale(1.3);
- filter: hue-rotate(180deg) brightness(2);
- }
- }
- @keyframes quantumRotate {
- 0% { filter: hue-rotate(0deg); }
- 100% { filter: hue-rotate(360deg); }
- }
- .probability-indicator {
- position: absolute;
- top: 5px;
- right: 5px;
- font-size: 0.7em;
- color: #0ff;
- opacity: 0;
- transition: opacity 0.3s;
- }
- .ore-cell:hover .probability-indicator {
- opacity: 0.7;
- }
- .controls {
- display: flex;
- gap: 20px;
- margin-top: 20px;
- }
- button {
- padding: 12px 30px;
- background: linear-gradient(135deg, #0066cc, #00ccff);
- border: none;
- border-radius: 30px; /* More rounded for intuitive feel */
- color: white;
- font-size: 1em;
- font-weight: bold;
- cursor: pointer;
- transition: all 0.3s ease;
- text-transform: uppercase;
- letter-spacing: 1px;
- position: relative;
- overflow: hidden;
- }
- button::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- background: rgba(255, 255, 255, 0.3);
- border-radius: 50%;
- transform: translate(-50%, -50%);
- transition: width 0.6s, height 0.6s;
- }
- button:hover::before {
- width: 300px;
- height: 300px;
- }
- button:hover {
- transform: translateY(-2px) scale(1.05); /* Added scale for gamified bounce */
- box-shadow: 0 5px 20px rgba(0, 204, 255, 0.5);
- }
- .message {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 50, 100, 0.9));
- padding: 30px 50px;
- border-radius: 20px;
- border: 3px solid #0ff;
- font-size: 1.5em;
- text-align: center;
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.5s ease, transform 0.5s ease; /* Smoother pop-in */
- z-index: 1000;
- }
- .message.show {
- opacity: 1;
- transform: translate(-50%, -50%) scale(1.05); /* Gentle scale for emphasis */
- }
- .particle {
- position: absolute;
- width: 4px;
- height: 4px;
- background: #0ff;
- border-radius: 50%;
- pointer-events: none;
- animation: particleFloat 2s ease-out forwards;
- }
- @keyframes particleFloat {
- 0% {
- transform: translate(0, 0) scale(1);
- opacity: 1;
- }
- 100% {
- transform: translate(var(--x), var(--y)) scale(0);
- opacity: 0;
- }
- }
- .tooltip {
- position: absolute;
- bottom: -40px;
- left: 50%;
- transform: translateX(-50%);
- background: rgba(0, 0, 0, 0.9);
- padding: 5px 10px;
- border-radius: 5px;
- font-size: 0.8em;
- white-space: nowrap;
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.3s;
- z-index: 100;
- }
- .ore-cell:hover .tooltip {
- opacity: 1;
- }
- .instructions {
- position: absolute;
- top: 20px;
- right: 20px;
- background: rgba(0, 0, 0, 0.7);
- padding: 20px;
- border-radius: 15px;
- border: 1px solid rgba(0, 255, 255, 0.3);
- max-width: 250px;
- font-size: 0.9em;
- line-height: 1.6;
- }
- .instructions h3 {
- color: #0ff;
- margin-bottom: 10px;
- }
- .instructions p {
- margin-bottom: 8px;
- color: #aaf;
- }
- /* New tutorial modal for intuitiveness */
- .modal {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.8);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 2000;
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.5s ease;
- }
- .modal.show {
- opacity: 1;
- pointer-events: auto;
- }
- .modal-content {
- background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 50, 100, 0.9));
- padding: 40px;
- border-radius: 20px;
- border: 3px solid #0ff;
- max-width: 500px;
- text-align: center;
- }
- .modal-content h2 {
- color: #0ff;
- margin-bottom: 20px;
- }
- .modal-content p {
- margin-bottom: 15px;
- color: #aaf;
- }
- .modal-content button {
- margin-top: 20px;
- }
- </style>
- </head>
- <body>
- <div class="game-container">
- <div class="header">
- <h1>⚛️ Quantum Quarry Quest ⚛️</h1>
- <div class="stats">
- <div class="stat">
- <span class="stat-label">Level</span>
- <span class="stat-value" id="level">1</span>
- </div>
- <div class="stat">
- <span class="stat-label">Quantum Crystals</span>
- <span class="stat-value" id="score">0</span>
- </div>
- <div class="stat">
- <span class="stat-label">High Score</span>
- <span class="stat-value" id="high-score">0</span>
- </div>
- <div class="stat">
- <span class="stat-label">Cells Remaining</span>
- <span class="stat-value" id="remaining">48</span>
- </div>
- <div class="stat">
- <span class="stat-label">Success Rate</span>
- <span class="stat-value" id="success-rate">0%</span>
- </div>
- </div>
- <div class="observation-meter">
- <div class="observation-fill" id="observation-fill"></div>
- <span class="observation-label">Observation Intensity: <span id="observation-percent">0%</span></span>
- </div>
- </div>
- <div class="mine-grid" id="mine-grid"></div>
- <div class="controls">
- <button onclick="game.resetObservation()">Reset Observation</button>
- <button onclick="game.newGame()">New Quantum Field</button>
- </div>
- </div>
- <div class="instructions">
- <h3>Quantum Mining Rules</h3>
- <p>🔮 <strong>Observe:</strong> Hover to increase observation and reveal hints</p>
- <p>⚡ <strong>Mine:</strong> Click to extract ore—balance risk!</p>
- <p>⚠️ <strong>Warning:</strong> High observation collapses quantum states!</p>
- <p>💎 <strong>Ores:</strong> Blue (1pt), Purple (5pt), Gold (10pt), Unstable (20pt, but explosion risk!)</p>
- <p>🎯 <strong>Strategy:</strong> Mix observation with bold blind mining for max rewards</p>
- <p>🏆 <strong>Levels:</strong> Clear the grid to level up—harder fields, bigger payoffs!</p>
- </div>
- <div class="message" id="message"></div>
- <!-- Tutorial modal -->
- <div class="modal" id="tutorial">
- <div class="modal-content">
- <h2>Welcome to Quantum Quarry Quest! 🎉</h2>
- <p>Dive into a quantum mining adventure where observation shapes reality!</p>
- <p>Hover cells to observe and peek at potentials, but watch out—too much collapses the state!</p>
- <p>Click to mine, score crystals, and level up by clearing grids. Unstable ores offer big wins but might explode!</p>
- <p>Pro tip: Reset observation to stay stealthy. Chase high scores and innovate your strategy!</p>
- <button onclick="game.closeTutorial()">Start Mining! ⚛️</button>
- </div>
- </div>
- <script>
- class QuantumQuarryGame {
- constructor() {
- this.grid = [];
- this.score = 0;
- this.highScore = localStorage.getItem('qqqHighScore') || 0;
- this.level = 1;
- this.totalMines = 0;
- this.successfulMines = 0;
- this.observationLevel = 0;
- this.observationDecayTimer = null;
- this.initGame();
- this.showTutorial();
- }
- showTutorial() {
- document.getElementById('tutorial').classList.add('show');
- }
- closeTutorial() {
- document.getElementById('tutorial').classList.remove('show');
- }
- initGame() {
- this.createGrid();
- this.startObservationDecay();
- this.updateDisplay();
- }
- createGrid() {
- const grid = document.getElementById('mine-grid');
- grid.innerHTML = '';
- this.grid = [];
- this.totalMines = 0;
- for (let i = 0; i < 48; i++) {
- const cell = document.createElement('div');
- cell.className = 'ore-cell';
- cell.dataset.index = i;
- const ore = document.createElement('div');
- ore.className = 'quantum-ore';
- cell.appendChild(ore);
- const prob = document.createElement('div');
- prob.className = 'probability-indicator';
- cell.appendChild(prob);
- const tooltip = document.createElement('div');
- tooltip.className = 'tooltip';
- cell.appendChild(tooltip);
- const quantumState = this.generateQuantumState();
- this.grid.push(quantumState);
- cell.addEventListener('mouseenter', (e) => this.observe(e, i));
- cell.addEventListener('mouseleave', (e) => this.stopObserve(e, i));
- cell.addEventListener('click', (e) => this.mine(e, i));
- grid.appendChild(cell);
- }
- }
- generateQuantumState() {
- const rand = Math.random();
- const levelModifier = 0.01 * (this.level - 1); // Innovation: Levels increase rarity and risk
- let state = {
- collapsed: false,
- mined: false,
- observationTime: 0,
- baseProbability: Math.random(),
- type: null,
- value: 0
- };
- if (rand < (0.02 + levelModifier)) {
- state.type = 'unstable';
- state.value = 20 + this.level * 2; // Higher rewards per level
- } else if (rand < (0.1 + levelModifier)) {
- state.type = 'legendary';
- state.value = 10 + this.level;
- } else if (rand < (0.3 + levelModifier)) {
- state.type = 'rare';
- state.value = 5 + Math.floor(this.level / 2);
- } else if (rand < (0.6 - levelModifier)) { // Slightly more empties for difficulty
- state.type = 'common';
- state.value = 1;
- } else {
- state.type = 'empty';
- state.value = 0;
- }
- return state;
- }
- observe(event, index) {
- const cell = event.currentTarget;
- const state = this.grid[index];
- if (state.mined) return;
- this.observationLevel = Math.min(100, this.observationLevel + 2 * (1 + (this.level - 1) * 0.1)); // Faster observation build-up per level
- state.observationTime += 1;
- const prob = cell.querySelector('.probability-indicator');
- const probability = this.calculateCollapseProbability(state);
- prob.textContent = `${Math.round(probability * 100)}%`;
- const tooltip = cell.querySelector('.tooltip');
- tooltip.textContent = `Quantum Stability: ${Math.round(100 - probability * 100)}% | Potential: ${state.type ? state.type.charAt(0).toUpperCase() + state.type.slice(1) : 'Unknown'}`;
- const ore = cell.querySelector('.quantum-ore');
- if (state.observationTime > 5 && !state.collapsed) {
- ore.classList.add('active', state.type);
- }
- if (probability > 0.8 && !state.collapsed) {
- this.collapseQuantumState(index);
- }
- this.updateObservationMeter();
- }
- stopObserve(event, index) {
- clearTimeout(this.observationDecayTimer);
- this.startObservationDecay();
- }
- startObservationDecay() {
- this.observationDecayTimer = setInterval(() => {
- this.observationLevel = Math.max(0, this.observationLevel - 1);
- this.updateObservationMeter();
- }, 100);
- }
- calculateCollapseProbability(state) {
- const observationFactor = this.observationLevel / 100;
- const timeFactor = Math.min(state.observationTime / 20, 1);
- const instabilityFactor = state.type === 'unstable' ? 1.5 + (this.level * 0.1) : 1; // Higher risk per level
- const levelFactor = 1 + (this.level - 1) * 0.05; // Overall harder collapses
- return Math.min(1, (observationFactor * 0.5 + timeFactor * 0.5) * instabilityFactor * levelFactor);
- }
- collapseQuantumState(index) {
- const cell = document.querySelectorAll('.ore-cell')[index];
- const state = this.grid[index];
- const ore = cell.querySelector('.quantum-ore');
- state.collapsed = true;
- if (Math.random() < 0.7 + (this.level * 0.02)) { // Higher disappear chance per level
- state.type = 'empty';
- state.value = 0;
- ore.classList.remove('active');
- this.showMessage('Quantum state collapsed! Ore lost...', 'error');
- this.createParticles(cell, '#ff0000');
- }
- cell.classList.add('observed');
- }
- mine(event, index) {
- const cell = event.currentTarget;
- const state = this.grid[index];
- if (state.mined) return;
- state.mined = true;
- this.totalMines++;
- cell.style.pointerEvents = 'none';
- cell.style.opacity = '0.3';
- const successChance = state.collapsed ? 0.3 : (state.observationTime > 0 ? 0.8 : 0.5);
- if (Math.random() < successChance && state.value > 0) {
- this.successfulMines++;
- const ore = cell.querySelector('.quantum-ore');
- ore.classList.add('active', state.type);
- if (state.type === 'unstable' && Math.random() < 0.3 + (this.level * 0.05)) { // Innovation: Explosion risk increases with level
- this.score = Math.max(0, this.score - 10);
- this.showMessage('Unstable ore exploded! -10 crystals', 'error');
- this.createParticles(cell, '#ff0000');
- } else {
- this.score += state.value;
- this.showMessage(this.getSuccessMessage(state.type), 'success');
- this.createParticles(cell, this.getOreColor(state.type));
- }
- } else {
- this.createParticles(cell, '#555');
- if (state.value === 0) {
- this.showMessage('Empty cavity...', 'info');
- } else {
- this.showMessage('Mining failed! Ore shattered...', 'error');
- }
- }
- this.updateDisplay();
- if (48 - this.totalMines === 0) {
- this.gameOver();
- }
- }
- getSuccessMessage(type) {
- const messages = {
- 'common': 'Common ore extracted! +1',
- 'rare': 'Rare quantum crystal! +5',
- 'legendary': 'Legendary ore discovered! +10',
- 'unstable': 'Unstable matter harvested! +20'
- };
- return messages[type] || 'Ore extracted!';
- }
- getOreColor(type) {
- const colors = {
- 'common': '#4a9eff',
- 'rare': '#ff4aff',
- 'legendary': '#ffd700',
- 'unstable': '#ff00ff'
- };
- return colors[type] || '#555';
- }
- createParticles(element, color) {
- const rect = element.getBoundingClientRect();
- for (let i = 0; i < 15; i++) { // More particles for gamified flair
- const particle = document.createElement('div');
- particle.className = 'particle';
- particle.style.left = rect.left + rect.width / 2 + 'px';
- particle.style.top = rect.top + rect.height / 2 + 'px';
- particle.style.background = color;
- particle.style.setProperty('--x', `${(Math.random() - 0.5) * 150}px`); // Wider spread
- particle.style.setProperty('--y', `${(Math.random() - 0.5) * 150}px`);
- document.body.appendChild(particle);
- setTimeout(() => particle.remove(), 2000);
- }
- }
- showMessage(text, type) {
- const message = document.getElementById('message');
- message.textContent = text;
- message.className = 'message show';
- if (type === 'success') {
- message.style.borderColor = '#0f0';
- message.style.background = 'linear-gradient(135deg, rgba(0, 50, 0, 0.9), rgba(0, 100, 50, 0.9))';
- } else if (type === 'error') {
- message.style.borderColor = '#f00';
- message.style.background = 'linear-gradient(135deg, rgba(50, 0, 0, 0.9), rgba(100, 0, 50, 0.9))';
- } else {
- message.style.borderColor = '#0ff';
- message.style.background = 'linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 50, 100, 0.9))';
- }
- setTimeout(() => {
- message.classList.remove('show');
- }, 2500); // Longer display for better feedback
- }
- resetObservation() {
- this.observationLevel = 0;
- this.grid.forEach((state, index) => {
- if (!state.mined) {
- state.observationTime = 0;
- state.collapsed = false;
- const cell = document.querySelectorAll('.ore-cell')[index];
- const ore = cell.querySelector('.quantum-ore');
- ore.classList.remove('active', 'common', 'rare', 'legendary', 'unstable');
- cell.classList.remove('observed');
- }
- });
- this.updateObservationMeter();
- this.showMessage('Observation field reset!', 'info');
- }
- updateObservationMeter() {
- const fill = document.getElementById('observation-fill');
- const percent = document.getElementById('observation-percent');
- fill.style.width = this.observationLevel + '%';
- percent.textContent = this.observationLevel + '%';
- }
- updateDisplay() {
- document.getElementById('level').textContent = this.level;
- document.getElementById('score').textContent = this.score;
- document.getElementById('remaining').textContent = 48 - this.totalMines;
- const successRate = this.totalMines > 0 ? Math.round((this.successfulMines / this.totalMines) * 100) : 0;
- document.getElementById('success-rate').textContent = successRate + '%';
- if (this.score > this.highScore) {
- this.highScore = this.score;
- localStorage.setItem('qqqHighScore', this.highScore);
- }
- document.getElementById('high-score').textContent = this.highScore;
- }
- gameOver() {
- let msg = `Level ${this.level} Complete! Field exhausted. Score: ${this.score}`;
- if (this.score > this.highScore) {
- msg += ' - New High Score! 🏆';
- }
- this.showMessage(msg, 'success');
- setTimeout(() => {
- this.level++;
- this.newGame();
- }, 3000);
- }
- newGame() {
- clearInterval(this.observationDecayTimer);
- this.totalMines = 0;
- this.successfulMines = 0;
- this.observationLevel = 0;
- this.initGame();
- this.showMessage(`Level ${this.level} - New quantum field generated! Higher stakes await!`, 'success');
- }
- }
- // Initialize game
- const game = new QuantumQuarryGame();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment