Add Statistics Panel feature
- Recreated full game foundation from previous session
- Added Statistics tab with detailed game metrics:
* Total Stardust Earned
* Current Production Rate (✨/sec)
* Total Clicks
* Click Power
* Time Played (auto-formatted)
* Buildings Owned
* Upgrades Purchased
* Achievements Unlocked
* Game Progress bar
- Fixed global production bonus calculation in game.js
- Added responsive CSS for stats panel
Files added: js/stats.js, dev-journal.md, README.md, JOURNAL.md
This commit is contained in:
+602
@@ -0,0 +1,602 @@
|
||||
/* ============================================
|
||||
COSMIC GARDEN - Main Stylesheet
|
||||
============================================ */
|
||||
|
||||
:root {
|
||||
--bg-dark: #0a0a1a;
|
||||
--bg-panel: #12122a;
|
||||
--bg-card: #1a1a3e;
|
||||
--bg-hover: #252550;
|
||||
--accent-gold: #ffd700;
|
||||
--accent-purple: #9b59b6;
|
||||
--accent-blue: #3498db;
|
||||
--accent-green: #2ecc71;
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: #a0a0c0;
|
||||
--text-muted: #606080;
|
||||
--border-color: #2a2a5a;
|
||||
--success: #2ecc71;
|
||||
--danger: #e74c3c;
|
||||
--warning: #f39c12;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background: var(--bg-dark);
|
||||
color: var(--text-primary);
|
||||
min-height: 100vh;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
#game-header {
|
||||
background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-card) 100%);
|
||||
padding: 20px 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 2px solid var(--border-color);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#game-header h1 {
|
||||
font-size: 1.8rem;
|
||||
background: linear-gradient(90deg, var(--accent-gold), var(--accent-purple));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
#currency-display {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
color: var(--accent-gold);
|
||||
}
|
||||
|
||||
#per-second {
|
||||
font-size: 1rem;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Main Layout */
|
||||
#main-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 280px 1fr 300px;
|
||||
gap: 20px;
|
||||
padding: 20px;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* Panels */
|
||||
section, aside {
|
||||
background: var(--bg-panel);
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
h2, h3 {
|
||||
margin-bottom: 15px;
|
||||
color: var(--accent-gold);
|
||||
}
|
||||
|
||||
/* Click Panel */
|
||||
#click-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
#harvest-btn {
|
||||
background: linear-gradient(135deg, var(--accent-purple) 0%, #7d3c98 100%);
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
cursor: pointer;
|
||||
transition: all 0.1s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4px 20px rgba(155, 89, 182, 0.4);
|
||||
}
|
||||
|
||||
#harvest-btn:hover {
|
||||
transform: scale(1.05);
|
||||
box-shadow: 0 6px 30px rgba(155, 89, 182, 0.6);
|
||||
}
|
||||
|
||||
#harvest-btn:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
font-size: 0.9rem;
|
||||
margin-top: 5px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
#click-info, #total-clicks {
|
||||
text-align: center;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* Buildings Panel */
|
||||
#buildings-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.building-card {
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border: 1px solid var(--border-color);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.building-card:hover {
|
||||
background: var(--bg-hover);
|
||||
border-color: var(--accent-purple);
|
||||
}
|
||||
|
||||
.building-card.locked {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.building-info h4 {
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.building-info .building-desc {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.building-info .building-production {
|
||||
font-size: 0.8rem;
|
||||
color: var(--accent-green);
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.building-stats {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.building-cost {
|
||||
color: var(--accent-gold);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.building-count {
|
||||
font-size: 1.5rem;
|
||||
color: var(--accent-purple);
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.buy-btn {
|
||||
background: var(--accent-green);
|
||||
color: var(--text-primary);
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 8px 16px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.buy-btn:hover:not(:disabled) {
|
||||
background: #27ae60;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.buy-btn:disabled {
|
||||
background: var(--text-muted);
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Side Panel Tabs */
|
||||
.tabs {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
flex: 1;
|
||||
background: var(--bg-card);
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.tab-btn.active {
|
||||
background: var(--accent-purple);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-content.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Upgrades */
|
||||
#upgrades-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.upgrade-card {
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--border-color);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.upgrade-card:hover:not(.purchased):not(.locked) {
|
||||
background: var(--bg-hover);
|
||||
border-color: var(--accent-gold);
|
||||
}
|
||||
|
||||
.upgrade-card.purchased {
|
||||
opacity: 0.6;
|
||||
border-color: var(--accent-green);
|
||||
}
|
||||
|
||||
.upgrade-card.locked {
|
||||
opacity: 0.4;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.upgrade-name {
|
||||
font-weight: bold;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.upgrade-desc {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.upgrade-cost {
|
||||
color: var(--accent-gold);
|
||||
font-size: 0.9rem;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* Achievements */
|
||||
#achievements-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.achievement {
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
border: 1px solid var(--border-color);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.achievement.unlocked {
|
||||
border-color: var(--accent-gold);
|
||||
background: linear-gradient(135deg, var(--bg-card) 0%, #2a2a5e 100%);
|
||||
}
|
||||
|
||||
.achievement.locked {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.achievement-icon {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.achievement-name {
|
||||
font-size: 0.7rem;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* Stats Panel */
|
||||
#stats-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
color: var(--accent-gold);
|
||||
}
|
||||
|
||||
.stat-bar {
|
||||
height: 8px;
|
||||
background: var(--bg-dark);
|
||||
border-radius: 4px;
|
||||
margin-top: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stat-bar-fill {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold));
|
||||
border-radius: 4px;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
#game-footer {
|
||||
background: var(--bg-panel);
|
||||
padding: 15px 40px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
border-top: 2px solid var(--border-color);
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#game-footer button {
|
||||
background: var(--bg-card);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
padding: 8px 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
#game-footer button:hover {
|
||||
background: var(--bg-hover);
|
||||
border-color: var(--accent-purple);
|
||||
}
|
||||
|
||||
#reset-btn:hover {
|
||||
border-color: var(--danger);
|
||||
}
|
||||
|
||||
#last-saved {
|
||||
margin-left: auto;
|
||||
color: var(--text-muted);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
#notifications {
|
||||
position: fixed;
|
||||
top: 80px;
|
||||
right: 20px;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
padding: 15px 20px;
|
||||
border-left: 4px solid var(--accent-purple);
|
||||
animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.notification.success {
|
||||
border-left-color: var(--accent-green);
|
||||
}
|
||||
|
||||
.notification.warning {
|
||||
border-left-color: var(--warning);
|
||||
}
|
||||
|
||||
.notification.achievement {
|
||||
border-left-color: var(--accent-gold);
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
transform: translateX(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeOut {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Modal */
|
||||
.modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
.modal.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background: var(--bg-panel);
|
||||
border-radius: 12px;
|
||||
padding: 30px;
|
||||
max-width: 500px;
|
||||
width: 90%;
|
||||
border: 2px solid var(--accent-purple);
|
||||
}
|
||||
|
||||
.modal-content h3 {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.modal-content textarea {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
background: var(--bg-card);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.modal-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.modal-buttons button {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#confirm-import {
|
||||
background: var(--accent-green);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
#cancel-import {
|
||||
background: var(--bg-card);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
/* Floating Text Animation */
|
||||
.float-text {
|
||||
position: fixed;
|
||||
pointer-events: none;
|
||||
font-weight: bold;
|
||||
font-size: 1.2rem;
|
||||
color: var(--accent-gold);
|
||||
animation: floatUp 1s ease-out forwards;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
@keyframes floatUp {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(-50px);
|
||||
}
|
||||
}
|
||||
|
||||
/* Scrollbar Styling */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: var(--bg-dark);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--border-color);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--accent-purple);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 1200px) {
|
||||
#main-layout {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
#side-panel {
|
||||
grid-column: span 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
#main-layout {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
#side-panel {
|
||||
grid-column: span 1;
|
||||
}
|
||||
|
||||
#game-header {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user