Technologic101 commited on
Commit
c5273f3
·
1 Parent(s): 25e66b2

task: prototype RAG and design creation

Browse files
src/agents/designer.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import List, Dict
2
+ from langchain_core.messages import HumanMessage, AIMessage
3
+ from chains.design_rag import DesignRAG
4
+ from .workflow import create_graph, AgentState
5
+ from pathlib import Path
6
+
7
+ class DesignerAgent:
8
+ def __init__(self, rag: DesignRAG):
9
+ self.rag = rag
10
+ self.workflow = create_graph(rag)
11
+ self.state: AgentState = {
12
+ "messages": [],
13
+ "html_content": self._load_default_html(),
14
+ "style_requirements": {},
15
+ "css_output": None
16
+ }
17
+
18
+ def _load_default_html(self) -> str:
19
+ """Load default CSS Zen Garden HTML"""
20
+ html_path = Path("data/csszengardenhtml.html")
21
+ if html_path.exists():
22
+ return html_path.read_text()
23
+ return ""
24
+
25
+ def set_html(self, html_content: str):
26
+ """Set custom HTML content"""
27
+ self.state["html_content"] = html_content
28
+
29
+ async def process(self, message: str) -> str:
30
+ """Process a message through the workflow"""
31
+ # Add message to state
32
+ self.state["messages"].append(HumanMessage(content=message))
33
+
34
+ # Run workflow
35
+ next_state = await self.workflow.invoke(self.state)
36
+
37
+ # Update state
38
+ self.state = next_state
39
+
40
+ # Return last response
41
+ return self.state["messages"][-1].content
src/agents/workflow.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Dict, List, Annotated, TypedDict
2
+ from langchain_core.messages import HumanMessage, AIMessage
3
+ from langgraph.graph import StateGraph, END
4
+ from langchain_core.messages import BaseMessage
5
+ from chains.design_rag import DesignRAG
6
+ from langchain.prompts import ChatPromptTemplate
7
+ import chainlit as cl
8
+ import json
9
+
10
+ # Define state types
11
+ class AgentState(TypedDict):
12
+ messages: List[BaseMessage]
13
+ html_content: str
14
+ style_requirements: Dict
15
+ css_output: str | None
16
+
17
+ # Node functions
18
+ async def conversation_node(state: AgentState, rag: DesignRAG):
19
+ """Handle conversation and requirement gathering"""
20
+ # Get last message
21
+ last_message = state["messages"][-1]
22
+
23
+ if not isinstance(last_message, HumanMessage):
24
+ return {"messages": state["messages"]}
25
+
26
+ # Check for style requirements readiness
27
+ if "!generate" in last_message.content.lower():
28
+ # Extract style requirements from conversation
29
+ requirements = await extract_requirements(state["messages"], rag)
30
+ return {
31
+ "messages": state["messages"],
32
+ "style_requirements": requirements,
33
+ "next": "generate_css"
34
+ }
35
+
36
+ # Normal conversation - get context and respond
37
+ response = await rag.query(last_message.content)
38
+ state["messages"].append(AIMessage(content=response))
39
+
40
+ return {"messages": state["messages"]}
41
+
42
+ async def extract_requirements(
43
+ messages: List[BaseMessage],
44
+ rag: DesignRAG
45
+ ) -> Dict:
46
+ """Extract style requirements from conversation history"""
47
+ # Combine messages into context
48
+ context = "\n".join([
49
+ f"{'User' if isinstance(m, HumanMessage) else 'Assistant'}: {m.content}"
50
+ for m in messages
51
+ ])
52
+
53
+ # Create extraction prompt
54
+ prompt = f"""Based on this conversation, extract the key style requirements:
55
+
56
+ {context}
57
+
58
+ Provide the requirements in this JSON format:
59
+ {{
60
+ "style_description": "Brief description of desired style",
61
+ "key_elements": ["list", "of", "important", "visual", "elements"],
62
+ "color_scheme": "Description of colors",
63
+ "layout_preferences": "Any specific layout requirements",
64
+ "mood": "Desired emotional impact"
65
+ }}
66
+ """
67
+
68
+ # Get requirements through RAG system
69
+ response = await rag.llm.ainvoke(prompt)
70
+ return json.loads(response.content)
71
+
72
+ async def generate_css_node(state: AgentState, rag: DesignRAG) -> AgentState:
73
+ """Generate CSS based on requirements"""
74
+ # Get similar designs based on requirements
75
+ similar_designs = await rag.query_similar_designs(state["style_requirements"])
76
+
77
+ # Create the generation prompt
78
+ prompt = ChatPromptTemplate.from_template("""You are an expert CSS designer creating a style for the following HTML structure:
79
+
80
+ HTML Structure:
81
+ {html_content}
82
+
83
+ Style Requirements:
84
+ {requirements}
85
+
86
+ Similar Design Examples:
87
+ {examples}
88
+
89
+ Generate a complete CSS file that:
90
+ 1. Implements the requested style requirements
91
+ 2. Uses modern CSS features appropriately
92
+ 3. Creates a cohesive and polished design
93
+ 4. Includes comments explaining key style decisions
94
+
95
+ Respond only with the CSS code, starting with a comment block describing the design approach.
96
+ """)
97
+
98
+ # Format requirements for prompt
99
+ requirements_text = json.dumps(state["style_requirements"], indent=2)
100
+
101
+ # Generate CSS
102
+ response = await rag.llm.ainvoke(
103
+ prompt.format(
104
+ html_content=state["html_content"],
105
+ requirements=requirements_text,
106
+ examples=similar_designs
107
+ )
108
+ )
109
+
110
+ # Store generated CSS
111
+ state["css_output"] = response.content
112
+
113
+ # Add completion message
114
+ state["messages"].append(AIMessage(content="""I've generated the CSS based on your requirements.
115
+ Here's what I created:
116
+
117
+ ```css
118
+ {css}
119
+ ```
120
+
121
+ Would you like me to explain any part of the design or make any adjustments?
122
+ """.format(css=response.content)))
123
+
124
+ return state
125
+
126
+ def create_graph(rag: DesignRAG) -> StateGraph:
127
+ """Create the workflow graph"""
128
+ # Create graph
129
+ workflow = StateGraph(AgentState)
130
+
131
+ # Add nodes
132
+ workflow.add_node("conversation", lambda s: conversation_node(s, rag))
133
+ workflow.add_node("generate_css", lambda s: generate_css_node(s, rag))
134
+
135
+ # Add edges
136
+ workflow.add_edge("conversation", "conversation")
137
+ workflow.add_edge("conversation", "generate_css")
138
+ workflow.add_edge("generate_css", END)
139
+
140
+ # Set entry point
141
+ workflow.set_entry_point("conversation")
142
+
143
+ return workflow.compile()
src/app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import chainlit as cl
2
+ from langchain_core.messages import HumanMessage, AIMessage
3
+ from chains.design_rag import DesignRAG
4
+ from agents.designer import DesignerAgent
5
+
6
+ @cl.on_chat_start
7
+ async def start():
8
+ """Initialize the chat session"""
9
+ # Initialize RAG system
10
+ design_rag = DesignRAG()
11
+ # Initialize designer agent
12
+ designer = DesignerAgent(rag=design_rag)
13
+
14
+ # Store in user session
15
+ cl.user_session.set("designer", designer)
16
+
17
+ @cl.on_message
18
+ async def main(message: cl.Message):
19
+ """Handle incoming messages"""
20
+ designer = cl.user_session.get("designer")
21
+
22
+ # Process message through designer agent
23
+ response = await designer.process(message.content)
24
+
25
+ # Send response
26
+ await cl.Message(content=response).send()
src/chains/design_rag.py ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_core.runnables import RunnablePassthrough
2
+ from langchain_core.output_parsers import StrOutputParser
3
+ from langchain_openai import ChatOpenAI, OpenAIEmbeddings
4
+ from langchain_community.vectorstores import FAISS
5
+ from langchain.prompts import ChatPromptTemplate
6
+ from pathlib import Path
7
+ import json
8
+ from typing import Dict
9
+
10
+ class DesignRAG:
11
+ def __init__(self):
12
+ # Initialize embedding model
13
+ self.embeddings = OpenAIEmbeddings()
14
+
15
+ # Load design data and create vector store
16
+ self.vector_store = self._create_vector_store()
17
+
18
+ # Create retriever
19
+ self.retriever = self.vector_store.as_retriever(
20
+ search_type="similarity",
21
+ search_kwargs={"k": 3}
22
+ )
23
+
24
+ # Create LLM
25
+ self.llm = ChatOpenAI(temperature=0.7)
26
+
27
+ # Create the RAG chain
28
+ self.chain = self._create_chain()
29
+
30
+ def _create_vector_store(self):
31
+ """Create FAISS vector store from design metadata"""
32
+ designs_dir = Path("designs")
33
+ documents = []
34
+
35
+ # Load all metadata files
36
+ for design_dir in designs_dir.glob("**/metadata.json"):
37
+ with open(design_dir, "r") as f:
38
+ metadata = json.load(f)
39
+
40
+ # Create document text from metadata
41
+ text = f"""
42
+ Design {metadata['id']}:
43
+ Description: {metadata.get('description', '')}
44
+ Categories: {', '.join(metadata.get('categories', []))}
45
+ Visual Characteristics: {', '.join(metadata.get('visual_characteristics', []))}
46
+ """
47
+
48
+ # Load associated CSS
49
+ css_path = design_dir.parent / "style.css"
50
+ if css_path.exists():
51
+ with open(css_path, "r") as f:
52
+ css = f.read()
53
+ text += f"\nCSS:\n{css}"
54
+
55
+ documents.append({
56
+ "page_content": text,
57
+ "metadata": {
58
+ "id": metadata["id"],
59
+ "url": metadata.get("url", ""),
60
+ }
61
+ })
62
+
63
+ # Create and return vector store
64
+ return FAISS.from_documents(documents, self.embeddings)
65
+
66
+ def _create_chain(self):
67
+ """Create the RAG processing chain"""
68
+ # Define prompt template
69
+ template = """You are a design assistant helping to find and adapt CSS Zen Garden designs.
70
+ Use the following similar designs to inform your response:
71
+
72
+ {context}
73
+
74
+ Based on these examples, help the user with their request:
75
+ {question}
76
+ """
77
+
78
+ prompt = ChatPromptTemplate.from_template(template)
79
+
80
+ # Create and return chain
81
+ chain = (
82
+ {"context": self.retriever, "question": RunnablePassthrough()}
83
+ | prompt
84
+ | self.llm
85
+ | StrOutputParser()
86
+ )
87
+
88
+ return chain
89
+
90
+ async def query(self, question: str) -> str:
91
+ """Process a query through the RAG system"""
92
+ return await self.chain.ainvoke(question)
93
+
94
+ async def query_similar_designs(self, requirements: Dict) -> str:
95
+ """Find similar designs based on requirements"""
96
+ # Create search query from requirements
97
+ query = f"""
98
+ Style: {requirements['style_description']}
99
+ Elements: {', '.join(requirements['key_elements'])}
100
+ Colors: {requirements['color_scheme']}
101
+ Layout: {requirements['layout_preferences']}
102
+ Mood: {requirements['mood']}
103
+ """
104
+
105
+ # Get similar documents
106
+ docs = self.retriever.get_relevant_documents(query)
107
+
108
+ # Format examples
109
+ examples = []
110
+ for doc in docs:
111
+ examples.append(f"Example Design:\n{doc.page_content}\n")
112
+
113
+ return "\n".join(examples)
src/data/csszengardenhtml.html ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>CSS Zen Garden: The Beauty of CSS Design</title>
6
+
7
+ <link rel="stylesheet" media="screen" href="style.css?v=8may2013">
8
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.csszengarden.com/zengarden.xml">
9
+
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
+ <meta name="author" content="Dave Shea">
12
+ <meta name="description" content="A demonstration of what can be accomplished visually through CSS-based design.">
13
+ <meta name="robots" content="all">
14
+
15
+
16
+ <!--[if lt IE 9]>
17
+ <script src="script/html5shiv.js"></script>
18
+ <![endif]-->
19
+ </head>
20
+
21
+ <!--
22
+
23
+
24
+
25
+ View source is a feature, not a bug. Thanks for your curiosity and
26
+ interest in participating!
27
+
28
+ Here are the submission guidelines for the new and improved csszengarden.com:
29
+
30
+ - CSS3? Of course! Prefix for ALL browsers where necessary.
31
+ - go responsive; test your layout at multiple screen sizes.
32
+ - your browser testing baseline: IE9+, recent Chrome/Firefox/Safari, and iOS/Android
33
+ - Graceful degradation is acceptable, and in fact highly encouraged.
34
+ - use classes for styling. Don't use ids.
35
+ - web fonts are cool, just make sure you have a license to share the files. Hosted
36
+ services that are applied via the CSS file (ie. Google Fonts) will work fine, but
37
+ most that require custom HTML won't. TypeKit is supported, see the readme on this
38
+ page for usage instructions: https://github.com/mezzoblue/csszengarden.com/
39
+
40
+ And a few tips on building your CSS file:
41
+
42
+ - use :first-child, :last-child and :nth-child to get at non-classed elements
43
+ - use ::before and ::after to create pseudo-elements for extra styling
44
+ - use multiple background images to apply as many as you need to any element
45
+ - use the Kellum Method for image replacement, if still needed. http://goo.gl/GXxdI
46
+ - don't rely on the extra divs at the bottom. Use ::before and ::after instead.
47
+
48
+
49
+ -->
50
+
51
+ <body id="css-zen-garden">
52
+ <div class="page-wrapper">
53
+
54
+ <section class="intro" id="zen-intro">
55
+ <header role="banner">
56
+ <h1>CSS Zen Garden</h1>
57
+ <h2>The Beauty of <abbr title="Cascading Style Sheets">CSS</abbr> Design</h2>
58
+ </header>
59
+
60
+ <div class="summary" id="zen-summary" role="article">
61
+ <p>A demonstration of what can be accomplished through <abbr title="Cascading Style Sheets">CSS</abbr>-based design. Select any style sheet from the list to load it into this page.</p>
62
+ <p>Download the example <a href="/examples/index" title="This page's source HTML code, not to be modified.">html file</a> and <a href="/examples/style.css" title="This page's sample CSS, the file you may modify.">css file</a></p>
63
+ </div>
64
+
65
+ <div class="preamble" id="zen-preamble" role="article">
66
+ <h3>The Road to Enlightenment</h3>
67
+ <p>Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible <abbr title="Document Object Model">DOM</abbr>s, broken <abbr title="Cascading Style Sheets">CSS</abbr> support, and abandoned browsers.</p>
68
+ <p>We must clear the mind of the past. Web enlightenment has been achieved thanks to the tireless efforts of folk like the <abbr title="World Wide Web Consortium">W3C</abbr>, <abbr title="Web Standards Project">WaSP</abbr>, and the major browser creators.</p>
69
+ <p>The CSS Zen Garden invites you to relax and meditate on the important lessons of the masters. Begin to see with clarity. Learn to use the time-honored techniques in new and invigorating fashion. Become one with the web.</p>
70
+ </div>
71
+ </section>
72
+
73
+ <div class="main supporting" id="zen-supporting" role="main">
74
+ <div class="explanation" id="zen-explanation" role="article">
75
+ <h3>So What is This About?</h3>
76
+ <p>There is a continuing need to show the power of <abbr title="Cascading Style Sheets">CSS</abbr>. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The <abbr title="HyperText Markup Language">HTML</abbr> remains the same, the only thing that has changed is the external <abbr title="Cascading Style Sheets">CSS</abbr> file. Yes, really.</p>
77
+ <p><abbr title="Cascading Style Sheets">CSS</abbr> allows complete and total control over the style of a hypertext document. The only way this can be illustrated in a way that gets people excited is by demonstrating what it can truly be, once the reins are placed in the hands of those able to create beauty from structure. Designers and coders alike have contributed to the beauty of the web; we can always push it further.</p>
78
+ </div>
79
+
80
+ <div class="participation" id="zen-participation" role="article">
81
+ <h3>Participation</h3>
82
+ <p>Strong visual design has always been our focus. You are modifying this page, so strong <abbr title="Cascading Style Sheets">CSS</abbr> skills are necessary too, but the example files are commented well enough that even <abbr title="Cascading Style Sheets">CSS</abbr> novices can use them as starting points. Please see the <a href="/pages/resources/" title="A listing of CSS-related resources"><abbr title="Cascading Style Sheets">CSS</abbr> Resource Guide</a> for advanced tutorials and tips on working with <abbr title="Cascading Style Sheets">CSS</abbr>.</p>
83
+ <p>You may modify the style sheet in any way you wish, but not the <abbr title="HyperText Markup Language">HTML</abbr>. This may seem daunting at first if you&#8217;ve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide.</p>
84
+ <p>Download the sample <a href="/examples/index" title="This page's source HTML code, not to be modified.">HTML</a> and <a href="/examples/style.css" title="This page's sample CSS, the file you may modify.">CSS</a> to work on a copy locally. Once you have completed your masterpiece (and please, don&#8217;t submit half-finished work) upload your <abbr title="Cascading Style Sheets">CSS</abbr> file to a web server under your control. <a href="/pages/submit/" title="Use the contact form to send us your CSS file">Send us a link</a> to an archive of that file and all associated assets, and if we choose to use it we will download it and place it on our server.</p>
85
+ </div>
86
+
87
+ <div class="benefits" id="zen-benefits" role="article">
88
+ <h3>Benefits</h3>
89
+ <p>Why participate? For recognition, inspiration, and a resource we can all refer to showing people how amazing <abbr title="Cascading Style Sheets">CSS</abbr> really can be. This site serves as equal parts inspiration for those working on the web today, learning tool for those who will be tomorrow, and gallery of future techniques we can all look forward to.</p>
90
+ </div>
91
+
92
+ <div class="requirements" id="zen-requirements" role="article">
93
+ <h3>Requirements</h3>
94
+ <p>Where possible, we would like to see mostly <abbr title="Cascading Style Sheets, levels 1 and 2">CSS 1 &amp; 2</abbr> usage. <abbr title="Cascading Style Sheets, levels 3 and 4">CSS 3 &amp; 4</abbr> should be limited to widely-supported elements only, or strong fallbacks should be provided. The CSS Zen Garden is about functional, practical <abbr title="Cascading Style Sheets">CSS</abbr> and not the latest bleeding-edge tricks viewable by 2% of the browsing public. The only real requirement we have is that your <abbr title="Cascading Style Sheets">CSS</abbr> validates.</p>
95
+ <p>Luckily, designing this way shows how well various browsers have implemented <abbr title="Cascading Style Sheets">CSS</abbr> by now. When sticking to the guidelines you should see fairly consistent results across most modern browsers. Due to the sheer number of user agents on the web these days &#8212; especially when you factor in mobile &#8212; pixel-perfect layouts may not be possible across every platform. That&#8217;s okay, but do test in as many as you can. Your design should work in at least IE9+ and the latest Chrome, Firefox, iOS and Android browsers (run by over 90% of the population).</p>
96
+ <p>We ask that you submit original artwork. Please respect copyright laws. Please keep objectionable material to a minimum, and try to incorporate unique and interesting visual themes to your work. We&#8217;re well past the point of needing another garden-related design.</p>
97
+ <p>This is a learning exercise as well as a demonstration. You retain full copyright on your graphics (with limited exceptions, see <a href="/pages/submit/guidelines/">submission guidelines</a>), but we ask you release your <abbr title="Cascading Style Sheets">CSS</abbr> under a Creative Commons license identical to the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="View the Zen Garden's license information.">one on this site</a> so that others may learn from your work.</p>
98
+ <p role="contentinfo">By <a href="http://www.mezzoblue.com/">Dave Shea</a>. Bandwidth graciously donated by <a href="http://www.mediatemple.net/">mediatemple</a>. Now available: <a href="http://www.amazon.com/exec/obidos/ASIN/0321303474/mezzoblue-20/">Zen Garden, the book</a>.</p>
99
+ </div>
100
+
101
+ <footer>
102
+ <a href="http://validator.w3.org/check/referer" title="Check the validity of this site&#8217;s HTML" class="zen-validate-html">HTML</a>
103
+ <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Check the validity of this site&#8217;s CSS" class="zen-validate-css">CSS</a>
104
+ <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="View the Creative Commons license of this site: Attribution-NonCommercial-ShareAlike." class="zen-license">CC</a>
105
+ <a href="http://mezzoblue.com/zengarden/faq/#aaa" title="Read about the accessibility of this site" class="zen-accessibility">A11y</a>
106
+ <a href="https://github.com/mezzoblue/csszengarden.com" title="Fork this site on Github" class="zen-github">GH</a>
107
+ </footer>
108
+
109
+ </div>
110
+
111
+
112
+ <aside class="sidebar" role="complementary">
113
+ <div class="wrapper">
114
+
115
+ <div class="design-selection" id="design-selection">
116
+ <h3 class="select">Select a Design:</h3>
117
+ <nav role="navigation">
118
+ <ul>
119
+ <li>
120
+ <a href="/221/" class="design-name">Mid Century Modern</a> by <a href="http://andrewlohman.com/" class="designer-name">Andrew Lohman</a>
121
+ </li> <li>
122
+ <a href="/220/" class="design-name">Garments</a> by <a href="http://danielmall.com/" class="designer-name">Dan Mall</a>
123
+ </li> <li>
124
+ <a href="/219/" class="design-name">Steel</a> by <a href="http://steffen-knoeller.de" class="designer-name">Steffen Knoeller</a>
125
+ </li> <li>
126
+ <a href="/218/" class="design-name">Apothecary</a> by <a href="http://trentwalton.com" class="designer-name">Trent Walton</a>
127
+ </li> <li>
128
+ <a href="/217/" class="design-name">Screen Filler</a> by <a href="http://elliotjaystocks.com/" class="designer-name">Elliot Jay Stocks</a>
129
+ </li> <li>
130
+ <a href="/216/" class="design-name">Fountain Kiss</a> by <a href="http://jeremycarlson.com" class="designer-name">Jeremy Carlson</a>
131
+ </li> <li>
132
+ <a href="/215/" class="design-name">A Robot Named Jimmy</a> by <a href="http://meltmedia.com/" class="designer-name">meltmedia</a>
133
+ </li> <li>
134
+ <a href="/214/" class="design-name">Verde Moderna</a> by <a href="http://www.mezzoblue.com/" class="designer-name">Dave Shea</a>
135
+ </li> </ul>
136
+ </nav>
137
+ </div>
138
+
139
+ <div class="design-archives" id="design-archives">
140
+ <h3 class="archives">Archives:</h3>
141
+ <nav role="navigation">
142
+ <ul>
143
+ <li class="next">
144
+ <a href="/214/page1">
145
+ Next Designs <span class="indicator">&rsaquo;</span>
146
+ </a>
147
+ </li>
148
+ <li class="viewall">
149
+ <a href="/pages/alldesigns/" title="View every submission to the Zen Garden.">
150
+ View All Designs </a>
151
+ </li>
152
+ </ul>
153
+ </nav>
154
+ </div>
155
+
156
+ <div class="zen-resources" id="zen-resources">
157
+ <h3 class="resources">Resources:</h3>
158
+ <ul>
159
+ <li class="view-css">
160
+ <a href="style.css" title="View the source CSS file of the currently-viewed design.">
161
+ View This Design&#8217;s <abbr title="Cascading Style Sheets">CSS</abbr> </a>
162
+ </li>
163
+ <li class="css-resources">
164
+ <a href="/pages/resources/" title="Links to great sites with information on using CSS.">
165
+ <abbr title="Cascading Style Sheets">CSS</abbr> Resources </a>
166
+ </li>
167
+ <li class="zen-faq">
168
+ <a href="/pages/faq/" title="A list of Frequently Asked Questions about the Zen Garden.">
169
+ <abbr title="Frequently Asked Questions">FAQ</abbr> </a>
170
+ </li>
171
+ <li class="zen-submit">
172
+ <a href="/pages/submit/" title="Send in your own CSS file.">
173
+ Submit a Design </a>
174
+ </li>
175
+ <li class="zen-translations">
176
+ <a href="/pages/translations/" title="View translated versions of this page.">
177
+ Translations </a>
178
+ </li>
179
+ </ul>
180
+ </div>
181
+ </div>
182
+ </aside>
183
+
184
+
185
+ </div>
186
+
187
+ <!--
188
+
189
+ These superfluous divs/spans were originally provided as catch-alls to add extra imagery.
190
+ These days we have full ::before and ::after support, favour using those instead.
191
+ These only remain for historical design compatibility. They might go away one day.
192
+
193
+ -->
194
+ <div class="extra1" role="presentation"></div><div class="extra2" role="presentation"></div><div class="extra3" role="presentation"></div>
195
+ <div class="extra4" role="presentation"></div><div class="extra5" role="presentation"></div><div class="extra6" role="presentation"></div>
196
+
197
+ </body>
198
+ </html>
src/data/csszengardenstyle.css ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* css Zen Garden default style v1.02 */
2
+ /* css released under Creative Commons License - http://creativecommons.org/licenses/by-nc-sa/1.0/ */
3
+
4
+ /* This file based on 'Tranquille' by Dave Shea */
5
+ /* You may use this file as a foundation for any new work, but you may find it easier to start from scratch. */
6
+ /* Not all elements are defined in this file, so you'll most likely want to refer to the xhtml as well. */
7
+
8
+ /* Your images should be linked as if the CSS file sits in the same folder as the images. ie. no paths. */
9
+
10
+
11
+ /* basic elements */
12
+ html {
13
+ margin: 0;
14
+ padding: 0;
15
+ }
16
+ body {
17
+ font: 75% georgia, sans-serif;
18
+ line-height: 1.88889;
19
+ color: #555753;
20
+ background: #fff url(http://csszengarden.com/001/blossoms.jpg) no-repeat bottom right;
21
+ margin: 0;
22
+ padding: 0;
23
+ }
24
+ p {
25
+ margin-top: 0;
26
+ text-align: justify;
27
+ }
28
+ h3 {
29
+ font: italic normal 1.4em georgia, sans-serif;
30
+ letter-spacing: 1px;
31
+ margin-bottom: 0;
32
+ color: #7D775C;
33
+ }
34
+ a:link {
35
+ font-weight: bold;
36
+ text-decoration: none;
37
+ color: #B7A5DF;
38
+ }
39
+ a:visited {
40
+ font-weight: bold;
41
+ text-decoration: none;
42
+ color: #D4CDDC;
43
+ }
44
+ a:hover, a:focus, a:active {
45
+ text-decoration: underline;
46
+ color: #9685BA;
47
+ }
48
+ abbr {
49
+ border-bottom: none;
50
+ }
51
+
52
+
53
+ /* specific divs */
54
+ .page-wrapper {
55
+ background: url(http://csszengarden.com/001/zen-bg.jpg) no-repeat top left;
56
+ padding: 0 175px 0 110px;
57
+ margin: 0;
58
+ position: relative;
59
+ }
60
+
61
+ .intro {
62
+ min-width: 470px;
63
+ width: 100%;
64
+ }
65
+
66
+ header h1 {
67
+ background: transparent url(http://csszengarden.com/001/h1.gif) no-repeat top left;
68
+ margin-top: 10px;
69
+ display: block;
70
+ width: 219px;
71
+ height: 87px;
72
+ float: left;
73
+
74
+ text-indent: 100%;
75
+ white-space: nowrap;
76
+ overflow: hidden;
77
+ }
78
+ header h2 {
79
+ background: transparent url(http://csszengarden.com/001/h2.gif) no-repeat top left;
80
+ margin-top: 58px;
81
+ margin-bottom: 40px;
82
+ width: 200px;
83
+ height: 18px;
84
+ float: right;
85
+
86
+ text-indent: 100%;
87
+ white-space: nowrap;
88
+ overflow: hidden;
89
+ }
90
+ header {
91
+ padding-top: 20px;
92
+ height: 87px;
93
+ }
94
+
95
+ .summary {
96
+ clear: both;
97
+ margin: 20px 20px 20px 10px;
98
+ width: 160px;
99
+ float: left;
100
+ }
101
+ .summary p {
102
+ font: italic 1.1em/2.2 georgia;
103
+ text-align: center;
104
+ }
105
+
106
+ .preamble {
107
+ clear: right;
108
+ padding: 0px 10px 0 10px;
109
+ }
110
+ .supporting {
111
+ padding-left: 10px;
112
+ margin-bottom: 40px;
113
+ }
114
+
115
+ footer {
116
+ text-align: center;
117
+ }
118
+ footer a:link, footer a:visited {
119
+ margin-right: 20px;
120
+ }
121
+
122
+ .sidebar {
123
+ margin-left: 600px;
124
+ position: absolute;
125
+ top: 0;
126
+ right: 0;
127
+ }
128
+ .sidebar .wrapper {
129
+ font: 10px verdana, sans-serif;
130
+ background: transparent url(http://csszengarden.com/001/paper-bg.jpg) top left repeat-y;
131
+ padding: 10px;
132
+ margin-top: 150px;
133
+ width: 130px;
134
+ }
135
+ .sidebar h3.select {
136
+ background: transparent url(http://csszengarden.com/001/h3.gif) no-repeat top left;
137
+ margin: 10px 0 5px 0;
138
+ width: 97px;
139
+ height: 16px;
140
+
141
+ text-indent: 100%;
142
+ white-space: nowrap;
143
+ overflow: hidden;
144
+ }
145
+ .sidebar h3.archives {
146
+ background: transparent url(http://csszengarden.com/001/h5.gif) no-repeat top left;
147
+ margin: 25px 0 5px 0;
148
+ width:57px;
149
+ height: 14px;
150
+
151
+ text-indent: 100%;
152
+ white-space: nowrap;
153
+ overflow: hidden;
154
+ }
155
+ .sidebar h3.resources {
156
+ background: transparent url(http://csszengarden.com/001/h6.gif) no-repeat top left;
157
+ margin: 25px 0 5px 0;
158
+ width:63px;
159
+ height: 10px;
160
+
161
+ text-indent: 100%;
162
+ white-space: nowrap;
163
+ overflow: hidden;
164
+ }
165
+
166
+
167
+ .sidebar ul {
168
+ margin: 0;
169
+ padding: 0;
170
+ }
171
+ .sidebar li {
172
+ line-height: 1.3em;
173
+ background: transparent url(http://csszengarden.com/001/cr1.gif) no-repeat top center;
174
+ display: block;
175
+ padding-top: 5px;
176
+ margin-bottom: 5px;
177
+ list-style-type: none;
178
+ }
179
+ .sidebar li a:link {
180
+ color: #988F5E;
181
+ }
182
+ .sidebar li a:visited {
183
+ color: #B3AE94;
184
+ }
185
+
186
+
187
+ .extra1 {
188
+ background: transparent url(http://csszengarden.com/001/cr2.gif) top left no-repeat;
189
+ position: absolute;
190
+ top: 40px;
191
+ right: 0;
192
+ width: 148px;
193
+ height: 110px;
194
+ }