-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1263 lines (1062 loc) · 45.6 KB
/
index.html
File metadata and controls
1263 lines (1062 loc) · 45.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- iOS Specific Meta Tags -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="For You">
<title>For You ♡</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
body {
width: 100%;
height: 100vh;
overflow: hidden;
font-family: 'Courier New', monospace;
background: linear-gradient(135deg, #ffc3e1 0%, #d4a5f9 50%, #c5a5f9 100%);
}
#terminal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
opacity: 1;
transition: opacity 1.5s ease-out;
}
#terminal-overlay.fade-out {
opacity: 0;
pointer-events: none;
}
.terminal-content {
padding: 20px;
max-width: 90%;
}
.terminal-text {
color: #00ff00;
font-size: 18px;
line-height: 1.6;
white-space: pre-wrap;
text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}
.cursor {
display: inline-block;
width: 10px;
height: 20px;
background: #00ff00;
margin-left: 2px;
animation: blink 1s infinite;
}
@keyframes blink {
0%,
49% {
opacity: 1;
}
50%,
100% {
opacity: 0;
}
}
#canvas-container {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
}
canvas {
display: block;
touch-action: none;
}
/* Loading indicator for 3D scene */
.loading {
position: fixed;
bottom: 20px;
right: 20px;
color: rgba(255, 255, 255, 0.8);
font-size: 14px;
z-index: 500;
font-family: Arial, sans-serif;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<!-- Canvas Container for Three -->
<div id="canvas-container"></div>
<!-- Terminal Overlay -->
<div id="terminal-overlay">
<div class="terminal-content">
<div class="terminal-text" id="terminal-text"></div>
</div>
</div>
<!-- Three.js from CDN -->
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/"
}
}
</script>
<script type="module">
import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
// Terminal Typewriter Effect
const terminalText = document.getElementById('terminal-text');
const terminalOverlay = document.getElementById('terminal-overlay');
const textToType = 'Ciao Nancy...\nQuesto è un piccolo mondo che ho creato...\nPer tutte le volte che ti senti sola o arrabbiata...\naccess_granted: TI AMO <3';
let charIndex = 0;
const typingSpeed = 80; // milliseconds per character
function typeWriter() {
if (charIndex < textToType.length) {
const char = textToType.charAt(charIndex);
terminalText.textContent += char;
charIndex++;
// Vary typing speed slightly for more natural effect
const variance = Math.random() * 40 - 20;
setTimeout(typeWriter, typingSpeed + variance);
} else {
// Add cursor at the end
const cursor = document.createElement('span');
cursor.className = 'cursor';
terminalText.appendChild(cursor);
// Wait 1.5 seconds, then fade out
setTimeout(() => {
terminalOverlay.classList.add('fade-out');
// Remove from DOM after fade completes
setTimeout(() => {
terminalOverlay.style.display = 'none';
}, 1500);
}, 1500);
}
}
// THREE.JS SCENE SETUP
const container = document.getElementById('canvas-container');
// Scene
const scene = new THREE.Scene();
// Create romantic text background
function createRomanticBackground() {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.width = 1024;
canvas.height = 1024;
// Pink gradient background
const gradient = context.createLinearGradient(0, 0, canvas.width, canvas.height);
gradient.addColorStop(0, '#ffc3e1');
gradient.addColorStop(0.5, '#d4a5f9');
gradient.addColorStop(1, '#c5a5f9');
context.fillStyle = gradient;
context.fillRect(0, 0, canvas.width, canvas.height);
// Array of romantic phrases
const phrases = [
'ti amo ♡',
'amore mio',
'sei tutto',
'per sempre',
'ti penso',
'cuore mio',
'nancy ♡',
'forever',
'my love'
];
// Set text properties
context.font = 'Bold 32px Arial'; // Larger font
context.fillStyle = 'rgba(255, 255, 255, 0.3)'; // More visible
context.textAlign = 'center';
// Draw phrases in a pattern
for (let y = 30; y < canvas.height; y += 80) {
for (let x = 30; x < canvas.width; x += 200) {
const phrase = phrases[Math.floor(Math.random() * phrases.length)];
context.save();
context.translate(x, y);
context.rotate((Math.random() - 0.5) * 0.3);
context.fillText(phrase, 0, 0);
context.restore();
}
}
return new THREE.CanvasTexture(canvas);
}
// Load the background image with fallback
const backgroundLoader = new THREE.TextureLoader();
backgroundLoader.load(
'background.jpg',
(texture) => {
// Success: use the Taj Mahal image
// Adjust texture to show the upper part of the image
texture.offset.y = -0.4;
texture.wrapT = THREE.RepeatWrapping;
scene.background = texture;
},
undefined,
(error) => {
// Error: fallback to romantic text background
console.warn('background.jpg not found, using fallback background');
const bgTexture = createRomanticBackground();
bgTexture.wrapS = THREE.RepeatWrapping;
bgTexture.wrapT = THREE.RepeatWrapping;
bgTexture.repeat.set(2, 2);
scene.background = bgTexture;
}
);
// Camera
const camera = new THREE.PerspectiveCamera(
75,
window.innerWidth / window.innerHeight,
0.1,
1000
);
camera.position.set(0, 3, 8);
camera.lookAt(0, 1, 0);
// Renderer
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
container.appendChild(renderer.domElement);
// Lighting
const ambientLight = new THREE.AmbientLight(0xffffff, 0.6);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(5, 10, 5);
directionalLight.castShadow = true;
directionalLight.shadow.camera.left = -10;
directionalLight.shadow.camera.right = 10;
directionalLight.shadow.camera.top = 10;
directionalLight.shadow.camera.bottom = -10;
directionalLight.shadow.mapSize.width = 2048;
directionalLight.shadow.mapSize.height = 2048;
scene.add(directionalLight);
// Add a soft pink point light for romantic atmosphere
const pointLight = new THREE.PointLight(0xff69b4, 0.5, 20);
pointLight.position.set(0, 3, 0);
scene.add(pointLight);
// Floor with Indian-style decorative pattern
function createIndianFloorTexture() {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.width = 1024;
canvas.height = 1024;
// Base marble-like gradient (cream/beige)
const gradient = context.createRadialGradient(512, 512, 0, 512, 512, 700);
gradient.addColorStop(0, '#F5E6D3');
gradient.addColorStop(0.5, '#E8D5B7');
gradient.addColorStop(1, '#D4C4A8');
context.fillStyle = gradient;
context.fillRect(0, 0, canvas.width, canvas.height);
// Draw decorative tile pattern
const tileSize = 128;
const colors = ['#8B7355', '#A0826D', '#6B5344', '#9C8B7A'];
for (let y = 0; y < canvas.height; y += tileSize) {
for (let x = 0; x < canvas.width; x += tileSize) {
// Tile border
context.strokeStyle = '#6B5344';
context.lineWidth = 3;
context.strokeRect(x + 5, y + 5, tileSize - 10, tileSize - 10);
// Inner decorative pattern (mandala-style)
const centerX = x + tileSize / 2;
const centerY = y + tileSize / 2;
// Draw ornamental circle pattern
context.fillStyle = colors[Math.floor(Math.random() * colors.length)];
context.globalAlpha = 0.3;
// Central circle
context.beginPath();
context.arc(centerX, centerY, 25, 0, Math.PI * 2);
context.fill();
// Radiating petals (8 petals)
for (let i = 0; i < 8; i++) {
const angle = (Math.PI * 2 / 8) * i;
const petalX = centerX + Math.cos(angle) * 35;
const petalY = centerY + Math.sin(angle) * 35;
context.beginPath();
context.arc(petalX, petalY, 12, 0, Math.PI * 2);
context.fill();
}
// Corner decorations
context.fillStyle = '#8B7355';
[0, 1, 2, 3].forEach(corner => {
const cornerAngle = (Math.PI / 2) * corner;
const cornerX = centerX + Math.cos(cornerAngle + Math.PI / 4) * 50;
const cornerY = centerY + Math.sin(cornerAngle + Math.PI / 4) * 50;
context.fillRect(cornerX - 3, cornerY - 3, 6, 6);
});
context.globalAlpha = 1.0;
}
}
const texture = new THREE.CanvasTexture(canvas);
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set(3, 3);
return texture;
}
const floorGeometry = new THREE.PlaneGeometry(20, 20);
const indianFloorTexture = createIndianFloorTexture();
const floorMaterial = new THREE.MeshStandardMaterial({
map: indianFloorTexture,
roughness: 0.6,
metalness: 0.1
});
const floor = new THREE.Mesh(floorGeometry, floorMaterial);
floor.rotation.x = -Math.PI / 2;
floor.receiveShadow = true;
scene.add(floor);
// Table (romantic picnic table)
const tableGroup = new THREE.Group();
// Wood material for table legs
const woodMaterial = new THREE.MeshStandardMaterial({
color: 0x8B4513, // Saddle brown
roughness: 0.8,
metalness: 0.1
});
// Create red and white checkered tablecloth texture
function createTableclothTexture() {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.width = 512;
canvas.height = 512;
const squareSize = 64; // Size of each checker square
const red = '#E74C3C';
const white = '#FFFFFF';
for (let y = 0; y < canvas.height; y += squareSize) {
for (let x = 0; x < canvas.width; x += squareSize) {
// Alternate colors like a checkerboard
const isRed = ((x / squareSize) + (y / squareSize)) % 2 === 0;
context.fillStyle = isRed ? red : white;
context.fillRect(x, y, squareSize, squareSize);
}
}
const texture = new THREE.CanvasTexture(canvas);
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set(2, 2); // Repeat the pattern for better visual
return texture;
}
// Table top with tablecloth texture
const tableclothTexture = createTableclothTexture();
const tableclothMaterial = new THREE.MeshStandardMaterial({
map: tableclothTexture,
roughness: 0.7,
metalness: 0.0
});
const tableTopGeometry = new THREE.BoxGeometry(3, 0.1, 2);
const tableTop = new THREE.Mesh(tableTopGeometry, tableclothMaterial);
tableTop.position.y = 1.5;
tableTop.castShadow = true;
tableTop.receiveShadow = true;
tableGroup.add(tableTop);
// Table legs
const legGeometry = new THREE.BoxGeometry(0.1, 1.5, 0.1);
const legPositions = [
[-1.3, 0.75, -0.8],
[1.3, 0.75, -0.8],
[-1.3, 0.75, 0.8],
[1.3, 0.75, 0.8]
];
legPositions.forEach(pos => {
const leg = new THREE.Mesh(legGeometry, woodMaterial);
leg.position.set(...pos);
leg.castShadow = true;
tableGroup.add(leg);
});
scene.add(tableGroup);
// Picture Frames
const textureLoader = new THREE.TextureLoader();
// Function to create a picture frame
function createPictureFrame(imageUrl, positionX) {
const frameGroup = new THREE.Group();
// Frame border (outer frame)
const frameBorderGeometry = new THREE.BoxGeometry(1.2, 1.6, 0.1);
const frameBorderMaterial = new THREE.MeshStandardMaterial({
color: 0x2c1810,
roughness: 0.6,
metalness: 0.2
});
const frameBorder = new THREE.Mesh(frameBorderGeometry, frameBorderMaterial);
frameBorder.castShadow = true;
frameGroup.add(frameBorder);
// Photo/Image plane (inside the frame)
const photoGeometry = new THREE.PlaneGeometry(1.0, 1.4);
const photoTexture = textureLoader.load(imageUrl);
const photoMaterial = new THREE.MeshStandardMaterial({
map: photoTexture,
roughness: 0.5
});
const photo = new THREE.Mesh(photoGeometry, photoMaterial);
photo.position.z = 0.06; // Slightly in front of the frame border
frameGroup.add(photo);
// Position the frame on the table
frameGroup.position.set(positionX, 1.55 + 0.8, -0.3); // On table surface, raised by half height
// Tilt backward
frameGroup.rotation.x = -0.15; // Slight backward tilt
// Angle towards center
if (positionX < 0) {
frameGroup.rotation.y = 0.2; // Left frame angles right
} else {
frameGroup.rotation.y = -0.2; // Right frame angles left
}
frameGroup.castShadow = true;
return frameGroup;
}
// Indian Dinner Setup - Butter Chicken and Rice
// ========================================
// Table top height (same as table position)
const tableTopHeight = 1.5;
// Function to create a dinner plate
function createDinnerPlate() {
const plateGroup = new THREE.Group();
// Plate base (white ceramic) - EXTRA LARGE AND 3D
const plateGeometry = new THREE.CylinderGeometry(0.50, 0.50, 0.08, 32);
const plateMaterial = new THREE.MeshStandardMaterial({
color: 0xF5F5F5,
roughness: 0.3,
metalness: 0.1
});
const plate = new THREE.Mesh(plateGeometry, plateMaterial);
plate.castShadow = true;
plate.receiveShadow = true;
plateGroup.add(plate);
// Add plate rim for more 3D effect
const rimGeometry = new THREE.TorusGeometry(0.50, 0.025, 16, 32);
const rim = new THREE.Mesh(rimGeometry, plateMaterial);
rim.rotation.x = Math.PI / 2;
rim.position.y = 0.04;
plateGroup.add(rim);
return plateGroup;
}
// GLTFLoader instance
const gltfLoader = new GLTFLoader();
// Function to load GLTF model and configure it
function loadGLTFModel(path, scale, position, callback) {
gltfLoader.load(
path,
(gltf) => {
const model = gltf.scene;
// Apply scale
model.scale.set(scale, scale, scale);
// Apply position
model.position.set(position.x, position.y, position.z);
// Enable shadows on all meshes
model.traverse((child) => {
if (child.isMesh) {
child.castShadow = true;
child.receiveShadow = true;
}
});
if (callback) callback(model);
},
(progress) => {
console.log(`Loading ${path}: ${(progress.loaded / progress.total * 100).toFixed(2)}%`);
},
(error) => {
console.error(`Error loading ${path}:`, error);
}
);
}
// Function to create utensils (fork and knife)
function createUtensils(positionX) {
const utensilGroup = new THREE.Group();
const silverMaterial = new THREE.MeshStandardMaterial({
color: 0xC0C0C0,
roughness: 0.3,
metalness: 0.9
});
// Fork (left side) - LARGER
const forkHandle = new THREE.Mesh(
new THREE.CylinderGeometry(0.008, 0.008, 0.18, 8),
silverMaterial
);
forkHandle.rotation.z = Math.PI / 2;
forkHandle.position.set(positionX - 0.35, tableTopHeight + 0.01, 0);
utensilGroup.add(forkHandle);
// Knife (right side) - LARGER
const knifeHandle = new THREE.Mesh(
new THREE.CylinderGeometry(0.008, 0.008, 0.18, 8),
silverMaterial
);
knifeHandle.rotation.z = Math.PI / 2;
knifeHandle.position.set(positionX + 0.35, tableTopHeight + 0.01, 0);
utensilGroup.add(knifeHandle);
return utensilGroup;
}
// Function to create glass
function createGlass(positionX, positionZ) {
const glassGeometry = new THREE.CylinderGeometry(0.07, 0.06, 0.20, 16);
const glassMaterial = new THREE.MeshPhysicalMaterial({
color: 0xCCE5FF,
transparent: true,
opacity: 0.3,
roughness: 0.1,
metalness: 0.0,
transmission: 0.9
});
const glass = new THREE.Mesh(glassGeometry, glassMaterial);
glass.position.set(positionX, tableTopHeight + 0.12, positionZ);
return glass;
}
// Function to create a vase with roses
function createRoseVase() {
const vaseGroup = new THREE.Group();
// Vase body (elegant glass vase) - LARGER
const vaseGeometry = new THREE.CylinderGeometry(0.10, 0.07, 0.25, 16);
const vaseMaterial = new THREE.MeshPhysicalMaterial({
color: 0xE8F4F8,
transparent: true,
opacity: 0.4,
roughness: 0.1,
metalness: 0.0,
transmission: 0.8
});
const vase = new THREE.Mesh(vaseGeometry, vaseMaterial);
vase.position.y = 0.14;
vase.castShadow = true;
vaseGroup.add(vase);
// Vase rim
const rimGeometry = new THREE.TorusGeometry(0.10, 0.014, 16, 32);
const rim = new THREE.Mesh(rimGeometry, vaseMaterial);
rim.rotation.x = Math.PI / 2;
rim.position.y = 0.265;
vaseGroup.add(rim);
// Create roses - MORE AND BIGGER
for (let i = 0; i < 7; i++) {
const rose = createRose();
const angle = (i / 7) * Math.PI * 2 + Math.random() * 0.3;
const height = 0.25 + Math.random() * 0.12;
const radius = 0.03 + Math.random() * 0.04;
rose.position.set(
Math.cos(angle) * radius,
height,
Math.sin(angle) * radius
);
rose.rotation.z = (Math.random() - 0.5) * 0.3;
rose.scale.set(1.5, 1.5, 1.5);
vaseGroup.add(rose);
}
return vaseGroup;
}
// Function to create a single rose
function createRose() {
const roseGroup = new THREE.Group();
// Rose colors (red shades)
const petalColors = [0xDC143C, 0xFF1744, 0xC51162, 0xD50000];
const roseColor = petalColors[Math.floor(Math.random() * petalColors.length)];
// Rose head (main flower) - BIGGER
const headGeometry = new THREE.SphereGeometry(0.035, 8, 8);
const headMaterial = new THREE.MeshStandardMaterial({
color: roseColor,
roughness: 0.6,
metalness: 0.1
});
const head = new THREE.Mesh(headGeometry, headMaterial);
head.scale.set(1, 0.8, 1);
head.castShadow = true;
roseGroup.add(head);
// Petals around the rose - BIGGER
for (let i = 0; i < 8; i++) {
const petalGeometry = new THREE.SphereGeometry(0.022, 6, 6);
const petal = new THREE.Mesh(petalGeometry, headMaterial);
const angle = (i / 8) * Math.PI * 2;
petal.position.set(
Math.cos(angle) * 0.03,
-0.008,
Math.sin(angle) * 0.03
);
petal.scale.set(0.8, 1.2, 0.6);
roseGroup.add(petal);
}
// Stem - THICKER
const stemGeometry = new THREE.CylinderGeometry(0.005, 0.005, 0.18, 8);
const stemMaterial = new THREE.MeshStandardMaterial({
color: 0x228B22,
roughness: 0.8
});
const stem = new THREE.Mesh(stemGeometry, stemMaterial);
stem.position.y = -0.09;
roseGroup.add(stem);
// Leaves - BIGGER
for (let i = 0; i < 3; i++) {
const leafGeometry = new THREE.SphereGeometry(0.018, 6, 6);
const leafMaterial = new THREE.MeshStandardMaterial({
color: 0x2E7D32,
roughness: 0.7
});
const leaf = new THREE.Mesh(leafGeometry, leafMaterial);
leaf.scale.set(0.5, 0.3, 1.5);
leaf.position.set(
(i === 0 ? 0.022 : i === 1 ? -0.022 : 0),
-0.06 - i * 0.03,
0
);
leaf.rotation.z = (i === 0 ? -0.5 : i === 1 ? 0.5 : 0);
roseGroup.add(leaf);
}
return roseGroup;
}
// Function to create a candle
function createCandle(positionX, positionZ) {
const candleGroup = new THREE.Group();
// Candle body (wax) - LARGER
const candleGeometry = new THREE.CylinderGeometry(0.04, 0.045, 0.20, 16);
const candleMaterial = new THREE.MeshStandardMaterial({
color: 0xFFF8DC, // Cream color
roughness: 0.7,
metalness: 0.0
});
const candle = new THREE.Mesh(candleGeometry, candleMaterial);
candle.position.y = tableTopHeight + 0.11;
candle.castShadow = true;
candleGroup.add(candle);
// Wick (black thread) - LARGER
const wickGeometry = new THREE.CylinderGeometry(0.003, 0.003, 0.025, 8);
const wickMaterial = new THREE.MeshStandardMaterial({
color: 0x1a1a1a
});
const wick = new THREE.Mesh(wickGeometry, wickMaterial);
wick.position.y = tableTopHeight + 0.225;
candleGroup.add(wick);
// Flame (glowing sphere) - LARGER
const flameGeometry = new THREE.SphereGeometry(0.025, 8, 8);
const flameMaterial = new THREE.MeshStandardMaterial({
color: 0xFFA500,
emissive: 0xFF6600,
emissiveIntensity: 2.5,
transparent: true,
opacity: 0.9
});
const flame = new THREE.Mesh(flameGeometry, flameMaterial);
flame.scale.set(0.8, 1.5, 0.8);
flame.position.y = tableTopHeight + 0.25;
candleGroup.add(flame);
// Point light from flame - BRIGHTER
const flameLight = new THREE.PointLight(0xFF9933, 1.2, 3);
flameLight.position.y = tableTopHeight + 0.25;
flameLight.castShadow = true;
candleGroup.add(flameLight);
// Store flame and light for animation
candleGroup.userData.flame = flame;
candleGroup.userData.flameLight = flameLight;
candleGroup.userData.baseY = tableTopHeight + 0.25;
candleGroup.userData.flickerPhase = Math.random() * Math.PI * 2;
candleGroup.position.set(positionX, 0, positionZ);
return candleGroup;
}
// Create dinner setup
const dinnerGroup = new THREE.Group();
// Load left sushi bowl model
loadGLTFModel(
'bowl/sushi-bowl/scene.gltf',
0.8,
{ x: -1.2, y: 1, z: 0 },
(model) => {
dinnerGroup.add(model);
console.log('Left sushi bowl loaded successfully');
}
);
// Load right sushi bowl model
loadGLTFModel(
'bowl/sushi-bowl/scene.gltf',
0.8,
{ x: 0.8, y: 1, z: 0 },
(model) => {
dinnerGroup.add(model);
console.log('Right sushi bowl loaded successfully');
}
);
// Load center sushi model (in front of the rose vase)
loadGLTFModel(
'sushi/sushi/scene.gltf',
0.02,
{ x: 0, y: 1.4, z: 0.15 },
(model) => {
dinnerGroup.add(model);
console.log('Center sushi loaded successfully');
}
);
// Load left wine glass (in front of left sushi bowl)
loadGLTFModel(
'glass/simple_glass_cup/scene.gltf',
0.07,
{ x: -1, y: 1.9, z: 0.5 },
(model) => {
dinnerGroup.add(model);
console.log('Left wine glass loaded successfully');
}
);
// Load right wine glass (in front of right sushi bowl)
loadGLTFModel(
'glass/simple_glass_cup/scene.gltf',
0.07,
{ x: 0.8, y: 1.9, z: 0.5 },
(model) => {
dinnerGroup.add(model);
console.log('Right wine glass loaded successfully');
}
);
// Add single candle for romantic atmosphere
const candle = createCandle(1, -0.6);
dinnerGroup.add(candle);
const candle2 = createCandle(-1, -0.6);
dinnerGroup.add(candle2);
// Load wine bottle next to candle
loadGLTFModel(
'wine bottle/wine_bottle/scene.gltf',
0.15,
{ x: -0.5, y: 2, z: -0.6 },
(model) => {
dinnerGroup.add(model);
console.log('Wine bottle loaded successfully');
}
);
// Load flowers in vase
loadGLTFModel(
'flowers/flowers_in_vase/scene.gltf',
2,
{ x: 0.1, y: 1.5, z: -0.4 },
(model) => {
dinnerGroup.add(model);
console.log('Flowers loaded successfully');
}
);
// Store candle for animation
const candles = [candle];
scene.add(dinnerGroup);
// Particle System - Magical floating particles
const particleCount = 100;
const particlesGeometry = new THREE.BufferGeometry();
const particlePositions = new Float32Array(particleCount * 3);
const particleVelocities = [];
for (let i = 0; i < particleCount; i++) {
const i3 = i * 3;
// Random position around the table area
particlePositions[i3] = (Math.random() - 0.5) * 10; // x
particlePositions[i3 + 1] = Math.random() * 5; // y (floating above ground)
particlePositions[i3 + 2] = (Math.random() - 0.5) * 10; // z
// Random velocity for each particle
particleVelocities.push({
x: (Math.random() - 0.5) * 0.02,
y: (Math.random() * 0.01) + 0.005,
z: (Math.random() - 0.5) * 0.02
});
}
particlesGeometry.setAttribute('position', new THREE.BufferAttribute(particlePositions, 3));
const particlesMaterial = new THREE.PointsMaterial({
color: 0xffd1dc, // Soft pink
size: 0.08,
transparent: true,
opacity: 0.7,
blending: THREE.AdditiveBlending,
sizeAttenuation: true
});
const particles = new THREE.Points(particlesGeometry, particlesMaterial);
scene.add(particles);
// ========================================
// SPECTACULAR BACKGROUND HEART CLOUD
// ========================================
// Create canvas texture for "i love you" text
function createTextSprite() {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.width = 256;
canvas.height = 64;
// Set text properties
context.font = 'Bold 24px Arial';
context.fillStyle = '#ffb3d9'; // Light pink
context.textAlign = 'center';
context.textBaseline = 'middle';
// Draw text with slight glow
context.shadowColor = '#ff69b4';
context.shadowBlur = 10;
context.fillText('i love you', canvas.width / 2, canvas.height / 2);
// Create texture from canvas
const texture = new THREE.CanvasTexture(canvas);
texture.needsUpdate = true;
return texture;
}
// Create sprite material using the text texture
const textTexture = createTextSprite();
const spriteMaterial = new THREE.SpriteMaterial({
map: textTexture,
transparent: true,
opacity: 0.6,
blending: THREE.AdditiveBlending
});
// Create heart cloud group
const heartCloud = new THREE.Group();
const heartSpriteCount = 300; // Number of sprites forming the heart
// Parametric heart equation to generate positions
function heartFunction(u, v, scale = 1) {
// u goes from 0 to 2π (around the heart)
// v goes from 0 to π (top to bottom of heart)
const t = u;
const s = v;
// 3D Heart parametric equations
const x = scale * 16 * Math.pow(Math.sin(t), 3);
const y = scale * (13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t));
const z = scale * 8 * Math.sin(t) * Math.sin(s);
return { x, y, z };
}
// Generate sprites in heart shape
for (let i = 0; i < heartSpriteCount; i++) {
const sprite = new THREE.Sprite(spriteMaterial.clone());
// Random parameters for heart surface
const u = Math.random() * Math.PI * 2;
const v = Math.random() * Math.PI;
// Get position on heart surface
const pos = heartFunction(u, v, 0.15); // Scale down the heart
// Add some randomness to create volume/cloud effect
pos.x += (Math.random() - 0.5) * 0.5;
pos.y += (Math.random() - 0.5) * 0.5;
pos.z += (Math.random() - 0.5) * 0.5;
sprite.position.set(pos.x, pos.y, pos.z); // Offset Y to center nicely
sprite.scale.set(0.5, 0.25, 1); // Larger sprite size for "i love you"
// Store original parameters for animation
sprite.userData.originalU = u;
sprite.userData.originalV = v;
sprite.userData.scale = 0.15;
heartCloud.add(sprite);
}
// Position the heart cloud in the background
heartCloud.position.set(0, -4, -3);
heartCloud.scale.set(1.0, 1.0, 1.0); // Smaller, more delicate size
// Store initial scale for pulsation animation
heartCloud.userData.baseScale = 1.0;
heartCloud.userData.pulsePhase = 0;
heartCloud.userData.rotationAngle = 0; // For 2D rotation
scene.add(heartCloud);
// ========================================
// MEMORY RING - Floating Polaroid Photos
// ========================================
const memoryRing = new THREE.Group();
const photoCount = 10;