CSS + Début organisation index.html

This commit is contained in:
HORVILLE 2023-03-28 13:06:28 +02:00
parent f520bdb529
commit 4bcd136e75
9 changed files with 99 additions and 52 deletions

View File

@ -1,6 +1,6 @@
<line-graph> <line-graph>
<div style="height: inherit;"> <div style="height: inherit; width: inherit; padding: inherit; margin: inherit;">
<canvas style="height: 100%; width: 100%;"> <canvas style="height: 100%; width: 100%;">
</canvas> </canvas>
</div> </div>

View File

@ -1,16 +1,24 @@
<school-info style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"> <school-info>
<div style="position: absolute; top: 10%; left: 25%; width: 50%; height: 80%; background: #FFFFFF"> <div if={state.enabled} style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;">
<button onclick={closeWindow}></button> <div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF">
<button onclick={closeWindow}>X</button>
<p>
<h2></h2>
</p>
<line-graph style="height: 90px; margin: 10px;"></line-graph>
</div>
</div> </div>
<script> <script>
export default { export default {
onMounted() { onMounted() {
console.log("Test!") this.state.enabled = true
this.update()
}, },
closeWindow() { closeWindow() {
this.state.enabled = false
this.update()
} }
} }
</script> </script>

View File

@ -1,16 +1,21 @@
<search> <search>
<label> <div class="box p-1 m-2">
<input onkeydown={searchF} type="input" placeholder= {state.placeholder}> <div class="columns m-1">
<button onclick={back}><</button> <input onkeydown={searchF} class="input" type="input" placeholder={state.placeholder}>
<button class="button ml-1" onclick={back}>&lt;</button>
</div>
<div id="list-formations"> <div id="list-formations">
<ul> <ul>
<li each={item in this.state.items}> <li class="m-1" each={item in this.state.items}>
<span onclick={()=>filter(item.name)}>{item.name}</span> <button class="button is-fullwidth" onclick={()=>filter(item.name)}>
<span>{item.count}</span> <span><strong>{item.name}</strong></span>
<div style="margin-left: auto;"></div>
<span class="tag is-primary">{item.count}</span>
</button>
</li> </li>
</ul> </ul>
</div> </div>
</label> </div>
<script> <script>
import PAPI from '../javascript/parcoursup-link.js' import PAPI from '../javascript/parcoursup-link.js'

View File

@ -11,8 +11,16 @@
</head> </head>
<body> <body>
<div class="columns">
<div class="column is-one-third">
<search></search> <search></search>
<line-graph style="height: 90px;"></line-graph> </div>
<div class="column">
<school></school> <school></school>
</div>
</div>
<!--<school-info></school-info>-->
</body> </body>
</html> </html>

View File

@ -1,12 +0,0 @@
var school = {
css: null,
exports: {
onMounted() {
console.log("Test!");
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<main class="container"><div class="block control has-icons-left is-inline-block is-pulled-right"><input class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable"><thead><tr><th><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead></table></main>', []),
name: 'school'
};
export { school as default };

View File

@ -38,19 +38,19 @@ var lineGraph = {
this.colors = ["#003F5C", "#2F4B7C", "#665191", "#A05195", "#D45087"]; this.colors = ["#003F5C", "#2F4B7C", "#665191", "#A05195", "#D45087"];
this.state.data = [{ this.state.data = [{
name: "P", name: "P",
value: 100 value: 52
}, { }, {
name: "AB", name: "AB",
value: 200 value: 43
}, { }, {
name: "B", name: "B",
value: 150 value: 2
}, { }, {
name: "TB", name: "TB",
value: 50 value: 1
}, { }, {
name: "TBF", name: "TBF",
value: 50 value: 0
}]; }];
let canvas = this.$("canvas"); let canvas = this.$("canvas");
canvas.width = canvas.clientWidth; canvas.width = canvas.clientWidth;
@ -58,7 +58,7 @@ var lineGraph = {
this.updateCanvas(); this.updateCanvas();
} }
}, },
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div style="height: inherit;"><canvas style="height: 100%; width: 100%;"></canvas></div>', []), template: (template, expressionTypes, bindingTypes, getComponent) => template('<div style="height: inherit; width: inherit; padding: inherit; margin: inherit;"><canvas style="height: 100%; width: 100%;"></canvas></div>', []),
name: 'line-graph' name: 'line-graph'
}; };

View File

@ -2,10 +2,37 @@ var schoolInfo = {
css: null, css: null,
exports: { exports: {
onMounted() { onMounted() {
console.log("Test!"); this.state.enabled = true;
this.update();
},
closeWindow() {
this.state.enabled = false;
this.update();
} }
}, },
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div><div></div></div>', []), template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr33="expr33" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.state.enabled,
redundantAttribute: 'expr33',
selector: '[expr33]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr34="expr34">X</button><p><h2></h2></p><line-graph expr35="expr35" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr34',
selector: '[expr34]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
evaluate: _scope => _scope.closeWindow
}]
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr35',
selector: '[expr35]'
}])
}]),
name: 'school-info' name: 'school-info'
}; };

View File

@ -114,9 +114,9 @@ var search = {
} }
}; };
}, },
template: (template, expressionTypes, bindingTypes, getComponent) => template('<label><input expr0="expr0" type="input"/><button expr1="expr1"><</button><div id="list-formations"><ul><li expr2="expr2"></li></ul></div></label>', [{ template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr674="expr674" class="input" type="input"/><button expr675="expr675" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr676="expr676" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr0', redundantAttribute: 'expr674',
selector: '[expr0]', selector: '[expr674]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onkeydown', name: 'onkeydown',
@ -127,8 +127,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder evaluate: _scope => _scope.state.placeholder
}] }]
}, { }, {
redundantAttribute: 'expr1', redundantAttribute: 'expr675',
selector: '[expr1]', selector: '[expr675]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onclick', name: 'onclick',
@ -138,29 +138,33 @@ var search = {
type: bindingTypes.EACH, type: bindingTypes.EACH,
getKey: null, getKey: null,
condition: null, condition: null,
template: template('<span expr3="expr3"> </span><span expr4="expr4"> </span>', [{ template: template('<button expr677="expr677" class="button is-fullwidth"><span><strong expr678="expr678"> </strong></span><div style="margin-left: auto;"></div><span expr679="expr679" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr3', redundantAttribute: 'expr677',
selector: '[expr3]', selector: '[expr677]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}, {
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onclick', name: 'onclick',
evaluate: _scope => () => _scope.filter(_scope.item.name) evaluate: _scope => () => _scope.filter(_scope.item.name)
}] }]
}, { }, {
redundantAttribute: 'expr4', redundantAttribute: 'expr678',
selector: '[expr4]', selector: '[expr678]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
redundantAttribute: 'expr679',
selector: '[expr679]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.item.count evaluate: _scope => _scope.item.count
}] }]
}]), }]),
redundantAttribute: 'expr2', redundantAttribute: 'expr676',
selector: '[expr2]', selector: '[expr676]',
itemName: 'item', itemName: 'item',
indexName: null, indexName: null,
evaluate: _scope => _scope.state.items evaluate: _scope => _scope.state.items

View File

@ -0,0 +1,7 @@
body, html {
width: 100%;
height: 100%;
top: 0px;
left: 0px;
background-color: #EFEFEF;
}