Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part HTML and CSS done #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/_DS_Store
Binary file not shown.
860 changes: 860 additions & 0 deletions public/css/myStyle.css

Large diffs are not rendered by default.

Binary file added public/img/Wallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/background_banner.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg10.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg8.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burg8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burger1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burger2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/burger3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/green-wallpaper18.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/send.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions public/js/ vue_script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@



/*
var vm = new Vue({
el: '#selectBurger',
data: {
burgerMessage: 'Välj burgare'
}
})


var example2 = new Vue({
el: '#wrapper',
data: {
parentMessage: 'Parent',
burgers: [{
name: "Supreme",
stock: 2,
img: "img/burg1.png"
},
{
name: "Extra cheese",
stock: 8,
img: "img/burg2.png"
},
{
name: "Chicken Royal",
stock: 0,
img: "img/burg3.png"
},
{
name: "Supreme",
stock: 2,
img: "img/burg4.png"
},
{
name: "Chicken Royal",
stock: 0,
img: "img/burg5.png"
},
{
name: "pp Royal",
stock: 8,
img: "img/burg6.png"
}
]
}
})
*/
222 changes: 222 additions & 0 deletions public/js/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@

// Send "Burger Menu"
var vm1 = new Vue({
el: '#selectBurger',
data: {
burgerMessage: 'Select Burger',
}
})





var example2 = new Vue({
el: '#wrapper',
data: {
parentMessage: 'Parent',
newTodoText: '',
burgers: [ ]
},

// Calls on functions in "method: " and makes it reactive
created: function() {
for(var i = 0; i < food.burgers.length; i++) {
this.print(i);
}
},

// initalize static functions to be called later
methods: {
print: function(i) {
this.burgers.push({
name: food.burgers[i].name,
kCal: food.burgers[i].kCal,
lactose: food.burgers[i].lactose,
gluten: food.burgers[i].gluten,
img: food.burgers[i].img,
price: food.burgers[i].price,
checked: food.burgers[i].checked
})
}
},
})



// This way you can initalize staticly ...
//example2.print(0);
//example2.print(3);


// new Vue({
// el: '#exxx',
// data: {
// buyerInfo: []
// }
// })


new Vue({
el: '#sendForm',
methods: {
logMessage: function (message) {
console.log(message);
processFormData();
}
}
})





var vm = new Vue({
el: '#getBurgers',
data: function() {
return {
burgers: []
}
},

methods: {
get: function(event) {

}
},
watch: {

}
})






















// Regular expression from W3C HTML5.2 input specification:
// https://www.w3.org/TR/html/sec-forms.html#email-state-typeemail
var emailRegExp = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;

// Regular expression to only allow positive wholenumbers, not beginning with 0
var houseRegExp = /^(|[1-9][0-9]*)$/;


new Vue({
// root node
el: "#app",
// the instance state
data: function() {
return {
burgers: [],
name: "",
email: {
value: "",
valid: true
},
street: "",
house: {
value: "",
valid: true
},
features: ["Online card", "Credit", "Swish", "Burger Heaven card"],
selection: {
payment: "Bank Card",
gender: "Undisclosed",
features: []
},
message: {
text: `Dear Mr. President,\n...`,
maxlength: 255
},
submitted: false
};
},

// Calls on functions in "method: " and makes it reactive
created: function() {
for(var i = 0; i < food.burgers.length; i++) {
this.print(i);
}
},




methods: {


// submit form handler
submit: function() {
this.submitted = true;
},
// validate by type and value
validate: function(type, value) {
if (type === "email") {
this.email.valid = this.isEmail(value) ? true : false;
}
},
// validate by type and value
validateHouse: function(type, value) {
if (type === "house") {
this.house.valid = this.isHouse(value) ? true : false;
}
},
// check for valid email adress
isEmail: function(value) {
return emailRegExp.test(value);
},
// check for valid email adress
isHouse: function(value) {
return houseRegExp.test(value);
},
// check or uncheck all
checkAll: function(event) {
this.selection.features = event.target.checked ? this.features : [];
},


print: function(i) {
this.burgers.push({
name: food.burgers[i].name,
checked: food.burgers[i].checked,

})
}




},
watch: {
// watching nested property
"email.value": function(value) {
this.validate("email", value);
},

// watching nested property
"house.value": function(value) {
this.validateHouse("house", value);
},

}
});



Loading