Changes to dividendfolio.scroll.pub

root
root
25 days ago
Initial commit
body.html
Changed around line 1
+
+
+

DividendFolio

+

Craft & Analyze Your Perfect Dividend Portfolio

+
+
+
+
+
+

Build Your Portfolio

+
+
+ Low Volatility
+
+
+ High Dividend
+
+
+ High Quality
+
+
+
+
+
+
+

Your Portfolio

+
+
+
+
+
+
+
+
+

Empowering investors to make informed dividend decisions

+
+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://dividendfolio.scroll.pub
+ metaTags
+ editButton /edit.html
+ title DividendFolio - Build & Backtest Your Dividend Portfolio
+ style.css
+ body.html
+ script.js
readme.scroll
Changed around line 1
+ # dividendfolio.scroll.pub
+ Website generated by DeepSeek from prompt: 我想做一个投资网站,网站让客户专门挑选红利组合。网站提供给各种个股三个维度的标签,是否是低波、是否是高股息、是否质量较高,投资者可以选择任意股票作为一个组合,然后回测收益。
script.js
Changed around line 1
+ // Sample stock data
+ const stocks = [
+ { name: 'Apple', ticker: 'AAPL', lowVol: true, highDiv: false, highQual: true },
+ { name: 'Microsoft', ticker: 'MSFT', lowVol: true, highDiv: false, highQual: true },
+ { name: 'AT&T', ticker: 'T', lowVol: true, highDiv: true, highQual: false },
+ { name: 'Coca-Cola', ticker: 'KO', lowVol: true, highDiv: true, highQual: true },
+ { name: 'Exxon', ticker: 'XOM', lowVol: false, highDiv: true, highQual: false },
+ { name: 'Johnson & Johnson', ticker: 'JNJ', lowVol: true, highDiv: true, highQual: true },
+ { name: 'Procter & Gamble', ticker: 'PG', lowVol: true, highDiv: true, highQual: true },
+ { name: 'Verizon', ticker: 'VZ', lowVol: true, highDiv: true, highQual: false }
+ ];
+
+ const stockGrid = document.getElementById('stock-grid');
+ const selectedStocks = document.getElementById('selected-stocks');
+ const backtestBtn = document.getElementById('backtest-btn');
+ const resultsDiv = document.getElementById('results');
+ const portfolio = new Set();
+
+ function renderStocks() {
+ stockGrid.innerHTML = '';
+ const lowVol = document.getElementById('low-volatility').checked;
+ const highDiv = document.getElementById('high-dividend').checked;
+ const highQual = document.getElementById('high-quality').checked;
+
+ stocks.filter(stock => {
+ return (!lowVol || stock.lowVol) &&
+ (!highDiv || stock.highDiv) &&
+ (!highQual || stock.highQual);
+ }).forEach(stock => {
+ const card = document.createElement('div');
+ card.className = 'stock-card';
+ card.innerHTML = `
+

${stock.name}

+

${stock.ticker}

+ `;
+ card.addEventListener('click', () => toggleStock(stock));
+ stockGrid.appendChild(card);
+ });
+ }
+
+ function toggleStock(stock) {
+ if (portfolio.has(stock)) {
+ portfolio.delete(stock);
+ } else {
+ portfolio.add(stock);
+ }
+ renderSelectedStocks();
+ }
+
+ function renderSelectedStocks() {
+ selectedStocks.innerHTML = '';
+ portfolio.forEach(stock => {
+ const chip = document.createElement('div');
+ chip.className = 'stock-chip';
+ chip.textContent = `${stock.name} (${stock.ticker})`;
+ selectedStocks.appendChild(chip);
+ });
+ }
+
+ function backtestPortfolio() {
+ if (portfolio.size === 0) {
+ resultsDiv.textContent = 'Please select at least one stock to backtest.';
+ return;
+ }
+
+ // Simulate backtest results
+ const portfolioArray = Array.from(portfolio);
+ const returns = portfolioArray.map(() => (Math.random() * 30).toFixed(2));
+
+ resultsDiv.innerHTML = `
+

Backtest Results

+
    + ${portfolioArray.map((stock, i) => `
    +
  • ${stock.name} (${stock.ticker}): ${returns[i]}%
  • + `).join('')}
    +
    +

    Portfolio Average Return: ${(returns.reduce((a,b) => +a + +b, 0) / returns.length).toFixed(2)}%

    + `;
    + }
    +
    + document.querySelectorAll('.filters input').forEach(input => {
    + input.addEventListener('change', renderStocks);
    + });
    +
    + backtestBtn.addEventListener('click', backtestPortfolio);
    +
    + // Initial render
    + renderStocks();
    style.css
    Changed around line 1
    + :root {
    + --primary: #2c3e50;
    + --secondary: #3498db;
    + --accent: #e67e22;
    + --background: #ecf0f1;
    + --text: #2c3e50;
    + --white: #ffffff;
    + }
    +
    + * {
    + box-sizing: border-box;
    + margin: 0;
    + padding: 0;
    + }
    +
    + body {
    + font-family: 'Segoe UI', system-ui, sans-serif;
    + line-height: 1.6;
    + color: var(--text);
    + background-color: var(--background);
    + }
    +
    + .container {
    + max-width: 1200px;
    + margin: 0 auto;
    + padding: 0 20px;
    + }
    +
    + .hero {
    + background: linear-gradient(135deg, var(--primary), var(--secondary));
    + color: var(--white);
    + padding: 4rem 0;
    + text-align: center;
    + margin-bottom: 2rem;
    + }
    +
    + .hero h1 {
    + font-size: 3rem;
    + margin-bottom: 1rem;
    + }
    +
    + .tagline {
    + font-size: 1.2rem;
    + opacity: 0.9;
    + }
    +
    + .filters {
    + display: flex;
    + gap: 1rem;
    + margin-bottom: 2rem;
    + flex-wrap: wrap;
    + }
    +
    + .filters label {
    + display: flex;
    + align-items: center;
    + gap: 0.5rem;
    + background: var(--white);
    + padding: 0.5rem 1rem;
    + border-radius: 25px;
    + cursor: pointer;
    + transition: all 0.3s ease;
    + }
    +
    + .filters label:hover {
    + transform: translateY(-2px);
    + box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    + }
    +
    + .stock-grid {
    + display: grid;
    + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    + gap: 1rem;
    + margin-bottom: 2rem;
    + }
    +
    + .stock-card {
    + background: var(--white);
    + padding: 1rem;
    + border-radius: 8px;
    + box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    + transition: all 0.3s ease;
    + cursor: pointer;
    + }
    +
    + .stock-card:hover {
    + transform: translateY(-3px);
    + box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    + }
    +
    + .selected-stocks {
    + display: flex;
    + gap: 1rem;
    + flex-wrap: wrap;
    + margin-bottom: 2rem;
    + }
    +
    + .btn-backtest {
    + background: var(--accent);
    + color: var(--white);
    + border: none;
    + padding: 1rem 2rem;
    + border-radius: 25px;
    + cursor: pointer;
    + font-size: 1rem;
    + transition: all 0.3s ease;
    + }
    +
    + .btn-backtest:hover {
    + background: #d35400;
    + transform: translateY(-2px);
    + }
    +
    + .results {
    + margin-top: 2rem;
    + padding: 1rem;
    + background: var(--white);
    + border-radius: 8px;
    + box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    + }
    +
    + @media (max-width: 768px) {
    + .hero h1 {
    + font-size: 2rem;
    + }
    +
    + .stock-grid {
    + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    + }
    + }