Code Sketch


Bixuu02 mona lisa part-01
By: Mhalsakant School
Category: Programming
//> using platform jvm
//> using jvm 17

import javax.swing._
import javax.swing.event._
import java.awt._
import java.awt.event._

object MonaLisaPart1App {

  def main(args: Array[String]): Unit = {

    SwingUtilities.invokeLater(new Runnable {
      def run(): Unit = {

        // 1. SECURITY VERIFICATION
        val correctPassword = "Bixuu02_anime"
        val userInput = JOptionPane.showInputDialog(
          null,
          "? ARTISTIC SECURITY VERIFICATION (MONA LISA PART 1)\n\nPlease enter Password to access Mona Lisa Part 1 Story:",
          "Mona Lisa Gallery Access",
          JOptionPane.QUESTION_MESSAGE
        )

        if (userInput == null || userInput != correctPassword) {
          JOptionPane.showMessageDialog(
            null,
            "? Access Denied! Incorrect Password.",
            "Error",
            JOptionPane.ERROR_MESSAGE
          )
          sys.exit(0)
        }

        // 2. STORY DATA (MONA LISA PART 1 - EPISODES 1 TO 20)
        val storyData: Map[String, String] = Map(
          "Chapter 1: The Florence Renaissance" ->
            """==================================================
              |ART & MYSTERY STORY: MONA LISA PART 1 (THE CREATION)
              |Inspired by History | Written by Bixuu
              |==================================================
              |
              |MAIN CHARACTERS:
              | - Leonardo da Vinci (The Master Genius Painter)
              | - Lisa Gherardini (Mona Lisa / The Noblewoman)
              | - Francesco del Giocondo (Lisa's Wealthy Husband)
              | - Salai (Leonardo's Apprentice)
              |
              |CHAPTER 1 STORY & DIALOGUES:
              |16th century ka Florence sheher Renaissance (punarjagran) ki roshni mein chamak raha hai. Leonardo da Vinci apne workshop mein alag-alag inventions aur paintings par kaam kar rahe hain.
              |
              |Salai (Da Vinci se): "Master Leonardo, Florence ke sabse amir merchant Francesco del Giocondo aapse milne aaye hain. Unhe apni patni ki ek portrait banwani hai."
              |Leonardo: "Unhe andar le aao, Salai. Dekhte hain ki kismat humare canvas par kya likhti hai."
              |===================================================""".stripMargin,

          "Chapter 2: The Meeting of Art and Nobility" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 2 STORY & DIALOGUES:
              |Francesco del Giocondo apni patni Lisa Gherardini ke sath Leonardo ke studio mein aate hain. Lisa ke chehre par ek ajeeb sa ghamand aur gahraipan dikhta hai.
              |
              |Francesco: "Master Leonardo, meri patni Lisa ka ek aisa portrait banaiye jo sadiyon tak yaad rakha jaye. Main iske liye koi bhi keemat chukane ko tayar hoon."
              |Lisa Gherardini: "Master da Vinci, kya aap meri sachhi rooh ko canvas par utar payenge?"
              |Leonardo: "Koshish zaroor karunga, Madonna Lisa."
              |===================================================""".stripMargin,

          "Chapter 3: The First Brushstroke" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 3 STORY & DIALOGUES:
              |Agle din se Lisa roz subah Leonardo ke studio aane lagti hai. Leonardo apne wooden easel ke samne baith kar wood aur oil paints tayar karte hain.
              |
              |Leonardo: "Apna sir thoda sa bayen (left) taraf rakho, aur waisi hi nazrein seedhi rakho... haan, bilkul wahi."
              |Lisa: "Aap meri aankhon mein kya dekh rahe hain, Master?"
              |Leonardo: "Main ye dekh raha hoon ki duniya ki har khushi aur dard ke peeche kya chhupa hota hai."
              |===================================================""".stripMargin,

          "Chapter 4: The Secrets of Sfumato" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 4 STORY & DIALOGUES:
              |Leonardo apni ek khaas technique 'Sfumato' (jisme rangon ko aapas mein aise milaya jata hai ki koi lines ya borders na dikhein) ka istemal shuru karte hain.
              |
              |Salai (Chupke se dekh kar): "Master, aap bina kisi sharp line ke chehre ko itna zinda kaise bana lete hain?"
              |Leonardo: "Kyunki aatma ki koi boundary nahi hoti, Salai. Rang bhi waise hi behne chahiye."
              |===================================================""".stripMargin,

          "Chapter 5: Whispers of Florence" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 5 STORY & DIALOGUES:
              |Florence ki galiyon mein charcha hone lagti hai ki Leonardo da Vinci apna naya masterwork bana rahe hain jo abhi tak ka sabse alag portrait hoga. Kuch log isse chamatkar mante hain toh kuch andhvishwas.
              |
              |Local Merchant: "Suna hai Leonardo ek aisi aurat ki tasveer bana raha hai jiska chehra har baar dekhne par alag lagta hai!"
              |===================================================""".stripMargin,

          "Chapter 6: The Mysterious Smile" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 6 STORY & DIALOGUES:
              |Jab bhi Leonardo painting par kaam karte hain, Lisa ki muskaan thodi si badal jati hai. Kabhi wo thodi udaas lagti hai, toh kabhi hasti hui si.
              |
              |Leonardo (Apne aap se): "Yeh muskaan... ye aisi kya baat chhupaye hue hai? Iske honthon par ek rahasya hai jo main poori tarah pakad nahi pa raha."
              |Lisa: "Kya aap meri muskaan se dar rahe hain, Master?"
              |Leonardo: "Nahi, main isse mohit ho chuka hoon."
              |===================================================""".stripMargin,

          "Chapter 7: Francesco's Impatience" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 7 STORY & DIALOGUES:
              |Mahine beet jate hain, par Leonardo painting poori nahi karte. Francesco gusse mein studio mein aata hai aur jaldi painting dene ko kehta hai.
              |
              |Francesco: "Kitne mahine ho gaye hain, Leonardo! Kya tum meri patni ka portrait poora nahi karoge?"
              |Leonardo: "Kala koi jaldbaazi ka kaam nahi hai, Francesco. Ek mahan cheez ko waqt lagta hai."
              |Lisa (Shant hokar): "Main intezaar kar sakti hoon, mere pati."
              |===================================================""".stripMargin,

          "Chapter 8: The Musician and the Jester" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 8 STORY & DIALOGUES:
              |Lisa ka mood hamesha ek jaisa rakhne ke liye Leonardo apne studio mein sangeetkaaron (musicians) aur jokers ko bulate hain jo geet gate hain taaki Lisa ke chehre par wahi natural aur rahasyamayi muskaan bani rahe.
              |
              |Musician (Lute bajate hue): "Suno ye meetha geet, jo dil ko sukoon de."
              |Lisa (Halki si muskurahat ke sath): "Ye sangeet mujhe mere bachpan ki yaad dila deta hai."
              |===================================================""".stripMargin,

          "Chapter 9: The Background Landscape" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 9 STORY & DIALOGUES:
              |Leonardo painting ke peeche ke background (pahaad, nadi, aur daldal wala rasta) par kaam karna shuru karte hain. Wo is landscape ko ekdreamy aur unrealistic tarike se design karte hain.
              |
              |Salai: "Master, ye background asli duniya jaisa nahi lag raha. Yeh toh kisi sapne ka hissa lagta hai."
              |Leonardo: "Kyunki insaan ki roshni aur andhera dono prakriti ke sath jude hain, Salai."
              |===================================================""".stripMargin,

          "Chapter 10: The Secret Notebooks" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 10 STORY & DIALOGUES:
              |Raat ke sannate mein Leonardo apne mirror-writing notebooks (ulta likhne wale notes) mein optical illusions aur roshni ke kanoon likhte hain jo us painting mein use kiye gaye hain.
              |
              |Leonardo (Likhte hue): "Aankhon ki roshni aur mastishq ka dhokha hi is muskaan ka asli sach hai..."
              |===================================================""".stripMargin,

          "Chapter 11: Whispers in the Shadows" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 11 STORY & DIALOGUES:
              |Ek raat studio ke bahar kuch anjaan log aate hain aur us painting ko churane ya usme kuch tod-phod karne ki koshish karte hain, kyunki unhe lagta hai ki isme koi hidden code hai.
              |
              |Salai (Daudte hue andar aakar): "Master! Bahar kuch shaqi log ghoom rahe hain!"
              |Leonardo: "Darr mat, Salai. Jo cheez dil se banti hai, use shaitan bhi nahi chhoo sakta."
              |===================================================""".stripMargin,

          "Chapter 12: Lisa's Deep Confession" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 12 STORY & DIALOGUES:
              |Agli subah jab Lisa aati hai, toh wo Leonardo ke sath apne jeevan ke kuch gehre dard aur rahasya share karti hai, jisse uski aankhon ki chamak aur bhi badal jati hai.
              |
              |Lisa: "Master, har aurat ke jeevan mein ek aisi kahani hoti hai jo wo kisi ko nahi bata sakti... par shayad aapne wo meri tasveer mein dekh li hai."
              |Leonardo: "Maine sirf wahi dekha jo aapka dil dikhana chahta tha."
              |===================================================""".stripMargin,

          "Chapter 13: Adding the Final Layers" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 13 STORY & DIALOGUES:
              |Leonardo apne patle se patle brush se painting par glaze ki layers chadhate hain. Ye process mahino tak chalti hai, aur painting dheere-dheere poori hone lagti hai.
              |
              |Leonardo: "Bas ab kuch hi brushstrokes bache hain... aur ye tasveer amar ho jayegi."
              |===================================================""".stripMargin,

          "Chapter 14: The Rivalry of Artists" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 14 STORY & DIALOGUES:
              |Florence ke doosre mashhoor painter (jaise Michelangelo) ko jab is masterpiece ke baare mein pata chalta hai, toh wo bhi ise dekhne ki khwahish zahir karte hain.
              |
              |Michelangelo (Door se dekh kar): "Leonardo ki ye kala aisi hai jise samajhna har kisi ke bas ki baat nahi hai."
              |===================================================""".stripMargin,

          "Chapter 15: The Painting Comes to Life" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 15 STORY & DIALOGUES:
              |Jab koi bhi us painting ko dekhta hai, toh unhe lagta hai ki Mona Lisa ki nazrein unhi ka peecha kar rahi hain, chahe aap kisi bhi kone se dekhein.
              |
              |Salai (Hairan hokar): "Master! Iski aankhein... ye mujhe hi dekh rahi hain, main chahe jahan bhi khada ho jaun!"
              |Leonardo (Muskurate hue): "Yahi toh optical magic hai, mere dost."
              |===================================================""".stripMargin,

          "Chapter 16: Francesco Returns for the Masterpiece" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 16 STORY & DIALOGUES:
              |Francesco del Giocondo dobara studio mein aate hain aur painting ko final state mein dekhte hain. Unki aankhein fati ki fati reh jati hain.
              |
              |Francesco: "Yeh... yeh toh insaan se bhi zyada zinda lag rahi hai! Leonardo, tumne kamaal kar diya!"
              |===================================================""".stripMargin,

          "Chapter 17: Leonardo Refuses to Let It Go" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 17 STORY & DIALOGUES:
              |Halanki painting Francesco ke liye banayi gayi thi, par Leonardo isse itna jud chuke hote hain ki wo ise apne sath hi rakhna chahte hain aur France jane ka faisla karte hain.
              |
              |Leonardo: "Francesco, ye painting abhi poori nahi hui hai... main ise apne sath apne safar par le jaunga."
              |===================================================""".stripMargin,

          "Chapter 18: Traveling to France" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 18 STORY & DIALOGUES:
              |Leonardo da Vinci apna saaman aur is amulya painting ko lekar France ke king (Francis I) ke bulave par nikal padte hain. Wo is painting ko apne ek khaas wooden box mein mehfooz rakhte hain.
              |
              |Leonardo (Apne box ko dekhte hue): "Yeh muskaan duniya ke har kone tak jayegi."
              |===================================================""".stripMargin,

          "Chapter 19: The Legacy Begins" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 19 STORY & DIALOGUES:
              |France ke royal palace mein sabhi is painting ko dekh kar dang reh jate hain. King Francis I ise khareed lete hain aur apne royal museum mein jagah dete hain.
              |
              |King Francis: "Yeh duniya ki sabse khubsurat kala hai!"
              |===================================================""".stripMargin,

          "Chapter 20: Part 1 Finale & Epilogue" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 20 STORY & DIALOGUES (PART 1 FINALE):
              |Ek final grand message screen par flash hota hai.
              |
              |Author's Final Note:
              | "Mona Lisa ki wo rahasyamayi muskaan sadiyon tak duniya ko hairaan karti rahegi. Part 1 ka safar yahan khatam hota hai, aage ke rahasya Part 2 mein khulenge!"
              |
              |THE END - MONA LISA PART 1 WRITTEN & ADAPTED BY BIXUU.
              |==================================================
              |
              |? ANNOUNCEMENT FROM CREATOR BIXUU:
              |"BIXUU (??????) BROUGHT YOU MONA LISA PART 1! 
              |Hope you loved this artistic masterpiece beginning. Stay tuned for Part 2!"
              |===================================================""".stripMargin
        )

        // 3. GUI WINDOW CREATION
        val frame = new JFrame("Art Story Viewer: MONA LISA PART 1 - By Bixuu")
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
        frame.setSize(950, 650)
        frame.setLocationRelativeTo(null)

        // Header (Renaissance Golden/Brown Theme Color)
        val headerLabel = new JLabel("  ? MONA LISA PART 1: THE MYSTERIOUS SMILE & MASTERPIECE (Adapted by Bixuu)  ", SwingConstants.CENTER)
        headerLabel.setFont(new Font("Arial", Font.BOLD, 14))
        headerLabel.setOpaque(true)
        headerLabel.setBackground(new Color(80, 50, 20))
        headerLabel.setForeground(Color.WHITE)
        headerLabel.setPreferredSize(new Dimension(950, 40))

        // Chapter List
        val chapterKeys = (1 to 20).map(i => storyData.keys.find(_.startsWith(s"Chapter $i:")).getOrElse(s"Chapter $i")).toArray
        val listModel = new DefaultListModel[String]()
        chapterKeys.foreach(listModel.addElement)

        val chapterList = new JList[String](listModel)
        chapterList.setFont(new Font("Arial", Font.PLAIN, 12))
        chapterList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
        chapterList.setSelectedIndex(0)

        val listScrollPane = new JScrollPane(chapterList)
        listScrollPane.setPreferredSize(new Dimension(320, 500))

        // Story Text Area
        val storyArea = new JTextArea()
        storyArea.setFont(new Font("Monospaced", Font.PLAIN, 13))
        storyArea.setEditable(false)
        storyArea.setLineWrap(true)
        storyArea.setWrapStyleWord(true)
        storyArea.setBackground(new Color(20, 20, 20))
        storyArea.setForeground(new Color(230, 230, 230))
        storyArea.setText(storyData(chapterKeys(0)))
        storyArea.setCaretPosition(0)

        val textScrollPane = new JScrollPane(storyArea)

        // Selection Listener
        chapterList.addListSelectionListener(new ListSelectionListener {
          def valueChanged(e: ListSelectionEvent): Unit = {
            if (!e.getValueIsAdjusting) {
              val selectedKey = chapterList.getSelectedValue
              if (selectedKey != null && storyData.contains(selectedKey)) {
                storyArea.setText(storyData(selectedKey))
                storyArea.setCaretPosition(0)
              }
            }
          }
        })

        // Layout Assembly
        val mainPanel = new JPanel(new BorderLayout())
        mainPanel.add(headerLabel, BorderLayout.NORTH)
        mainPanel.add(listScrollPane, BorderLayout.WEST)
        mainPanel.add(textScrollPane, BorderLayout.CENTER)

        frame.add(mainPanel)
        frame.setVisible(true)
      }
    })
  }
}

// Direct Execution Entrypoint for Scala Script / REPL
MonaLisaPart1App.main(Array())