Skip to content

Commit

Permalink
fix stream page
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed May 21, 2024
1 parent a7cbebe commit 3dbe3e3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
8 changes: 5 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const randomLinks = require("./config/randomLinks.json");
const TempsDeFlorsService = require('./services/tempsDeFlors')
const TwitchService = require("./services/twitch");
const ScreenshotService = require("./services/screenshot");

const moment = require('moment')

mongoose.connect(config.database).then(() => {
const messenger = new Messenger()
Expand Down Expand Up @@ -59,7 +59,9 @@ mongoose.connect(config.database).then(() => {
res.render('pages/stream',{
screenshots: screenshots,
url: config.externalUrl,
channel: config.twitch.channels
channel: config.twitch.channels,
moment: moment,
title: channel.title
});
}
});
Expand Down Expand Up @@ -114,7 +116,7 @@ mongoose.connect(config.database).then(() => {

const listener = app.listen(process.env.PORT, ()=> {
console.log('Listening on port ', + listener.address().port)
app.get('/', (req, res) => res.redirect('/listado'))
app.get('/', (req, res) => res.redirect('/stream'))
})
})
})
Expand Down
File renamed without changes.
23 changes: 14 additions & 9 deletions views/pages/stream.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,38 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Stream - <%= channel %> - Galeria fotos</title>
<!-- OR -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lightgallery.min.css" integrity="sha512-F2E+YYE1gkt0T5TVajAslgDfTEUQKtlu4ralVq78ViNxhKXQLrgQLLie8u1tVdG2vWnB3ute4hcdbiBtvJQh0g==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/zoom/lg-zoom.min.js" integrity="sha512-BLW2Jrofiqm6m7JhkQDIh2olT0EBI58+hIL/AXWvo8gOXKmsNlU6myJyEkTy6rOAAZjn0032FRk8sl9RgXPYIQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lg-thumbnail.min.css" integrity="sha512-GRxDpj/bx6/I4y6h2LE5rbGaqRcbTu4dYhaTewlS8Nh9hm/akYprvOTZD7GR+FRCALiKfe8u1gjvWEEGEtoR6g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lightgallery-bundle.min.css" integrity="sha512-nUqPe0+ak577sKSMThGcKJauRI7ENhKC2FQAOOmdyCYSrUh0GnwLsZNYqwilpMmplN+3nO3zso8CWUgu33BDag==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
.capitalize {
text-transform: capitalize;
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/lightgallery.min.js" integrity="sha512-jEJ0OA9fwz5wUn6rVfGhAXiiCSGrjYCwtQRUwI/wRGEuWRZxrnxoeDoNc+Pnhx8qwKVHs2BRQrVR9RE6T4UHBg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/thumbnail/lg-thumbnail.min.js" integrity="sha512-VBbe8aA3uiK90EUKJnZ4iEs0lKXRhzaAXL8CIHWYReUwULzxkOSxlNixn41OLdX0R1KNP23/s76YPyeRhE6P+Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/zoom/lg-zoom.min.js" integrity="sha512-BLW2Jrofiqm6m7JhkQDIh2olT0EBI58+hIL/AXWvo8gOXKmsNlU6myJyEkTy6rOAAZjn0032FRk8sl9RgXPYIQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/hash/lg-hash.min.js" integrity="sha512-7c9ZgozFwxmWalyapzhmzAChRvi0p7vhxWdrE3OjvFHnxuw6h6DBSOvtO1XytEj8MQI2Jp0Tm2BJwLUU7zAMvA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<h3>Stream actual - <a href="https://twitch.tv/<%= channel %>" target="_blank"><%= channel %></a></h3>
<h4>Stream actual - <a href="https://twitch.tv/<%= channel %>" target="_blank"><%= channel %></a></h4>
<h5><p><em><%= title %></em></p></h5>
<div id="lightgallery">
<% screenshots.forEach(function(screenshot) { %>
<a href="<%= url + '/img/' + screenshot.name %>" data-sub-html="Captura de <%= screenshot.capturedBy %>" data-lg-size="1340-754" data-slide-name="<%= screenshot.name %>">
<a href="<%= url + '/img/' + screenshot.name %>" data-sub-html="<h4>Captura de - <%= screenshot.capturedBy %></h4> <p class='capitalize' > Fecha - <%= moment(screenshot.created).locale('es').format('LLLL') %></p>" data-lg-size="1340-754" data-slide-name="<%= screenshot.name %>">
<img src="<%= url + '/img/t_' + screenshot.name %>" alt="<%= screenshot.name %>" width="200" >
</a>
<% }); %>
</div>
<script type="text/javascript">
lightGallery(document.getElementById('lightgallery'), {
plugins: [lgThumbnail, lgHash],
animateThumb: false,
zoomFromOrigin: false,
plugins: [lgThumbnail, lgHash, lgZoom],
zoomFromOrigin: true,
thumbnail: true,
hash: true,
customSlideName: true,
galleryId: 1
galleryId: 1,
speed: 500
});
</script>
</body>
Expand Down

0 comments on commit 3dbe3e3

Please sign in to comment.