personalisation Tumblr affichage aléatoire

personalisation Tumblr affichage aléatoire - HTML/CSS - Programmation

Marsh Posté le 05-01-2014 à 21:23:37    

Bonjour,
 
Je me suis lancé dans la création d'un blog photo sous Tumblr. Je suis parti d'un thème existant (Inverse by xantheose) avec un scrolling horizontal infini. Je découvre petit à petit la structure du blog et le CSS (j'ai quelques bases en HTML).
J'ai réussi à faire quelques modifications (barre de menu en haut, taille des images, marges,..).  Voici l'adresse du blog : http://www.benoitd-photos.tumblr.com/  
 
Je rencontre deux problèmes :
1/ lorsque je clique sur une image à partir de la page d'accueil, celle-ci s'ouvre dans une nouvelle page (permalink). J'ai mis des balises max-height pour que l'image ne dépasse pas la fenêtre mais je n'arrive la faire fonctionner convenablement, soit elle dépasse, soit elle est trop petite. Comment faire pour que l'image s'adapte à la taille de la fenêtre sans avoir besoin d'utiliser les barres de défilement ?
 
2/ Je souhaiterais surtout que sur la page d'accueil et sur les pages de catégories, les images s'affichent dans un ordre aléatoire (peut-être faut-il modifier le script jquery mais là je suis perdu)
 
3/ J'aimerai de la même façon créer une "page" (au sens de Tumblr) avec une grille présentant mes photos dans une ordre aléatoire (pas nécessairement infini). Existe-til une fonction pour récupérer toutes les url des images du compte tumblr ?
 
 
Je colle ci-dessous le code du thème modifié
 
Merci d'avance pour vos conseils
 

Code :
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <!--
  4. Inverse by xantheose
  5. -->
  6. <html lang="en">
  7. <head>
  8. <meta name="if:Italic Title" content="1"/>
  9. <meta name="color:Background" content="#FFFFFF"/>
  10. <meta name="color:Title" content="#444444"/>
  11. <meta name="color:Borders" content="#DDDDDD"/>
  12. <meta name="color:Text" content="#444444"/>
  13. <meta name="color:Link" content="#444444"/>
  14. <meta name="color:Chat" content="#F5F5F5"/>
  15. <meta name="font:Body" content="Garamond"/>
  16. <meta name="text:Menu font size" content="15"/>
  17. <meta name="text:Title font size" content="25"/>
  18. <meta name="text:Post title font size" content="14"/>
  19. <meta name="text:Body font size" content="12"/>
  20. {block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
  21. <title>{block:SearchPage}Search results for "{SearchQuery}" - {/block:SearchPage}{block:PostSummary}
  22. {PostSummary} - {/block:PostSummary}{Title}</title>
  23. <style type="text/css">
  24. iframe#tumblr_controls{
  25. top: 1px !important;
  26. margin: 0 0 0 0;
  27. right: 6px !important;
  28. position: fixed !important;
  29. }
  30. body{
  31. margin: 0px;
  32. background-color: {color:Background};
  33. font-size: {text:Body font size}px;
  34. font-family: {font:Body};
  35. line-height: 16px;
  36. color: {color:Text};
  37. }
  38. a:link, a:active, a:visited{color: {color:Link}; text-decoration: none;}
  39. ::-webkit-scrollbar-thumb:vertical{
  40. background-color: {color:Borders};
  41. height: 100px;
  42. -webkit-border-radius: 3px;
  43. }
  44. ::-webkit-scrollbar-thumb:horizontal{
  45. background-color: {color:Borders};
  46. height: 10px;
  47. -webkit-border-radius: 3px;
  48. }
  49. ::-webkit-scrollbar{
  50. height: 10px;
  51. width: 8px;
  52. background-color: {color:Background};
  53. }
  54. div#content{
  55. {block:IndexPage}margin: 15% 0px 0px 20%;{/block:IndexPage}
  56. {block:PermalinkPage} width: 100%; margin-top:145px; margin-left:10%;text-align:center; align:center;padding: 20px;{/block:PermalinkPage}
  57. }
  58. div#side{
  59. text-align: center;
  60. background-color: white ;
  61. width: 100%;
  62. height: 100px;
  63. position: fixed;
  64. top: 0px;
  65. padding: 20px 20px 20px 20px;
  66. opacity: 0.9;
  67. filter: alpha(opacity = 90);
  68. z-index: ;1
  69. }
  70. div#sidebottom{
  71. text-align: right;
  72. background-color: white ;
  73. width: 90%;
  74. height: 30px;
  75. position: fixed;
  76. bottom: 0px;
  77. padding: 0px 0px 0px 0px;
  78. margin-bottom:5px;
  79. opacity: 0.9;
  80. filter: alpha(opacity = 90);
  81. z-index: ;1
  82. }
  83. /* {color:Background} */
  84. .title{
  85. font-size: {text:title font size}px;
  86. {block:IfItalicTitle}font-style: italic;{/block:IfItalicTitle}
  87. color: {color:Title};
  88. margin: 10px 0px 20px 0px;
  89. }
  90. .info{padding-bottom: 20px; border-bottom: 1px solid {color:Borders};}
  91. .majuscule {
  92. text-transform: uppercase;
  93. }
  94. a.nav{
  95. display: inline;
  96. color: {color:Title};
  97. text-transform: lowercase;
  98. margin-top: 5px;
  99. padding-bottom: 3px;
  100. margin-left: 10px;
  101. margin-right: 10px;
  102. border-bottom: 1px solid {color:Borders};
  103. }
  104. a.majuscule {
  105. text-transform: uppercase;
  106. }
  107. .page{
  108. display: block;
  109. font-family: Arial;
  110. margin-top: 145px;
  111. font-size: 10px;
  112. font-weight: bold;
  113. letter-spacing: 1px;
  114. }
  115. .caption{
  116.     font-family: Courier;
  117.     text-align: center;
  118.     }
  119. .entry {max-width: 1000px; min-width: 250px;{block:IndexPage}margin-right: 25px; height: 400px;{/block:IndexPage}}
  120. .entry img {{block:IndexPage}max-width: 1000px; max-height: 400px;  {/block:IndexPage}}
  121. .photo img {{block:IndexPage}max-width: 1000px; max-height: 450px {/block:IndexPage}}
  122. .entry img {{block:PermalinkPage}max-width: 100%; height:20%; max-height: 40%;  {/block:PermalinkPage}}
  123. .photo img {{block:PermalinkPage}max-width: 100%; height:20%; max-height: 40% ;{/block:PermalinkPage}}
  124. /*
  125. .wp-caption,
  126. .wp-caption-text {
  127. max-width: 97.5%;
  128. height: auto;
  129. width: auto9; /* ie8 */
  130. }*/
  131. blockquote{
  132. padding: 0px 0px 0px 5px;
  133. margin: 0px 0px 2px 1px;
  134. border-left: 2px solid {color:Borders};
  135. }
  136. .post_title{
  137. font-size: {text:Post title font size}px;
  138. color: {color:Post title};
  139. line-height: 20px;
  140. }
  141. div#chat li {padding: 4px; background-color: {color:Chat}; margin-top: 2px;}
  142. div#chat ul{
  143. list-style: none;
  144. padding: 0px;
  145. margin-top: 5px;
  146. margin-bottom: 10px;
  147. {block:IndexPage}width: 400px;{/block:IndexPage}
  148. {block:PermalinkPage}width: 500px;{/block:PermalinkPage}
  149. }
  150. .audio{
  151. background-color: #000000;
  152. height: 27px;
  153. {block:IndexPage}width: 400px;{/block:IndexPage}
  154. {block:PermalinkPage}width: 500px;{/block:PermalinkPage}
  155. }
  156. .permaborder{display: block; padding-top: 5px; border-bottom: 1px solid {color:Borders};}
  157. .permalink{
  158. display: block;
  159. margin-top: 50px;
  160. text-align: center;
  161. opacity: 1;
  162. filter: alpha(opacity = 0);
  163. -webkit-transition: 0.2s ease-in;
  164. -o-transition: 0.2s ease-in;
  165. transition: 0.2s ease-in;
  166. }
  167. .permalink a{background-color: {color:Background}; padding: 5px;}
  168. .entry:hover .permalink{
  169. opacity: 1;
  170. filter: alpha(opacity = 100);
  171. -webkit-transition: 0.2s ease-in;
  172. -o-transition: 0.2s ease-in;
  173. transition: 0.2s ease-in;
  174. }
  175. div#postnotes{width: 500px; {block:IndexPage}display:  none;{/block:IndexPage}}
  176. ol.notes{
  177. padding: 0px;
  178. margin: 25px 0px;
  179. list-style-type: none;
  180. border-bottom: solid 1px {color:Borders};
  181. }
  182. ol.notes li.note{border-top: solid 1px {color:Borders}; padding: 4px;}
  183. ol.notes li.note img.avatar{
  184. vertical-align: -4px;
  185. margin-right: 10px;
  186. width: 16px;
  187. height: 16px;
  188. }
  189. ol.notes li.note span.action{font-weight: normal;}
  190. ol.notes li.note .answer_content{font-weight: normal;}
  191. ol.notes li.note blockquote{
  192. padding: 0px 0px 0px 5px;
  193. margin: 0px 0px 2px 35px;
  194. border-left: 2px solid {color:Borders};
  195. }
  196. ol.notes li.note blockquote a{text-decoration: none; font-size:10px;}
  197. .navigation{display:none;}
  198. {CustomCSS}
  199. </style>
  200. <link rel="shortcut icon" href="{Favicon}">
  201. <link rel="alternate" type="application/rss+xml" title="RSS" href="{RSS}" />
  202. <meta name="viewport" content="width=820" />
  203. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
  204. <script type="text/javascript">
  205. $(document).ready(function() {
  206. $("body" ).css("display", "none" );
  207. $("body" ).fadeIn(800);
  208. $("a.transition" ).click(function(event){
  209. event.preventDefault();
  210. linkLocation = this.href;
  211. $("body" ).fadeOut(1000, redirectPage);
  212. });
  213. function redirectPage() {
  214. window.location = linkLocation;
  215. }
  216. });
  217. </script>
  218. {block:IndexPage}
  219. <script src="http://static.tumblr.com/fiton9k/T5Mlg92fv/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
  220. <script src="http://static.tumblr.com/fiton9k/D0Plgbx3t/hscroll.js" type="text/javascript" charset="utf-8"></script>
  221. <script type="text/javascript" charset="utf-8">
  222. $(function(){
  223. $(".horizontal" ).wrapInner("<table><tr>" );
  224. $(".entry" ).wrap("<td>" );
  225. });
  226. </script>
  227. {/block:IndexPage}
  228. </head>
  229. <body>
  230. <div id="side">
  231. <div class="title">{Title}</div>
  232. {block:Description}<div class="info">{Description}</div>{/block:Description}
  233. <div class="nav"><a href="/" class="majuscule nav">HOME</a>
  234. <a href="http://benoitd-photos.tumblr.com/tagged/bw" class="nav">Black & wight</a>
  235. <a href="http://benoitd-photos.tumblr.com/tagged/ny" class="nav">New-York</a>
  236. <a href="http://benoitd-photos.tumblr.com/tagged/paris" class="nav">Paris</a>
  237. <a href="http://benoitd-photos.tumblr.com/tagged/fjord" class="nav">Fjords</a>
  238. <a href="http://benoitd-photos.tumblr.com/tagged/scotland" class="nav">Scotland
  239. </a>
  240. <a href="http://benoitd-photos.tumblr.com/tagged/vegetal" class="nav">Vegetal</a>
  241. <a href="http://benoitd-photos.tumblr.com/tagged/mountain" class="nav">Mountain</a>
  242. <a href="/archive" class="nav">Archive</a>
  243. <a href="/random" class="nav">Random</a>
  244. <a href="http://benoitd-photos.tumblr.com/contact" class="nav">Contact</a>
  245. {block:HasPages}{block:Pages}<a href="{URL}" class="nav">{Label}</A>{/block:Pages}{/block:HasPages}
  246. {block:SubmissionsEnabled}<a href="/submit" class="nav">{SubmitLabel}</a>{/block:SubmissionsEnabled}</div>
  247. <div class="page">{block:PreviousPage}<a href="{PreviousPage}"><big>&laquo;</big> <small><small>/</small></small> </a>{/block:PreviousPage}{block:nextPage}<a href="{nextPage}"><big>&raquo;</big></a>{/block:nextPage}</div>
  248. </div>
  249. <div id="content" class="horizontal">
  250. {block:Posts}
  251. {block:Text}
  252. <div class="entry">
  253. {block:Title}<div class="post_title">{Title}</div>{/block:Title}
  254. {Body}
  255. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  256. {block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  257. </div>
  258. {/block:Text}
  259. {block:Photo}
  260. <div class="entry">
  261. {block:IndexPage}<a href="{Permalink}">{/block:IndexPage}
  262. {block:PermalinkPage}{LinkOpenTag}{/block:PermalinkPage}
  263. {block:IndexPage}<div class="photo">{/block:IndexPage}<img src="{block:IndexPage}{PhotoURL-HighRes}{/block:IndexPage}
  264. {block:PermalinkPage}{PhotoURL-HighRes}{/block:PermalinkPage}" alt="{PhotoAlt}" {block:PermalinkPage}{/block:PermalinkPage}/>{block:IndexPage}</div>{/block:IndexPage}<p>
  265. {block:IndexPage}</a>{/block:IndexPage}
  266. {block:PermalinkPage}{LinkCloseTag}{/block:PermalinkPage}
  267. <div class="caption">{block:Caption}{Caption}{/block:Caption}</div>{block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  268. </div>
  269. {/block:Photo}
  270. {block:Photoset}
  271. <div class="entry">
  272. {block:IndexPage}{Photoset-400}{/block:IndexPage}
  273. {block:PermalinkPage}{Photoset-500}{/block:PermalinkPage}
  274. <p>
  275. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  276. {block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  277. </div>
  278. {/block:Photoset}
  279. {block:Quote}
  280. <div class="entry">
  281. <div class="post_title">&#10077;&nbsp;{Quote}</div>
  282. {block:Source}<p>&#8212;&nbsp;{Source}</p>{/block:Source}
  283. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  284. {block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  285. </div>
  286. {/block:Quote}
  287. {block:Link}
  288. <div class="entry">
  289. <div class="post_title"><a href="{URL}">{Name}</a></div>
  290. {block:Description}{Description}{/block:Description}
  291. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  292. {block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  293. </div>
  294. {/block:Link}
  295. {block:Chat}
  296. <div class="entry">
  297. {block:Title}<span class="post_title">{Title}</span>{/block:Title}
  298. <div id="chat">
  299. <ul>{block:Lines}<li>
  300. {block:Label}<b>{Label}</b>{/block:Label}
  301. {Line}
  302. </li>{/block:Lines}</ul>
  303. </div>
  304. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  305. {block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  306. </div>
  307. {/block:Chat}
  308. {block:Audio}
  309. <div class="entry">
  310. {block:AlbumArt}<img src="{AlbumArtURL}" width="200"/><p>{/block:AlbumArt}
  311. <div class="audio">{AudioPlayerBlack}</div>
  312. {block:IndexPage}{block:Caption}{Caption}
  313. <small>{PlayCount} listens</small> {block:ExternalAudio} <a href="{ExternalAudioURL}"> (download link) </a> {/block:ExternalAudio}{/block:Caption}{/block:IndexPage}
  314. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  315. {block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  316. </div>
  317. {/block:Audio}
  318. {block:Video}
  319. <div class="entry">
  320. {Video-500}<p>
  321. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  322. {block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  323. </div>
  324. {/block:Video}
  325. {block:Answer}
  326. <div class="entry">
  327. <b>{Asker} : {Question}</b>
  328. <i>{Answer}</i>
  329. {block:IndexPage}<div class="permaborder"></div><div class="permalink"><a href="{Permalink}">{NoteCountWithLabel}&nbsp;&nbsp;&bull;&nbsp;&nbsp;{TimeAgo}</a></div>{/block:IndexPage}
  330. {block:PermalinkPage}Posted {TimeAgo} with {NoteCountWithLabel}<br>{block:HasTags}Tagged with {block:Tags}<a href="{TagURL}" style="margin-right:5px; text-decoration:underline;">#{Tag}</a>{/block:Tags}{/block:HasTags}<br>{block:RebloggedFrom}Reblogged from <a href="{ReblogParentURL}">{ReblogParentName}</a><br>Originally posted by <a href="{ReblogRootURL}">{ReblogRootName}</a>{/block:RebloggedFrom}{/block:PermalinkPage}
  331. </div>
  332. {/block:answer}
  333. <div id="postnotes">{block:PostNotes}{PostNotes}{/block:PostNotes}</div>
  334. {/block:Posts}
  335. </div>
  336. <div id="sidebottom">
  337. <a href="http://www.flickr.com/benoit_d"><img src="http://static.tumblr.com/dgatwhw/te2myxruv/logo_flickr.jpg" height="98%" target="_blank"/></a>&nbsp;&nbsp;
  338. <a href="http://www.facebook.com/benoit.deniaud"><img src="http://static.tumblr.com/dgatwhw/zMImyxruq/logo_fb.jpg" height="98%" target="_blank"/></a>&nbsp;&nbsp; <a href="/contact" >CONTACT</a>
  339. </div>
  340. </body>
  341. </html>


 
 


Message édité par ben_1983 le 05-01-2014 à 22:44:42
Reply

Marsh Posté le 05-01-2014 à 21:23:37   

Reply

Marsh Posté le 05-01-2014 à 21:58:55    

Tu peux éditer le code de ton message et virer le code de jquery, je pense qu'on s'en fout un peu du code de jquery :o


---------------
Blablaté par Harko
Reply

Marsh Posté le 05-01-2014 à 22:45:20    

ok. je pensais que la fonction aléatoire était à insérer dans le code  jquery.

Reply

Marsh Posté le 05-01-2014 à 23:14:53    

ah ben nan surtout pas. Il faut toujours se mettre en tête qu'une librairie comme jquery, on y touche pas, et qu'on a tout ce qui faut et qui est fourni par jquery pour arriver à notre objectif


---------------
Blablaté par Harko
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed