Skip to content

Commit 92f4ece

Browse files
committed
chore: cleanup
1 parent 619d78d commit 92f4ece

File tree

6 files changed

+156
-6
lines changed

6 files changed

+156
-6
lines changed

apps/nativescript-hello-world/src/components/Pager.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const loadedHeartArea = (args) => {
111111
<GridLayout row="1" class="align-middle px-4" @tap="showLove">
112112
<Label
113113
class="bg-[#42b883cc] rounded-xl font-bold text-[#35495e] mt-8 text-center p-4 vision:text-6xl ios:text-3xl android:text-3xl"
114-
>Vue Valentine? ❤️</Label
114+
>Vue Valentine ❤️</Label
115115
>
116116
</GridLayout>
117117
</GridLayout>

apps/web-hello-world/src/app/NxWelcome.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ defineProps<{
99
<div class="container">
1010
<div id="welcome">
1111
<h1>
12-
<span> Hello there, </span>
13-
Welcome Vue {{ title }} 👋
12+
<span> Hello Vue 👋</span>
13+
Happy Valentine Month 🌹
1414
</h1>
1515
</div>
1616

apps/web-hello-world/src/app/components/Logo3D.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import THREE from './three';
3838
this.camera.position.set(-5, -5, 20);
3939
4040
this.renderer = new THREE.WebGLRenderer({ alpha: true });
41-
this.renderer.setClearColor(0xffffff);
41+
// this.renderer.setClearColor(0xffffff);
4242
this.renderer.setPixelRatio(window.devicePixelRatio);
4343
this.renderer.setSize(window.innerWidth, window.innerHeight);
4444
document.body.appendChild(this.renderer.domElement);

apps/web-hello-world/src/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ html {
77
tab-size: 4;
88
scroll-behavior: smooth;
99
}
10+
@keyframes bg {
11+
0% { background: #42b883cc; }
12+
50% { background: #35495ea9; }
13+
100% { background: #42b883cc; }
14+
}
15+
1016
body {
1117
font-family: inherit;
1218
line-height: inherit;
1319
margin: 0;
20+
background: #000;
21+
animation: bg 5s linear infinite;
1422
}
1523
h1,
1624
h2,

apps/web-hello-world/src/views/AboutView.vue

Lines changed: 144 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<div class="about">
3-
<Logo3D/>
3+
<a class="dreaming"
4+
>Dreaming about our Vue Valentine ❤️</a
5+
>
6+
<Logo3D />
47
</div>
58
</template>
69

@@ -13,8 +16,148 @@
1316
padding: 0 1rem;
1417
}
1518
}
19+
.dreaming {
20+
background-color: #42b883cc;
21+
border-radius: 0.75rem;
22+
user-select: none;
23+
display: block;
24+
font-weight: bold;
25+
color: #35495e;
26+
font-size: x-large;
27+
margin: 15px auto 8px;
28+
padding: 1rem;
29+
text-align: center;
30+
}
31+
@keyframes heartfade {
32+
0% {
33+
opacity : 1;
34+
}
35+
50% {
36+
opacity : 0;
37+
}
38+
}
39+
.heart {
40+
z-index : 999;
41+
animation : heartfade 6s linear;
42+
position : absolute;
43+
}
44+
.heart:before,
45+
.heart:after {
46+
content : "";
47+
background-color : #fc2a62;
48+
position : absolute;
49+
height : 30px;
50+
width : 45px;
51+
border-radius : 15px 0px 0px 15px;
52+
}
53+
54+
.heart:before {
55+
transform : rotate(45deg);
56+
}
57+
58+
.heart:after {
59+
left : 10.5px;
60+
transform : rotate(135deg);
61+
}
1662
</style>
1763

1864
<script setup lang="ts">
1965
import Logo3D from '../app/components/Logo3D.vue';
66+
67+
var brd = document.createElement("DIV");
68+
document.body.insertBefore(brd, document.getElementById("board"));
69+
70+
const duration = 3000;
71+
const speed = 0.5;
72+
const cursorXOffset = 0;
73+
const cursorYOffset = -5;
74+
75+
let hearts = [];
76+
77+
function generateHeart(x, y, xBound, xStart, scale)
78+
{
79+
var heart = document.createElement("DIV") as any;
80+
heart.setAttribute('class', 'heart');
81+
brd.appendChild(heart);
82+
heart.time = duration;
83+
heart.x = x;
84+
heart.y = y;
85+
heart.bound = xBound;
86+
heart.direction = xStart;
87+
heart.style.left = heart.x + "px";
88+
heart.style.top = heart.y + "px";
89+
heart.scale = scale;
90+
heart.style.transform = "scale(" + scale + "," + scale + ")";
91+
if(hearts == null)
92+
hearts = [];
93+
hearts.push(heart);
94+
return heart;
95+
}
96+
97+
var down = false;
98+
var event = null;
99+
100+
document.onmousedown = function(e) {
101+
down = true;
102+
event = e;
103+
}
104+
105+
document.onmouseup = function(e) {
106+
down = false;
107+
}
108+
109+
document.onmousemove = function(e) {
110+
event = e;
111+
}
112+
113+
document.ontouchstart = function(e) {
114+
down = true;
115+
event = e.touches[0];
116+
}
117+
118+
document.ontouchend = function(e) {
119+
down = false;
120+
}
121+
122+
document.ontouchmove = function(e) {
123+
event = e.touches[0];
124+
}
125+
126+
var before = Date.now();
127+
var id = setInterval(frame, 5);
128+
var gr = setInterval(check, 100);
129+
130+
function frame()
131+
{
132+
var current = Date.now();
133+
var deltaTime = current - before;
134+
before = current;
135+
for(const i in hearts)
136+
{
137+
var heart = hearts[i];
138+
heart.time -= deltaTime;
139+
if(heart.time > 0)
140+
{
141+
heart.y -= speed;
142+
heart.style.top = heart.y + "px";
143+
heart.style.left = heart.x + heart.direction * heart.bound * Math.sin(heart.y * heart.scale / 30) / heart.y * 100 + "px";
144+
}
145+
else
146+
{
147+
heart.parentNode.removeChild(heart);
148+
hearts.splice(i, 1);
149+
}
150+
}
151+
}
152+
153+
function check()
154+
{
155+
if(down)
156+
{
157+
var start = 1 - Math.round(Math.random()) * 2;
158+
var scale = Math.random() * Math.random() * 0.8 + 0.2;
159+
var bound = 30 + Math.random() * 20;
160+
generateHeart(event.pageX - brd.offsetLeft + cursorXOffset, event.pageY - brd.offsetTop + cursorYOffset, bound, start, scale);
161+
}
162+
}
20163
</script>

apps/web-hello-world/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"allowJs": true,
44
"esModuleInterop": false,
55
"allowSyntheticDefaultImports": true,
6-
"strict": true,
76
"jsx": "preserve",
87
"jsxImportSource": "vue",
98
"moduleResolution": "node",

0 commit comments

Comments
 (0)