| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <!DOCTYPE html>
- <html lang="<%= lang %>">
- <head>
- <%- include('common-meta') %>
- <link rel="alternate" href="https://art.pcoloring.com/en/<%= uri.substring(3) %>" hrefLang="en" />
- <link rel="alternate" href="https://art.pcoloring.com/zh/<%= uri.substring(3) %>" hrefLang="zh" />
- <link rel="alternate" href="https://art.pcoloring.com/es/<%= uri.substring(3) %>" hrefLang="es" />
- <link rel="alternate" href="https://art.pcoloring.com/pt/<%= uri.substring(3) %>" hrefLang="pt" />
- <link rel="alternate" href="https://art.pcoloring.com/ja/<%= uri.substring(3) %>" hrefLang="ja" />
- <link rel="stylesheet" href="/stylesheets/styles.css">
- <link rel="stylesheet" href="/stylesheets/header.css">
- <link rel="stylesheet" href="/stylesheets/detail.css">
- </head>
- <!-- Google tag (gtag.js) -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag() { dataLayer.push(arguments); }
- gtag('js', new Date());
- gtag('config', 'G-JBGGVGLHTP');
- </script>
- <body>
- <%- include('header') %>
- <div class="details">
- <div class="poster"><img src="<%= detail.thumb %>" alt="<%= detail.title %>"></div>
- <div class="description">
- <div style="font-size: 30px; font-weight: 700;">
- <%= detail.title %>
- </div>
- <p>
- <%= translate.designer[lang] %>: <a href="/<%= lang %>/designer/<%= detail.user._id %>"
- class="tag-button">
- <%= detail.user.username %>
- </a>
- </p>
- <p>
- <%= translate.publishTime[lang] %>: <%= detail.publishTime %>
- </p>
- <p>
- <%= translate.tag[lang] %>:
- <% detail.tags.forEach(tag=> { %>
- <a href="/<%= lang %>/tag/<%= tag %>" class="tag-button">
- <%= tag %>
- </a>
- <% }); %>
- </p>
- <div>
- <%= detail.desc %>
- </div>
- <div class="button-wrapper">
- <a href="/play/<%= detail._id %>" class="play-button">
- <%= translate.play[lang] %>
- </a>
- <a id="downloadBtn" class="play-button" style="background-color: lightseagreen;">
- <%= translate.download[lang] %>
- </a>
- </div>
- </div>
- </div>
- <p style=" display: flex; justify-content: center; color: #777; font-size: 18px; font-weight: 500;">
- <%= translate.mayYouLike[lang] %>:
- </p>
- <div class="content" style="margin-bottom: 40px;">
- <div class="image-grid">
- <% relates.forEach(item=> { %>
- <a href="<%= item.uri %>"><img src="<%= item.thumb %>"
- alt="<%= item.title %> | <%= translate.printableColoringPage[lang]%>"></a>
- <% }); %>
- </div>
- </div>
- <%- include('pagination') %>
- <script>
- // document.getElementById('downloadBtn').addEventListener('click', function () {
- // var link = document.createElement('a');
- // link.style.display = 'none';
- // link.href = '<%= detail.downlink %>';
- // link.download = '<%= detail._id %>.jpeg';
- // document.body.appendChild(link);
- // link.click();
- // document.body.removeChild(link);
- // });
- document.getElementById('downloadBtn').addEventListener('click', function () {
- const imageUrl = '<%= detail.downlink %>';
- fetch(imageUrl)
- .then(response => {
- if (!response.ok) {
- throw new Error('Network response was not ok');
- }
- return response.blob();
- })
- .then(blob => {
- const url = URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.style.display = 'none';
- a.href = url;
- a.download = '<%= detail._id %>.jpeg';
- document.body.appendChild(a);
- a.click();
- URL.revokeObjectURL(url);
- document.body.removeChild(a);
- })
- .catch(error => {
- console.error('Image Download Error:', error);
- });
- });
- </script>
- </body>
- </html>
|