Commit ca2a0935 authored by Cliff Li's avatar Cliff Li
Browse files

Refactor less files

parent af95c01b
...@@ -17,6 +17,7 @@ import jobOfferList from './views/jobs/jobofferList'; ...@@ -17,6 +17,7 @@ import jobOfferList from './views/jobs/jobofferList';
import jobOfferDetails from './views/jobs/jobofferDetails'; import jobOfferDetails from './views/jobs/jobofferDetails';
import companyList from './views/companies/companyList'; import companyList from './views/companies/companyList';
import companyDetail from './views/companies/companyDetail'; import companyDetail from './views/companies/companyDetail';
import './views/styles/base.less';
m.route(document.body, '/', { m.route(document.body, '/', {
'/': { '/': {
......
import m from 'mithril'; import m from 'mithril';
import * as events from '../models/events'; import * as events from '../models/events';
import './styles/frontpage.less';
const date = `${new Date().toISOString().split('.')[0]}Z`; const date = `${new Date().toISOString().split('.')[0]}Z`;
const renderCards = item => m('div', { class: 'frontpage-card' }, item); const renderCards = item => m('div.frontpage-card', item);
const renderHotCards = (item, index) => { const renderHotCards = (item, index) => {
if (index === 0) return m('div', { class: 'hot-first-card' }, item); if (index === 0) return m('div.hot-first-card', item);
return m('div', { class: 'hot-card' }, item); return m('div.hot-card', item);
}; };
export default class Frontpage { export default class Frontpage {
...@@ -30,15 +29,11 @@ export default class Frontpage { ...@@ -30,15 +29,11 @@ export default class Frontpage {
this.jobs = ['google', 'less than google', 'abb', 'accenture']; this.jobs = ['google', 'less than google', 'abb', 'accenture'];
} }
static oninit() {
console.log('init');
}
view() { view() {
return m('div', { class: 'container' }, [ return m('div#frontpage-container', [
m('div', { class: 'hot-row' }, this.hot.map((item, index) => renderHotCards(item, index))), m('div.hot-row', this.hot.map((item, index) => renderHotCards(item, index))),
m('div', { class: 'frontpage-row' }, this.events.map(item => renderCards(item))), m('div.frontpage-row', this.events.map(item => renderCards(item))),
m('div', { class: 'frontpage-row' }, this.jobs.map(item => renderCards(item))), m('div.frontpage-row', this.jobs.map(item => renderCards(item))),
]); ]);
} }
} }
@import './frontpage.less';
div { div {
border: solid 1px black; border: solid 1px black;
} }
\ No newline at end of file
@import 'base'; #frontpage-container {
.hot-row {
div .hot-row { background-color: aqua;
background-color: aqua; }
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment