556 lines
21 KiB
HTML
556 lines
21 KiB
HTML
<html lang="en">
|
||
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>RanchiMall Times</title>
|
||
<script src="https://use.fontawesome.com/41cc35d596.js"></script>
|
||
<link
|
||
href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,900;1,400;1,700;1,900&family=Poppins:wght@400;500;600;700&display=swap"
|
||
rel="stylesheet">
|
||
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||
<style>
|
||
* {
|
||
padding: 0;
|
||
margin: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.hide {
|
||
display: none;
|
||
}
|
||
|
||
body {
|
||
font-family: 'lora', serif;
|
||
font-size: 16px;
|
||
color: #2f2f2f;
|
||
background-color: #f9f7f1;
|
||
}
|
||
|
||
header {
|
||
font-family: 'Playfair Display', serif;
|
||
font-weight: 900;
|
||
width: 100%;
|
||
text-align: center;
|
||
font-size: 4rem;
|
||
text-transform: uppercase;
|
||
padding: 1rem 0;
|
||
letter-spacing: 6;
|
||
}
|
||
|
||
p {
|
||
margin: 1.2rem 0;
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 8;
|
||
-webkit-box-orient: vertical;
|
||
overflow: hidden;
|
||
}
|
||
|
||
p:not(:first-of-type)::first-letter {
|
||
margin-left: 4rem;
|
||
}
|
||
|
||
#homepage{
|
||
display: grid;
|
||
}
|
||
|
||
.head {
|
||
display: flex;
|
||
flex-direction: column;
|
||
text-align: center;
|
||
justify-content: center;
|
||
position: relative;
|
||
margin-bottom: 1rem;
|
||
}
|
||
|
||
.subhead {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
text-transform: uppercase;
|
||
padding: 0.6rem 0;
|
||
}
|
||
|
||
.subhead::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: 0;
|
||
width: 10%;
|
||
height: 0.1rem;
|
||
background: #2f2f2f;
|
||
}
|
||
|
||
.columns {
|
||
padding-top: 2rem;
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr));
|
||
}
|
||
|
||
.column {
|
||
font-size: 1.2rem;
|
||
line-height: 1.8;
|
||
display: flex;
|
||
flex-direction: column;
|
||
padding: 0 1.5rem;
|
||
vertical-align: top;
|
||
margin-bottom: 4rem;
|
||
}
|
||
|
||
.column .headline {
|
||
text-align: center;
|
||
line-height: normal;
|
||
font-family: 'lora', serif;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .headline.hl1 {
|
||
font-weight: 700;
|
||
font-size: 30px;
|
||
text-transform: uppercase;
|
||
padding: 0.8rem 0;
|
||
|
||
}
|
||
|
||
.column .headline.hl2 {
|
||
font-weight: 400;
|
||
font-size: 24px;
|
||
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl2:before {
|
||
border-top: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 7px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .headline.hl2:after {
|
||
border-bottom: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 13px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
|
||
}
|
||
|
||
.column .headline.hl3 {
|
||
font-weight: 400;
|
||
font-size: 36px;
|
||
padding: 0.8rem 0;
|
||
font-style: italic;
|
||
font-family: 'Playfair Display', serif;
|
||
}
|
||
|
||
.column .headline.hl4 {
|
||
font-weight: 500;
|
||
font-size: 0.9rem;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl4:before {
|
||
border-top: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 7px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .headline.hl4:after {
|
||
border-bottom: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 10px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
|
||
}
|
||
|
||
.column .headline.hl5 {
|
||
font-weight: 400;
|
||
font-size: 42px;
|
||
text-transform: uppercase;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl6 {
|
||
font-weight: 400;
|
||
font-size: 18px;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl6:before {
|
||
border-top: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 7px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .headline.hl6:after {
|
||
border-bottom: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 10px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .headline.hl7 {
|
||
font-weight: 700;
|
||
font-size: 0.9rem;
|
||
display: block;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl8 {
|
||
font-weight: 700;
|
||
font-size: 0.9rem;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl9 {
|
||
font-weight: 700;
|
||
font-size: 0.9rem;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .headline.hl10 {
|
||
font-weight: 700;
|
||
font-size: 0.9rem;
|
||
padding: 0.8rem 0;
|
||
}
|
||
|
||
.column .citation {
|
||
font-family: 'Playfair Display', serif;
|
||
font-size: 36px;
|
||
line-height: 44px;
|
||
/*font-style: italic;*/
|
||
text-align: center;
|
||
font-weight: 400;
|
||
display: block;
|
||
margin: 40px 0 40px 0;
|
||
font-feature-settings: "liga", "dlig";
|
||
}
|
||
|
||
.column .citation:before {
|
||
border-top: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 16px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .citation:after {
|
||
border-bottom: 1px solid #2f2f2f;
|
||
content: '';
|
||
width: 100px;
|
||
height: 16px;
|
||
display: block;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
.column .figure {
|
||
margin: 0 0 20px;
|
||
}
|
||
|
||
.column .figcaption {
|
||
font-style: italic;
|
||
font-size: 0.9rem;
|
||
}
|
||
|
||
.media {
|
||
-webkit-filter: sepia(80%) contrast(1) opacity(0.8);
|
||
filter: sepia(80%) grayscale(1) contrast(1) opacity(0.8);
|
||
mix-blend-mode: multiply;
|
||
width: 100%;
|
||
}
|
||
|
||
:any-link {
|
||
text-decoration: none;
|
||
color: #DC143C;
|
||
cursor: pointer;
|
||
}
|
||
|
||
/*________________________________________________________________________________________________________________________________*/
|
||
/*MEDIAQUERIES*/
|
||
|
||
@media all and (max-width: 640px) {
|
||
header {
|
||
font-size: 2.5rem;
|
||
}
|
||
}
|
||
|
||
@media all and (min-width: 640px) {
|
||
.columns {
|
||
margin: 0 2vw;
|
||
}
|
||
}
|
||
|
||
@media all and (min-width: 1920px) {
|
||
.columns {
|
||
margin: 0 4vw;
|
||
}
|
||
}
|
||
</style>
|
||
</head>
|
||
|
||
<script>
|
||
// helper functions
|
||
(async () => {
|
||
let repourl = "https://api.github.com/repos/ranchimall/articles/contents"
|
||
let repocontent = null
|
||
window.articles = {}
|
||
window.parsedarticles = {}
|
||
|
||
repocontent = await (await fetch(repourl)).json();
|
||
|
||
for (let i = 0; i < repocontent.length; i++) {
|
||
articlehtml = await (await fetch(repocontent[i]["download_url"])).text()
|
||
if (repocontent[i]['name'].slice(-5, repocontent[i]['name'].length) == '.html' && repocontent[i][
|
||
'name'
|
||
].slice(0, -5) != 'index') {
|
||
articles[repocontent[i]['name'].slice(0, repocontent[i]['name'].length - 5)] = articlehtml
|
||
}
|
||
}
|
||
|
||
parseArticles(articles)
|
||
renderColumns(parsedarticles)
|
||
})();
|
||
|
||
function parseArticles(articles) {
|
||
let totalarticles = Object.keys(articles).length
|
||
articlekeys = Object.keys(articles)
|
||
let domparser = new DOMParser();
|
||
|
||
|
||
for (let i = 0; i < totalarticles; i++) {
|
||
|
||
let currentarticle = {}
|
||
|
||
let articlehtml = articles[articlekeys[i]]
|
||
let parsedhtml = domparser.parseFromString(articlehtml, 'text/html')
|
||
|
||
currentarticle['title'] = parsedhtml.getElementById('title').innerText
|
||
currentarticle['subtitle'] = parsedhtml.getElementById('subtitle').innerText
|
||
currentarticle['sections'] = {}
|
||
|
||
totalsections = parsedhtml.getElementById('sectionmaster').childElementCount
|
||
|
||
for (let j = 0; j < totalsections; j++) {
|
||
tempobj = {}
|
||
asection = parsedhtml.getElementById(`section${j + 1}`)
|
||
sectiontitle = asection.children[0].children[0].innerText
|
||
sectionpara1 = asection.children[1].innerText
|
||
tempobj['title'] = sectiontitle
|
||
tempobj['paragraph'] = sectionpara1
|
||
currentarticle['sections'][j] = tempobj
|
||
}
|
||
|
||
parsedarticles[articlekeys[i]] = currentarticle
|
||
}
|
||
}
|
||
|
||
function renderColumns(parsedarticles) {
|
||
|
||
numberOfColumns = Object.keys(parsedarticles).length
|
||
let columns = document.getElementById('columnsmain')
|
||
let parsedArticlesKeys = Object.keys(parsedarticles)
|
||
|
||
for (let i = 0; i < parsedArticlesKeys.length; i++) {
|
||
columnhtml = `<div class="column" id="column${i+1}" data-articlekey="${parsedArticlesKeys[i]}">
|
||
<div class="head">
|
||
<span class="headline hl3">${parsedarticles[parsedArticlesKeys[i]].title}</span>
|
||
<p><span class="headline hl4">${parsedarticles[parsedArticlesKeys[i]].subtitle}</span></p>
|
||
</div>
|
||
<p>${parsedarticles[parsedArticlesKeys[i]].sections[0].paragraph}</p>
|
||
<a href='./${parsedArticlesKeys[i]}.html'>Read article <i class="fa fa-angle-double-right" aria-hidden="true"></i></a>
|
||
|
||
</div>`
|
||
//columns.append(columnhtml)
|
||
columns.innerHTML += columnhtml
|
||
|
||
}
|
||
}
|
||
|
||
function switchtoArticle(element) {
|
||
document.getElementById("homepage").classList.add('hide')
|
||
document.getElementById("displaypage").innerHTML = articles[element.dataset.articlekey]
|
||
document.getElementById("display_page_main").classList.remove('hide')
|
||
}
|
||
</script>
|
||
|
||
<body translate="no">
|
||
<div id='homepage'>
|
||
<title>Newspaper Style Design Experiment</title>
|
||
<meta name="viewport" content="width=device-width">
|
||
<div class="head">
|
||
<div class="headerobjectswrapper">
|
||
<header>RanchiMall Times</header>
|
||
</div>
|
||
<div class="subhead">Thursday April 30, 2020</div>
|
||
</div>
|
||
<div class="content">
|
||
<div class="columns" id='columnsmain'>
|
||
<!--
|
||
<div class="column" id="column1">
|
||
<div class="head"><span class="headline hl3">When darkness overspreads my eyes</span>
|
||
<p><span class="headline hl4">by JOHANN WOLFGANG VON GOETHE</span></p>
|
||
</div>
|
||
When, while the lovely valley teems with vapour around me, and the meridian sun strikes the upper
|
||
surface of the impenetrable foliage of my trees, and but a few stray gleams steal into the inner
|
||
sanctuary, I throw myself down among the tall grass by the trickling stream;
|
||
<p>and, as I lie close
|
||
to
|
||
the earth, a thousand unknown plants are noticed by me: when I hear the buzz of the little world
|
||
among the stalks, and grow familiar with the countless indescribable forms of the insects and
|
||
flies,
|
||
then I feel the presence of the Almighty, who formed us in his own image, and the breath of that
|
||
universal love which bears and sustains us, as it floats around us in an eternity of bliss; and
|
||
then, my friend, when darkness overspreads my eyes, and heaven and earth seem to dwell in my
|
||
soul
|
||
and absorb its power, like the form of a beloved mistress, then I often think with longing, Oh,
|
||
would I could describe these conceptions, could impress upon paper all that is living so full
|
||
and
|
||
warm within me, that it might be the mirror of my soul, as my soul is the mirror of the infinite
|
||
God!</p>
|
||
</div>
|
||
<div class="column" id="column2">
|
||
<div class="head"><span class="headline hl5">Give people courage</span>
|
||
<p><span class="headline hl6">The crowd seemed to grow</span></p>
|
||
</div>
|
||
The sunset faded to twilight before anything further happened. The crowd far away on the left,
|
||
towards
|
||
Woking, seemed to grow, and I heard now a faint murmur from it. The little knot of people towards
|
||
Chobham dispersed. There was scarcely an intimation of movement from the pit.<p></p>
|
||
<figure class="figure">
|
||
<img class="media" src="https://i.giphy.com/PW7MoTD2d9pJK.gif" alt="">
|
||
<figcaption class="figcaption">Hermine hoping for courage.</figcaption>
|
||
</figure>
|
||
<p>It was this, as much as anything, that gave people courage, and I suppose the new arrivals from
|
||
Woking also helped to restore confidence. At any rate, as the dusk came on a slow, intermittent
|
||
movement upon the sand pits began, a movement that seemed to gather force as the stillness of
|
||
the
|
||
evening about the cylinder remained unbroken. Vertical black figures in twos and threes would
|
||
advance, stop, watch, and advance again, spreading out as they did so in a thin irregular
|
||
crescent
|
||
that promised to enclose the pit in its attenuated horns. I, too, on my side began to move
|
||
towards
|
||
the pit.</p>
|
||
<p>Then I saw some cabmen and others had walked boldly into the sand pits, and heard the clatter of
|
||
hoofs and the gride of wheels. I saw a lad trundling off the barrow of apples. And then, within
|
||
thirty yards of the pit, advancing from the direction of Horsell, I noted a little black knot of
|
||
men, the foremost of whom was waving a white flag.</p>
|
||
</div>
|
||
<div class="column" id="column3">
|
||
<div class="head"><span class="headline hl1">May the Force be with you</span>
|
||
<p><span class="headline hl2">Let go your conscious self and act on instinct</span></p>
|
||
</div>Partially, but it also obeys your commands. Hey, Luke! May the Force be with you. I have
|
||
traced
|
||
the Rebel spies to her. Now she is my only link to finding their secret base.<p></p>
|
||
<figure class="figure">
|
||
<img class="media" src="https://i.giphy.com/4fDWVPMoSyhgc.gif" alt="">
|
||
<figcaption class="figcaption">"This time, let go your conscious self and act on instinct."
|
||
</figcaption>
|
||
</figure>
|
||
<p>Leave that to me. Send a distress signal, and inform the Senate that all on board were killed.
|
||
<span class="citation">"Don't underestimate the Force. I suggest you try it again,
|
||
Luke."</span> This
|
||
time, let go your conscious self and act on instinct. In my experience, there is no such thing
|
||
as
|
||
luck. You're all clear, kid. Let's blow this thing and go home!</p>
|
||
<p>You don't believe in the Force, do you? Partially, but it also obeys your commands. The plans you
|
||
refer to will soon be back in our hands. As you wish.</p>
|
||
</div>
|
||
<div class="column" id="column4">
|
||
<div class="head"><span class="headline hl3">The buzz of the little world </span>
|
||
<p><span class="headline hl4">A thousand unknown plants</span></p>
|
||
</div>
|
||
<p>I should be incapable of drawing a single stroke at the present moment; and yet I feel that I
|
||
never
|
||
was a greater artist than now. When, while the lovely valley teems with vapour around me, and
|
||
the
|
||
meridian sun strikes the upper surface of the impenetrable foliage of my trees, and but a few
|
||
stray
|
||
gleams steal into the inner sanctuary, I throw myself down among the tall grass by the trickling
|
||
stream; and, as I lie close to the earth, a thousand unknown plants are noticed by me: when I
|
||
hear
|
||
the buzz of the little world among the stalks, and grow familiar with the countless
|
||
indescribable
|
||
forms of the insects and flies, then I feel the presence of the Almighty, who formed us in his
|
||
own
|
||
image, and the breath</p>
|
||
</div>
|
||
<div class="column" id="column5">
|
||
<div class="head"><span class="headline hl1">It wasn't a dream </span>
|
||
<p><span class="headline hl4">by FRANZ KAFKA</span></p>
|
||
</div>
|
||
<p>One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed
|
||
into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he
|
||
could
|
||
see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was
|
||
hardly able to cover it and seemed ready to slide off any moment. </p>
|
||
<p>His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly
|
||
as he
|
||
looked. "What's happened to me?" he thought. It wasn't a dream. His room, a proper human room
|
||
although a little too small, lay peacefully between its four familiar walls. A collection of
|
||
textile
|
||
samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung
|
||
a
|
||
picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded
|
||
frame.
|
||
It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff
|
||
that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the
|
||
window at the dull weather. </p>
|
||
</div>
|
||
-->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="display_page_main" class="hide">
|
||
<div id="go_back" style="color:#DC143C">
|
||
<i class="fa fa-angle-double-left" aria-hidden="true" style="color:#DC143C"></i>
|
||
Go Back
|
||
</div>
|
||
<div id="displaypage">
|
||
|
||
</div>
|
||
<div id="go_back_bottom" style="color:#DC143C">
|
||
<i class="fa fa-angle-double-left" aria-hidden="true" style="color:#DC143C"></i>
|
||
Go Back
|
||
</div>
|
||
</div>
|
||
</body>
|
||
|
||
<script>
|
||
let homepage = document.getElementById("homepage");
|
||
document.getElementById("go_back").addEventListener("click", function () {
|
||
console.log("Registered a click")
|
||
if (homepage.classList.contains('hide')) {
|
||
homepage.classList.remove('hide')
|
||
document.getElementById("display_page_main").classList.add('hide')
|
||
} else {
|
||
|
||
}
|
||
});
|
||
|
||
document.getElementById("go_back_bottom").addEventListener("click", function () {
|
||
console.log("Registered a click")
|
||
if (homepage.classList.contains('hide')) {
|
||
homepage.classList.remove('hide')
|
||
document.getElementById("display_page_main").classList.add('hide')
|
||
} else {
|
||
|
||
}
|
||
});
|
||
</script>
|
||
|
||
</html> |