Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hotfusion committed Oct 23, 2024
1 parent 9b1197e commit 771b331
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/view/hotfusion/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
<title>HotFusion.ca</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/view/hotfusion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
Expand Down
65 changes: 57 additions & 8 deletions src/view/hotfusion/src/pages/contactus.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import {Layout,Component,Components, Element} from "@hotfusion/ui"
import {Fetch,Layout,Component,Components, Element, Warning} from "@hotfusion/ui"
import * as KUTE from "kute.js";
export default {
props:['enable'],
Expand All @@ -19,16 +19,65 @@ export default {
this.Layout.push(
new Component( Components.form,{
elements : [
new Element('input').setId('name').setLabel('Full Name').setIcon('fas fa-user').setPlaceholder('Enter your last and first name').setDisable(true).setType((value) => {
throw new Error('error')
}),
new Element('input').setId('email').setLabel('Email Address').setIcon('fas fa-at').setPlaceholder('Enter your email address').setDisable(true),
new Element('input').setId('phone').setLabel('Phone Number').setIcon('fas fa-phone').setPlaceholder('Enter your phone number').setDisable(true),
new Element('textarea').setId('message').setLabel('Message').setIcon('fas fa-envelope-square').setPlaceholder('Enter your message').setDisable(true)
new Element('input')
.setId('name')
.setValue('vadim')
.setLabel('Full Name')
.setIcon('fas fa-user')
.setPlaceholder('Enter your last and first name')
.setDisable(true)
.setMinValueLength(4)
.setMaxValueLength(100),
new Element('input')
.setValue('[email protected]')
.setId('email')
.setLabel('Email Address')
.setIcon('fas fa-at')
.setPlaceholder('Enter your email address')
.setDisable(true)
.setMinValueLength(4)
.setMaxValueLength(100)
.setType((event, element) => {
let email = element.getValue()?.split('@')
if(!email?.[1] || !email?.[1]?.split('.')?.[1] || email[1].split('.')?.[1]?.length < 2)
throw new Error('The email address is not valid');
}),
new Element('input')
.setValue('5149996659')
.setId('phone')
.setLabel('Phone Number')
.setIcon('fas fa-phone')
.setPlaceholder('Enter your phone number')
.setDisable(true)
.setMinValueLength(9)
.setMaxValueLength(11)
.setType((event, element) => {
let phone = element.getValue()
if(isNaN(phone))
throw new Error('The phone number is not valid');
}),
new Element('textarea')
.setValue('Hello, my name is vadim and i am looking for someone to work with!')
.setId('message')
.setLabel('Message')
.setIcon('fas fa-envelope-square')
.setPlaceholder('Enter your message')
.setDisable(true)
.setMinValueLength(20)
.setMaxValueLength(2000)
],
footer : [
new Element('button').setLabel('Send us a message')
new Element('button').setLabel('Send us a message').setDisable(true).on('click', ({element}) => {
element.setBusy(true);
Fetch.post('https://hotfusion.ca/cgi-bin/mail.php',this.Layout[0].component.getFormAsObject()).then(e => {
console.log('retrun',e);
})
})
]
}).on('keydown',async () => {
let isValid = this.Layout[0].component.isValid()
this.Layout[0].component.footer[0].setDisable(!isValid);
})
);
setTimeout(() => {
Expand Down
11 changes: 4 additions & 7 deletions src/view/hotfusion/src/pages/pricelist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export default {
}),
methods : {
onSlideChange(e){
this.activeIndex = e.activeIndex;
this.activeIndex
= e.activeIndex;
setTimeout(() => {
let p = [...this.$el.querySelectorAll('.paragraph')];
p.forEach((x, i) => {
if (i === e.activeIndex) {
let element = x.querySelector('h1');
element.innerHTML = '';
element.innerHTML = '';
KUTE.default.to(element, {text: element.getAttribute('value')}).start();
}
})
Expand Down Expand Up @@ -52,9 +52,6 @@ export default {
<swiper-slide>
<div class="paragraph" center>
<div class="icon">
<div class="cube"></div>
<div class="circle"></div>
<div class="triangle"></div>
<i class="fas fa-cash-register"></i>
</div>
<h1 value="How much our service cost?"></h1>
Expand Down

0 comments on commit 771b331

Please sign in to comment.