Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar

Adrian Statescu thinkphp

View GitHub Profile
themeToggle.addEventListener('click', () => {
const html = document.documentElement;
const currentTheme = html.getAttribute('data-theme');
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
html.setAttribute('data-theme', newTheme);
// Update the button icon
if (newTheme === 'dark') {
moonIcon.style.display = 'none';
sunIcon.style.display = 'block';
} else {
@thinkphp
thinkphp / order-coffee-html.html
Created April 12, 2025 12:50
Order Coffee html
<body>
<div class="container">
<header class="header">
<h1>Coffee Shop</h1>
<p>Select your favorite coffee and add it to cart</p>
</header>
<main class="products" id="products-container">
<!-- Products will be added here by JavaScript -->
</main>
@thinkphp
thinkphp / order-coffee-javascript.js
Created April 12, 2025 12:49
Order-coffee-javascript
<script>
// Coffee products data
const coffeeProducts = [
{
id: 1,
name: "Espresso",
price: 2.99,
description: "Strong and concentrated coffee shot"
},
{
@thinkphp
thinkphp / order-coffee-css.css
Created April 12, 2025 12:48
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 {
@thinkphp
thinkphp / sampledFile.java
Created April 9, 2025 19:25
SampledFile.java Class
public class SampledFile extends AudioFile {
protected long duration;
public SampledFile() {
super();
this.duration = 0;
}
@thinkphp
thinkphp / TaggedFile.java
Created April 9, 2025 19:16
TaggedFile Class
package player;
import java.util.Map;
public class TaggedFile extends SampleFile {
private String album;
public void readAndStoreTags() {
@thinkphp
thinkphp / TestFormeGeometrice.java
Created April 9, 2025 17:20
Test Forme GEometrice
public class TestFormeGeometrice {
public static void main(String[] args) {
FormaGeometrica cerc = new Cerc("rosu",5.5);
FormaGeometrica dreptunghi = new Dreptunghi("albastru", 3.0, 5.0);
System.out.println("Detalli despre Cerc:");
cerc.afiseazaDetalii();
@thinkphp
thinkphp / Cerc.java
Created April 9, 2025 17:13
cerc java class
public class Cerc extends FormaGeometrica {
private double raza;
public Cerc(String culoare, double raza) {
//super apeleaza constructorul clasei de baza
//FormaGeometrica(culoare)
super( culoare );
@thinkphp
thinkphp / Dreptunghi.java
Created April 9, 2025 17:13
Dreptunghi java class
public class Dreptunghi extends FormaGeometrica {
private double lungime;
private double latime;
public Dreptunghi(String culoare, double lungime, double latime) {
super(culoare);
this.lungime = lungime;
this.latime = latime;
@thinkphp
thinkphp / abstractFormaGeometrica.java
Created April 9, 2025 16:47
Abstract Forma Geometrica.java
/*
Clasa abstracta vs interfata
- Interfata contine doar declaratii fara metode ( fara implementare) si constante
- o clasa poate implementa mai multe interfaete (suport pentru mostenire multipla)
- toate metodele sunt implicit publice si abstracte
- este definita folosind cuvantul "interface"