Skip to content
Snippets Groups Projects
Commit 276e4fc8 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

re meta#255 la til demo for "månedens ord"

parent baf17bf7
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,16 @@ ...@@ -25,6 +25,16 @@
<Article :key="article_key" :article="article" @article-click="article_link_click" /> <Article :key="article_key" :article="article" @article-click="article_link_click" />
</div> </div>
<div class="welcome" v-show="! (article.error || article.lemmas.length || search_results.length || waiting)"> <div class="welcome" v-show="! (article.error || article.lemmas.length || search_results.length || waiting)">
<div class="monthly">
<h2>Månedens ord</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<div id="word-of-month-bm">
<Article :article="monthly_bm" @article-click="article_link_click" />
</div>
<div id="word-of-month-nn">
<Article :article="monthly_nn" @article-click="article_link_click" />
</div>
</div>
</div> </div>
</main> </main>
<footer> <footer>
...@@ -129,7 +139,9 @@ export default { ...@@ -129,7 +139,9 @@ export default {
lang: 'bob,nob', lang: 'bob,nob',
waiting_for_articles: true, waiting_for_articles: true,
waiting_for_metadata: true, waiting_for_metadata: true,
article: {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}} article: {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}},
monthly_bm: {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}},
monthly_nn: {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}}
} }
}, },
computed: { computed: {
...@@ -204,6 +216,15 @@ export default { ...@@ -204,6 +216,15 @@ export default {
self.waiting_for_articles = false self.waiting_for_articles = false
history.replaceState({article: self.article, search_results: self.search_results, lang: self.lang}, '') history.replaceState({article: self.article, search_results: self.search_results, lang: self.lang}, '')
} }
// words of the month
axios.get(api_endpoint + '/bob/article/5607').then(function(response){
self.monthly_bm = Object.assign(response.data, {dictionary: 'bob'})
})
axios.get(api_endpoint + '/nob/article/78569').then(function(response){
self.monthly_nn = Object.assign(response.data, {dictionary: 'nob'})
})
}) })
}, },
watch: { watch: {
...@@ -290,7 +311,7 @@ header, #search_results, #spinner, #single_article_container, footer, div.welcom ...@@ -290,7 +311,7 @@ header, #search_results, #spinner, #single_article_container, footer, div.welcom
} }
#spinner { #spinner {
padding-top: 40px; padding-top: 40px;
} }
header { header {
...@@ -299,8 +320,36 @@ header { ...@@ -299,8 +320,36 @@ header {
background-color: #560027; background-color: #560027;
} }
div.welcome { div.monthly {
font-size: 20px; padding: 20px;
border-radius: 10px;
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: auto auto auto;
gap: 10px;
width: 100%;
background-color: rgba(256,256,256,0.5)
}
div.monthly > h2{
padding: 0px;
grid-row: 1;
grid-column: 1 / 3;
}
div.monthly > p {
grid-row: 2;
grid-column: 1 / 3;
}
div#monthly_bm {
grid-row: 3;
grid-column: 1;
}
div#monthly_nn {
grid-row: 3;
grid-column: 2;
} }
.top { .top {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment