Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created April 12, 2025 12:48
Show Gist options
  • Save thinkphp/911e9cd09692e5c56a23e90b54eff4aa to your computer and use it in GitHub Desktop.
Save thinkphp/911e9cd09692e5c56a23e90b54eff4aa to your computer and use it in GitHub Desktop.
Order Coffee Style CSS
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
margin: 0;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
display: grid;
grid-template-columns: 2fr 1fr;
gap: 30px;
}
.header {
grid-column: 1 / -1;
text-align: center;
margin-bottom: 20px;
}
h1, h2, h3 {
color: #5d4037;
}
.products {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 20px;
}
.product-card {
background-color: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.product-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.product-image {
height: 180px;
background-color: #d7ccc8;
display: flex;
align-items: center;
justify-content: center;
color: #5d4037;
font-weight: bold;
}
.product-info {
padding: 15px;
}
.product-title {
margin: 0 0 10px 0;
font-size: 18px;
}
.product-price {
font-weight: bold;
margin-bottom: 10px;
color: #5d4037;
}
.product-description {
font-size: 14px;
color: #666;
margin-bottom: 15px;
}
button {
background-color: #795548;
color: white;
border: none;
padding: 8px 15px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #5d4037;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.cart {
background-color: white;
border-radius: 8px;
padding: 20px;
position: sticky;
top: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.cart-item {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.item-info {
flex-grow: 1;
}
.item-title {
margin: 0 0 5px 0;
font-size: 16px;
}
.item-price {
font-size: 14px;
color: #666;
}
.item-controls {
display: flex;
align-items: center;
}
.item-quantity {
margin: 0 10px;
width: 30px;
text-align: center;
}
.cart-total {
margin-top: 20px;
font-weight: bold;
font-size: 18px;
text-align: right;
}
.checkout-button {
width: 100%;
padding: 12px;
font-size: 16px;
background-color: #4caf50;
margin-top: 20px;
}
.checkout-button:hover {
background-color: #388e3c;
}
.emptycart-button {
width: 100%;
padding: 8px;
font-size: 14px;
background-color: #f44336;
margin-top: 10px;
}
.emptycart-button:hover {
background-color: #d32f2f;
}
.notification {
position: fixed;
top: 20px;
right: 20px;
background-color: #4caf50;
color: white;
padding: 15px 25px;
border-radius: 4px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
transform: translateX(200%);
transition: transform 0.3s ease;
}
.notification.show {
transform: translateX(0);
}
.empty-cart-message {
text-align: center;
color: #666;
margin: 30px 0;
}
@media (max-width: 768px) {
.container {
grid-template-columns: 1fr;
}
.cart {
position: static;
margin-top: 30px;
}
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment