Skip to content

Commit

Permalink
Pensum V4 Beta
Browse files Browse the repository at this point in the history
Some optimizations
update unid prel sys again...
Other detais
Aparience update
More Resposive Desing
  • Loading branch information
jackestar committed Sep 18, 2023
1 parent 94bfc58 commit ba4fa4c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 47 deletions.
37 changes: 21 additions & 16 deletions Tools/Scripts/pensum.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ function materia(nombre,codigo,unid,semest,horas,prelacion = [0]) {
this.prelac = prelacion
}

let documento = ""
let documento = "",
bann = document.querySelector('section.bann'),
asideOpt = bann.querySelectorAll('section.bann>div');

let table = {
smain:document.querySelector('section.main'),
Expand Down Expand Up @@ -265,7 +267,7 @@ let table = {
'CJU-37314',
4,
6,[4,0,0],
[]),
72),
new materia(
'Defensa VI',
'DIN-31163',
Expand Down Expand Up @@ -417,7 +419,9 @@ let table = {
})
}
// Prel per Unids
} else if (this.unidCrdit >= e.prelac && this.MateriasSemestres[i-1].every(x=>this.Materias[x].Aprobed)) {

} else if (this.unidCrdit >= e.prelac && this.MateriasSemestres.every(y=>y.every(x=>this.Materias[x].semest >= i+1 || (this.Materias[x].semest < i+1 && this.Materias[x].Aprobed)))) {
// console.log(below())
if (e.Aprobed) aproach(this.unidCrdit - e.unid >= e.prelac)
else aproach(true)
}
Expand Down Expand Up @@ -498,15 +502,15 @@ let table = {
let totHors = 0
this.Materias[materia].horas.forEach(e=>totHors+=e)
if (totHors !=0 ) {
tempString+=`<h4>Horas <b> ${totHors} </b></h4><ul class='hours'>`
tempString+=`<h4>HORAS: <b> ${totHors} </b></h4><ul class='hours'>`
for (let i = 0; i < this.Materias[materia].horas[0]; i++) tempString += `<li class='t'>${i==0?this.Materias[materia].horas[0]+'T':''}</li>`
for (let i = 0; i < this.Materias[materia].horas[1]; i++) tempString += `<li class='p'>${i==0?this.Materias[materia].horas[1]+'P':''}</li>`
for (let i = 0; i < this.Materias[materia].horas[2]; i++) tempString += `<li class='l'>${i==0?this.Materias[materia].horas[2]+'L':''}</li>`
tempString+="</ul>"
}
let tempcop = '',temppre = ''
if (this.Materias[materia].prelac !=0) {
if (typeof(this.Materias[materia].prelac) == "number") temppre += `<i>Unidades de Credito ${this.Materias[materia].prelac}</i>`
if (typeof(this.Materias[materia].prelac) == "number") temppre += `<i>Unidades de Credito: ${this.Materias[materia].prelac}</i>`
else this.Materias[materia].prelac.forEach(e => {
let temp = "<li class='"
if (this.Materias[e[0]].avaible) {
Expand Down Expand Up @@ -552,45 +556,45 @@ let table = {
codigos.forEach((g,h)=>{
if (g != '' && e.includes(g)) this.Materias[h].Aprobed = true
})
} //else console.log(e[e.length-8],"Raspo!")
}
}
})
this.Generate()
document.querySelector('div.blk').classList.remove('look')
}
}

