plxdcma_rendericon_noticia 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Captura de pantalla 2025-12-21 a la(s) 8.58.20/342/200/257p./302/240m..png +0 -0
- package/css.css +37 -0
- package/init.js +34 -0
- package/js.js +85 -0
- package/package.json +6 -0
|
Binary file
|
package/css.css
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.news-card.featured {
|
|
2
|
+
grid-row: span 1;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.news-card.featured .news-content h3 {
|
|
6
|
+
font-size: 1.25rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.news-card {
|
|
10
|
+
background: var(--white);
|
|
11
|
+
border-radius: 12px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
|
14
|
+
transition: transform 0.3s ease;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.news-card:hover {
|
|
20
|
+
transform: translateY(-5px);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.news-card.featured {
|
|
24
|
+
grid-column: span 2;
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: 1fr 1fr;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.news-image {
|
|
30
|
+
position: relative;
|
|
31
|
+
height: 200px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.news-card.featured .news-image {
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
package/init.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var plxdcma_standarinit=require(`plxdcma_standarinit`)
|
|
2
|
+
var fs=require(`fs`)
|
|
3
|
+
var path=require(`path`)
|
|
4
|
+
var myux=require(`plxdcma_myux`)
|
|
5
|
+
var plxdcma_iconrendererprotocol=require(`plxdcma_iconrendererprotocol`)
|
|
6
|
+
module.exports.use=function(req){
|
|
7
|
+
if(req.__myAppInternals.noticiaicon == null){
|
|
8
|
+
myux.use(req)
|
|
9
|
+
plxdcma_iconrendererprotocol.use(req)
|
|
10
|
+
req.__myAppInternals.noticiaicon=true
|
|
11
|
+
if(req.__myAppInternals.paths == null){
|
|
12
|
+
req.__myAppInternals.paths=[]
|
|
13
|
+
}
|
|
14
|
+
req.__myAppInternals.paths.push(`<script src="/myux/icons/noi_Icon.js"></script>`)
|
|
15
|
+
req.__myAppInternals.paths.push(`<link rel="stylesheet" href="/myux/icons/noi_Icon.css">`)
|
|
16
|
+
if(req.__myAppInternals.modals == null){
|
|
17
|
+
req.__myAppInternals.modals=[]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
plxdcma_standarinit.use(function(app){
|
|
22
|
+
app.get(`/myux/icons/noi_Icon.js`,function(req,res){
|
|
23
|
+
fs.readFile(path.join(__dirname,"js.js"),"utf8",function(err,html){
|
|
24
|
+
res.write(html)
|
|
25
|
+
res.end()
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
app.get(`/myux/icons/noi_Icon.css`,function(req,res){
|
|
29
|
+
fs.readFile(path.join(__dirname,"css.css"),"utf8",function(err,html){
|
|
30
|
+
res.write(html)
|
|
31
|
+
res.end()
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
})
|
package/js.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function noticiaCardAssignData(strct,target){
|
|
2
|
+
var resourceselected=strct.data
|
|
3
|
+
var tags=strct.tags
|
|
4
|
+
target.style.padding=0
|
|
5
|
+
|
|
6
|
+
var original=target.originalIcon
|
|
7
|
+
if(original == null){
|
|
8
|
+
original={}
|
|
9
|
+
target.originalIcon=original
|
|
10
|
+
}
|
|
11
|
+
var t = strct.tags ?? strct.icon;
|
|
12
|
+
for(var each in t){
|
|
13
|
+
original[each]=t[each]
|
|
14
|
+
}
|
|
15
|
+
var imagehtml =target.getElementsByClassName('daimage')
|
|
16
|
+
var newscategoryhtml =target.getElementsByClassName('news-category')
|
|
17
|
+
var titulohtml =target.getElementsByClassName('datitulo')
|
|
18
|
+
var fechahtml =target.getElementsByClassName('dafecha')
|
|
19
|
+
var autorhtml =target.getElementsByClassName('daautor')
|
|
20
|
+
var subtitlehtml =target.getElementsByClassName('dasubtitle')
|
|
21
|
+
var imagehtml =target.getElementsByClassName('daimage')
|
|
22
|
+
var mo=mediaObjectById(resourceselected.image)
|
|
23
|
+
titulohtml[0].innerHTML=resourceselected.titulo
|
|
24
|
+
subtitlehtml[0].innerHTML=resourceselected.resumen
|
|
25
|
+
if(mo != null){
|
|
26
|
+
imagehtml[0].src=`/images/${resourceselected.imageurl}m.png`
|
|
27
|
+
}
|
|
28
|
+
if(resourceselected.imageurl != null){
|
|
29
|
+
imagehtml[0].src=`/images/${resourceselected.imageurl}m.png`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
var nc=0
|
|
34
|
+
function noticiaiconcard(data,isediting,section){
|
|
35
|
+
|
|
36
|
+
if(isediting == true && data == null){
|
|
37
|
+
var tb=`<article class="news-card" onclick='didRequestToAddAnIcon(${section})' data-category="analysis">
|
|
38
|
+
|
|
39
|
+
<div class="news-content">
|
|
40
|
+
<i class='fa fa-plus'></i>
|
|
41
|
+
</div>
|
|
42
|
+
</article>`
|
|
43
|
+
return tb
|
|
44
|
+
}
|
|
45
|
+
var htmlid=`noticia_${nc}`
|
|
46
|
+
nc=nc+1
|
|
47
|
+
|
|
48
|
+
console.log(`noticiaiconcard data`)
|
|
49
|
+
console.log(data)
|
|
50
|
+
|
|
51
|
+
var daurl="/images/2.jpg?height=200&width=350&text=Análisis+Temporada+2025"
|
|
52
|
+
var titulo=""
|
|
53
|
+
var sub=""
|
|
54
|
+
var deletebtn=`<i onclick='removeThisIcon("${htmlid}")' class='fa fa-trash'></i>`
|
|
55
|
+
for(var each in Noticias){
|
|
56
|
+
var n=Noticias[each]
|
|
57
|
+
if(n.id == data.iconmedia){
|
|
58
|
+
daurl=`/images/${n.imageurl}m.png`
|
|
59
|
+
titulo=n.titulo
|
|
60
|
+
sub=n.resumen
|
|
61
|
+
break
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if(isediting == false){
|
|
65
|
+
deletebtn=``
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var tb=`<article id = "${htmlid}" onclick='didTapedNoticiaItem(${section},"${htmlid}")' class="news-card" data-category="analysis">
|
|
69
|
+
<div class="news-image">
|
|
70
|
+
<img cxtza='image' class='daimage' src="${daurl}" alt="Análisis Temporada 2025">
|
|
71
|
+
<div cxtza='tag' class="news-category">ANÁLISIS</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="news-content">
|
|
74
|
+
<h3 class='datitulo' cxtza='titulo'>${titulo}</h3>
|
|
75
|
+
<div class="news-meta">
|
|
76
|
+
<span><i class="fas fa-calendar"></i> <span class='dafecha' cxtza='fecha'>5 Enero 2025</span></span>
|
|
77
|
+
<span><i class="fas fa-user"></i> <span class='daautor' cxtza='autor'>Ana Rodríguez</span></span>
|
|
78
|
+
</div>
|
|
79
|
+
<p class='dasubtitle' cxtza='descripcion'>${sub}</p>
|
|
80
|
+
<a cxtza='href' href="noticiaDetalles.html" class="read-more">Leer más</a>
|
|
81
|
+
${deletebtn}
|
|
82
|
+
</div>
|
|
83
|
+
</article>`
|
|
84
|
+
return tb;
|
|
85
|
+
}
|