-
Notifications
You must be signed in to change notification settings - Fork 0
/
newsCard.php
238 lines (195 loc) · 6.72 KB
/
newsCard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?php
/*
Template Name: News Card
Template Post Type: post, page
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo get_bloginfo('name'); ?></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-icons.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.1/html2canvas.min.js"></script>
<link href="https://fonts.maateen.me/kalpurush/font.css" rel="stylesheet">
<link href="https://fonts.maateen.me/solaiman-lipi/font.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html2canvas.min.js"></script>
<style>
body{
font-family: "My Custom Font", sans-serif;
/* color:#060606; */
background-color: red;
font-family: 'SolaimanLipi', Arial, sans-serif !important;
/* font-family: 'kalpurush', Arial, sans-serif !important; */
}
.english {
font-family: 'Courier New', Courier, monospace;
}
/* header area */
/* .header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
border-bottom: 1px solid #ccc;
.image-section {
flex: 1;
text-align: right;
}
.image-section img{
width: 100px;
height: 50px;
} */
/* promotional */
.promotional {
flex: 1;
text-align: left;
}
.promotional .tagline {
font-size: 14px;
font-weight: 600;
}
/* navigation area */
.nav-area{
margin-top: 10px;
text-align: center;
background-color: #F9F0E2;
display: flex;
justify-content: space-between;
}
.nav-area p{
padding: 2px;
font-weight: 600;
text-decoration: none;
font-size: 16px;
}
/* main article */
.news {
width: 1080px;
height: auto;
margin: 20px auto;
padding: 10px;
text-align: center;
}
.title {
font-size: 64px;
text-align: center;
font-weight: bolder; /* or 900 */
text-shadow: 0 1px 2px black;
}
.title h1{
color: #F42A40;
}
.image-wrapper {
float: right;
width: 40%;
height: auto;
shape-outside: url("");
margin: 10px;
}
.content {
overflow: hidden;
text-align: justify;
}
.print-area {
background: linear-gradient(180deg, #F0EFE3 50%, #006E4D 50%);
}
.content p{
font-size: 24px;
font-weight: 500;
}
.copyright {
text-align: center;
font-weight: bolder;
}
.copyright p{
font-size: 24px;
}
.offer{
font-size: 10px;
text-align: center;
color: red;
}
/* footer area */
.source{
font-weight: 600;
font-style: italic;
}
/* details button */
</style>
</head>
<body>
<div class="print-area" style="background-color: #F2EEE3;">
<div class="header" >
<!-- <div class="promotional">
<span class="tagline"><p id="banglaDateTime"></p></span>
</div> -->
<div style="text-align: center; background-color: #red; position: relative; ">
<img src="https://doiniksongbadchitro.com/wp-content/uploads/2023/08/WhatsApp_Image_2023-08-01_at_13.02.00-removebg-preview.png" width="600px" height="150px" ">
</div>
</div>
<div class="content-wrapper" style=" height: 50%; display: flex;">
<div class="news text-center" style="flex: 1; padding: 20px;">
<h1 class="title" style="color: red; font-size: 48px; font-weight: 900; text-align: center;"><?php the_title(); ?></h1>
<div class="content">
<div style="text-align: center; background-color: #red; ">
<img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="" height="auto">
<p style="border-radius: 50px; background-color: red; color: white; font-size: 26px; text-align: center; padding: 10px 20px; display: inline-block; cursor: pointer;">
<< বিস্তারিত লিংক কমেন্টে >>
</p>
</div>
</div>
</div>
</div>
</div>
<button id="screenshot-btn">^</button>
<script>
document.getElementById('screenshot-btn').addEventListener('click', function() {
html2canvas(document.body).then(function(canvas) {
// Create a temporary link
var link = document.createElement('a');
link.href = canvas.toDataURL();
link.download = 'সংবাদচিত্র_newsCutting_' + getCurrentTime() + '.png';
// Function to get current time as minutes and seconds
function getCurrentTime() {
var currentDate = new Date();
var minutes = currentDate.getMinutes().toString().padStart(2, '0');
var seconds = currentDate.getSeconds().toString().padStart(2, '0');
return minutes + ':' + seconds;
}
// Trigger the download
link.click();
});
});
// @@@@@@@@@@@BanglaDate@@@@@@@@@@@@@@
// Array of Bangla day names
const banglaDayNames = [
"রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার",
"বৃহস্পতিবার", "শুক্রবার", "শনিবার"
];
// Get the current date
const currentDate = new Date();
// Set the options for Bengali calendar
const options = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
calendar: 'beng',
numberingSystem: 'beng'
};
// Format the date in the Bengali calendar
const formatter = new Intl.DateTimeFormat('bn-BD', options);
const formattedDate = formatter.format(currentDate);
// Get the day index (0-6)
const dayIndex = currentDate.getDay();
// Get the corresponding Bangla day name
const banglaDayName = banglaDayNames[dayIndex];
// Display the Bangla day name and date
const banglaDateTimeElement = document.getElementById("banglaDateTime");
banglaDateTimeElement.textContent = formattedDate;
</script>
</body>
</html>