table.getData()
table.Generate()
let open = false;
let bann = document.querySelector('section.bann')
let asideOpt = bann.querySelectorAll('section.bann>div');
asideOpt.forEach(e=>{
e.querySelector('.icon').addEventListener('click',()=>{
bann.classList.add('lk')
if (open) {
bann.classList.remove('lk')
asideOpt.forEach(i => {
if (i!=e) i.classList.remove('look')
else e.classList.add('look')
});
} else {
bann.classList.add('lk')
open = true
e.classList.add('look')
this.querySelector('div.blk').classList.add('look')
// console.log(this,'Sel?')
document.querySelector('div.blk').classList.add('look')
}
})
})
let axit = () => {
let axit = (ulook = true) => {
asideOpt.forEach(e => {
bann.classList.remove('lk')
e.classList.remove('look')
});
document.querySelector('div.blk').classList.remove('look')
open =false
if (ulook) document.querySelector('div.blk').classList.remove('look')
open = false
}
,carga = (ev) => {
// Prevent default behavior (Prevent file from being opened)
ev.preventDefault();
document.querySelector('div.blk').classList.add('look')
let file

if (ev.dataTransfer.items) {
Expand All @@ -614,7 +618,7 @@ let axit = () => {
reader.addEventListener('load', e => {
documento = reader.result
evoke()
axit()
axit(false)

})
reader.readAsDataURL(file)
Expand Down Expand Up @@ -665,14 +669,15 @@ let axit = () => {
}

document.querySelector('input.file').addEventListener('change',ev =>{
document.querySelector('div.blk').classList.add('look')
let file = ev.target.files[0]
// console.log(file)
const reader = new FileReader()
const id = 'Record'
reader.addEventListener('load', e => {
documento = reader.result
evoke()
axit()
axit(false)

})
reader.readAsDataURL(file)
Expand Down
70 changes: 39 additions & 31 deletions Tools/Styles/stylesP.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ aside.content {
box-shadow: -.75em 0 0 #2c292d55;
z-index: 1000;
overflow: hidden;
font-size: 1.5em;
}
aside.content h3 {
text-align: center;
Expand All @@ -57,13 +58,14 @@ aside div i {
}
aside.content h4 {
font-variant: all-small-caps;
font-size: 1.5em;
/* font-size: 1.5em; */
padding: .5em;
background: var(--foreground);
border-radius: 10em;
margin:.3em
}
aside.content h4 b {
background: var(--colorDs);
padding:.2em;
border-radius: 100%;
padding:.1em;
}
aside.content div {
min-width: 50%;
Expand All @@ -88,6 +90,7 @@ aside.content ul.list li {
border-radius: 1em;
padding: 1%;
flex: 2;
max-width: 50vw;
background: var(--colorE);
}
aside.content ul.list>li i {
Expand Down Expand Up @@ -122,14 +125,14 @@ aside.content ul.hours {
width: 100%;
border-block:.2em solid var(--background) ;
list-style: none;
margin-bottom: 1em;
margin:1em 0;
}
aside.content ul.hours li {
width: 100%;
flex: 100% 1;
text-align: center;
font-weight: 800;

font-size: 1.25em;
}
aside.content ul.hours li.t {
background: var(--colorA);
Expand Down Expand Up @@ -225,44 +228,42 @@ article.scheme ul.locked:nth-of-type(4), article.scheme ul.locked.x {
}
section.bann {
right: 0;
position: fixed;
bottom: 0;
margin: .75em;
position: fixed;
margin: 1em;
z-index: 1001;
transition: .4s ease all;
display:flex;
flex-direction:row-reverse;
justify-content: center;
align-items:center;
/*! width: 100%; */
/*! height: 100%; */
}
section.bann.lk {
width: 100%;
height: 100%;
width: 98vw !important;;
height: 98vh !important;;
margin: 1vh 1vw;
align-items: center;
}
section.bann>div {
background: var(--foreground);
border-radius: 100em;
/* flex: 2 1%; */
margin: 0 1em;
border-radius: 100%;
flex: 2 auto;
margin: .75em;
width: 5em;
height: 5em;
overflow: hidden;
display: flex;
justify-content: center;
transition: .5s ease;
flex-direction: column;
align-self:end;
/* align-self:center; */
}
section.bann>div.look {
width: 90vw;
height: 90vh;
flex: 2 90vw;
width: 100%;
min-height: 75%;
height: auto;
flex: 2 100%;
border-radius: 1em;
transition: .5s ease;
margin: 2.5vh 2.5vw;
align-self: center;
margin: 0;
}
section.bann div.icon img {
width: 3em;
Expand Down Expand Up @@ -344,10 +345,16 @@ div.blk.look {
height: 75vh;
min-height: 75vh;
}
section.bann>div.look {
min-height: 50%;
}
aside i.back {
transform: rotate(90deg)
}
}
i.back {
background: var(--background);
font-size: 4em;
font-size: 3em;
font-weight: 800;
color: var(--foreground);
padding: .1em;
Expand All @@ -357,19 +364,20 @@ i.back {
clip-path: circle();
user-select: none;
cursor: pointer;
align-self: end;
align-self: center;
margin: 1em;
}
div.help .hcont {
margin: 1em;
margin-bottom: 2em;
align-items: end;
}
div.help article.scheme {
margin: 2em;
margin: 0 0em 0 2em;
background: var(--background);
border-radius: 1em;
flex-direction: column;
flex: 2;
min-height: 40vh;
}

div.help article.scheme ul.leyend {
Expand Down Expand Up @@ -398,11 +406,11 @@ div.help article.scheme h2 {
flex: 1 100%;
}

section.bann div.help div.icon {
section.bann div div.icon {
background: var(--foreground);
width: min-content;
padding: .85em;
border-radius: 100%
width: max-content;
padding: .85em;
border-radius: 100%;
}
section.bann div.pag>p {
color: var(--foreground);
Expand Down

0 comments on commit ba4fa4c

Please sign in to comment.