diff --git a/carddeck1/cards.html b/carddeck1/cards.html index 83eaea3..ce3fac6 100644 --- a/carddeck1/cards.html +++ b/carddeck1/cards.html @@ -11,13 +11,20 @@
-

1.png

-

+

body

+

+

Some text of this card

-

1.png

-

+

panopticon

+

+

The panopticon is a design of institutional building with an inbuilt system of control!

+
+ +
+

+

2. Ilkyaz agini degerlendirmek ve beslemek Genç yazarlarla iletişim kurmak ve İlkyazi tanitmak,
davet etmek.Edebiyat ve sanat çevrelerini ortaklaştirmak adina fikir verme ve oluşturma.

diff --git a/carddeck1/cards.json b/carddeck1/cards.json index e3526b8..bc92a09 100644 --- a/carddeck1/cards.json +++ b/carddeck1/cards.json @@ -2,11 +2,16 @@ "cards" : [{ "name" : "body", "text" : "Some text of this card", - "image": "1.png" + "image": "1.jpg" }, { "name" : "panopticon", "text" : "The panopticon is a design of institutional building with an inbuilt system of control!", "image": "2.png" + }, + { + "name" : "", + "text" : "2. Ilkyaz agini degerlendirmek ve beslemek Genç yazarlarla iletişim kurmak ve İlkyazi tanitmak,
davet etmek.Edebiyat ve sanat çevrelerini ortaklaştirmak adina fikir verme ve oluşturma.", + "image": "" }] } \ No newline at end of file diff --git a/carddeck1/deck1.py b/carddeck1/deck1.py index c9e2cc6..07c9909 100644 --- a/carddeck1/deck1.py +++ b/carddeck1/deck1.py @@ -1,37 +1,37 @@ -import os +import os , json folder = "./images/" -#defining as a list -images = [] -titles = [] -#shows all the images -os.listdir(folder) -for image in os.listdir(folder): - print(image) - print(folder + image) - print("---") - images.append(folder + image) - titles.append(image) - +#load the json information +with open ("cards.json", "r") as collage: + cards = json.load(collage) #html -counter = 0 + all_cards = "" -for image in images: +for card in cards["cards"]: + print(card) #html image element - img = f"" + img = f"" #img = "" - #define title - title = titles[counter] + title = card['name'] #printing to inspect print(img) #mini template for card - card = f""" + if card['image'] == "": + card = f""" +
+

{ title }

+

{ card['text'] }

+
+ """ + else: + card = f"""

{ title }

-

{ img }

+

{ img }

+

{ card['text'] }

""" #printing to inspect mini template @@ -41,7 +41,6 @@ for image in images: all_cards = all_cards + card #we add +1 to our counter -counter = counter + 1 html = f""" diff --git a/carddeck1/stylesheet.css b/carddeck1/stylesheet.css index b167782..fd1a0e4 100644 --- a/carddeck1/stylesheet.css +++ b/carddeck1/stylesheet.css @@ -9,7 +9,7 @@ margin: 2mm; position: relative; } -.card > p > img { +.card > p.image > img { width: 80mm; height: 80mm; position: absolute; @@ -22,3 +22,19 @@ left: 5mm; margin: 0; } +.card > p.text { + width: 80mm; + height: 20mm; + position: absolute; + top: 95mm; + left: 5mm; + text-align: center; + } + .card > p.textnoimage { + width: 80mm; + height: 20mm; + position: absolute; + top: 25mm; + left: 5mm; + text-align: center; + } \ No newline at end of file