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

Frontend Assessment - James Cabauatan #60

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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ Thumbs.db
# Custom #
######################
*.sass-cache*
node_modules
Exercise-1/node_modules
Exercise-2/node_modules
/.idea
5 changes: 5 additions & 0 deletions Exercise-1/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
File renamed without changes.
File renamed without changes
File renamed without changes
44 changes: 44 additions & 0 deletions Exercise-1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "sample-vue-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"ant-design-vue": "^4.2.3",
"core-js": "^3.8.3",
"vue": "^3.2.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}
Binary file added Exercise-1/public/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions Exercise-1/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
148 changes: 148 additions & 0 deletions Exercise-1/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<template>
<div class="header">
<img v-if="!isMobile" class="image-container" alt="Vue logo" src="https://via.placeholder.com/1920x650">
<img v-if="isMobile" class="image-container" alt="Vue logo" src="https://via.placeholder.com/600x600">
<div class="header-text-container">
<p class="header-text-greeting">Hello Developer!</p>
<h3 class="header-text-centered">Lorem ipsum dolor sit amet, consectetur adipiscing elit</h3>
</div>
<p class="header-text-bottom-right">Powered by HTML.COM</p>
</div>
<cardListComponent />
</template>

<script>
import cardListComponent from './components/card-list-component.vue'

export default {
name: 'App',
components: {
cardListComponent
},
data(){
return{
screenWidth: '',
isMobile: '',
}
},
methods:{
checkScreenSize(){
this.screenWidth = window.innerWidth;
if(this.screenWidth > 768 ){
this.isMobile = false;
}else{
this.isMobile = true;
}
}
},
mounted(){
this.checkScreenSize();
window.addEventListener('resize', this.checkScreenSize);
}
}
</script>

<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

#app {
font-family: Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}

#app ul {
list-style: none;
}

#app li {
text-align: center;
}

#app button {
cursor: pointer;
border: 3px solid rgb(68, 68, 68);
color: rgb(68, 68, 68);
padding: 8px;
margin: 5px;
border-radius: 18px;
/* width: 45%; */
font-weight: 800;
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
letter-spacing: 2px;
}

body {
overflow-x: hidden; /* Hide horizontal scrollbar */
}

.header{
position: relative;
text-align: center;
color: white;
display: flex;
justify-content: center;
}

.header-text-container {
position: absolute;
top: 50%;
left: 50%;
transform:translate(-50%, -50%);
}

.header-text-greeting {
font-size: 50px;
font-weight: bold;
}

.header-text-centered {
font-weight: 100;
font-size: 28px;
}

.header-text-bottom-right {
position: absolute;
bottom: 5px;
right: 5px;
font-size: 8px;
color: rgb(112, 112, 112);
}

.image-container {
width: 100vw;
}

@media only screen and (max-width: 700px) {

.header-text-greeting {
font-size: 45px;
}

.header-text-container {
width: 100%;
}
}

@media only screen and (max-width: 500px) {

.header-text-greeting {
font-size: 55px;
}

.header-text-container {
width: 100%;
}

.header-text-centered {
font-size: 25px;
}
}
</style>
Binary file added Exercise-1/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 131 additions & 0 deletions Exercise-1/src/components/card-list-component.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<template>
<div class="list-container">
<template v-for="(imageData, index) in imageDataList" :key="index">
<div class="responsive">
<div class="image-content">
<img src="https://via.placeholder.com/400x300" width="600" height="400">
<p class="image-content-text">Powered by HTML.COM</p>
</div>
<p class="desc">{{imageData.description}}
</p>
<button>READ MORE</button>
</div>
</template>
</div>
</template>

<script>
export default {
data(){
return{
imageDataList:[
{
description: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad menim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.`
},
{
description: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.`
},
{
description: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad menim veniam, quis nostrud exercitation
ullamco.`
}
]
}
},
name: 'cardListComponent',
props: {
msg: String
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
img {
width: 100%;
height: auto;
padding: 1rem;
}

.image-content {
position: relative;
}

.image-content-text {
position: absolute;
bottom: 25px;
right: 20px;
font-size: 5px;
color: rgb(165, 165, 165);
}

.desc {
padding: 15px;
text-align: center;
height: 150px;
font-size: 15px;
padding-top: 0px;
}

* {
box-sizing: border-box;
}

.responsive {
float: left;
width: 30%;
border: 1px solid rgb(223, 223, 223);
border-radius: 5px;
margin: 20px;
padding-bottom: 10px;
font-size: 20px;
}

.list-container {
margin: 1rem;
display: flex;
justify-content: center;
margin-left: 200px;
margin-right: 200px;
}

@media only screen and (max-width: 700px) {
.responsive {
width: 49.99999%;
margin: 6px 0;
}

.list-container {
margin: 2rem;
display: block;
}

.desc {
height: unset;
}
}

@media only screen and (max-width: 500px) {
.responsive {
width: 100%;
}

.list-container {
margin: 1rem;
display: block;
}

.desc {
height: unset;
font-size: 18px;
}

.image-content-text {
font-size: 8px;
}
}
</style>
7 changes: 7 additions & 0 deletions Exercise-1/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'

import Antd from "ant-design-vue";

const app = createApp(App);
app.use(Antd).mount("#app");
5 changes: 5 additions & 0 deletions Exercise-2/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
19 changes: 19 additions & 0 deletions Exercise-2/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
Loading